Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SearchSuggestion

Represents a search suggestion that is part of the search results for a search operation.

Hierarchy

Index

Constructors

constructor

  • new SearchSuggestion(name: string, streetNumber: number, subregions: string[], regionLevel: number, regions: string[], postcode: string, country: Country, location: LatLon, streetNumberFull?: string, units?: AddressUnit[]): SearchSuggestion
  • Initializes a SearchSuggestion object.

    Parameters

    • name: string
    • streetNumber: number
    • subregions: string[]
    • regionLevel: number
    • regions: string[]
    • postcode: string
    • country: Country
    • location: LatLon
    • Optional streetNumberFull: string
    • Optional units: AddressUnit[]

    Returns SearchSuggestion

Properties

country

country: Country

The country in which the suggestion is located.

location

location: LatLon

The LatLon object representing the suggestion's location.

name

name: string

The name of the search suggestion.

postcode

postcode: string

The post or zip code for this suggestion.

regionLevel

regionLevel: number

The region level, which is used to create a list of region names in the appropriate order (from most specific to least specific).

regions

regions: string[]

The list of regions for this suggestion, with the most specific region (e.g. city) first.

streetNumber

streetNumber: number

The street number of the suggestion. This takes numbers only, unlike streetNumberFull.

Optional streetNumberFull

streetNumberFull: string

The street number of the suggestion e.g. 20, 5b or 10-12. This takes characters aside from just numbers, unlike streetNumber.

subregions

subregions: string[]

The list of subregions for this suggestion (e.g. suburbs within a city).

Optional units

units: AddressUnit[]

The list of address units, such as an apartment or floor.

Static INVALID_STREET_NUMBER

INVALID_STREET_NUMBER: number = -1

Methods

Protected _toAddressData

  • _toAddressData(isStreetResult: boolean, isPostcodeResult: boolean, isRegionResult: boolean): IAddressData
  • Parameters

    • isStreetResult: boolean
    • isPostcodeResult: boolean
    • isRegionResult: boolean

    Returns IAddressData

getStreetNumber

  • getStreetNumber(): string
  • Returns the street number of this suggestion as a string. If this suggestion doesn't have a valid street number, returns null instead.

    Returns string

    the street number for the suggestion, or null if there is no street number

Generated using TypeDoc