Click or drag to resize

Telogis.GeoBase.AutocompleteGeocoder

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release

Contains functions for sending the GeoStream server a partial address query while the user is typing, in order to return region or street suggestions for the user to choose from. Note that you can enable the GeocodingLogging option to monitor GeoStream geocoding performance. For more information see web.config

Classes
NameDescription
AutocompleteGeocoder.ACGeoCoderSearchResultRepresents the values returned from the GeoStream server as the result of an auto-complete geocoding operation. Contains the search status (whether the search was completed or indeterminate) and an array of AutocompleteGeocoder.Suggestions.
AutocompleteGeocoder.SuggestionTwo suggestion types are supported by this class: regions and street addresses. Region suggestions come with a bounding box value to be zoomed to on the map. A street address suggestion can be a street-name-only suggestion, which enables the user to select a whole street name instead of having to type it to the end, or a full address suggestion, which can describe a particular LatLon on the map along with the full name of the address.
Functions
NameDescription
geoCode (String query, String or BoundingBox countryOrZone, LatLon locationHint, Number timeoutSecs, Function callback, Function errorCallback, Object server)

Search for suggestions according to a partial address query which the user is typing.

JavaScript
AutocompleteGeocoder.geoCode(
    "Rua treze, jag",
    "brazil",
    new LatLon(),
    3,
    function (searchResult) {
        console.log(searchResult);
    }
);
Arguments
  • query (String) - The query string to search for.

  • countryOrZone (String or BoundingBox) - If a a string of country name is passed as argument, the search is performed within that country. If a valid BoundingBox is passed as argument, the search is performanced among those countries in the BoundingBox. To search among all available countries, pass "new BoundingBox(new LatLon(), new LatLon())".

  • locationHint (LatLon) - If the search is performed within a specified country, the suggestions will be sorted according to locationHint, from nearest to farthest. If the search is performed among multiple countries, suggestions from the country where locationHint resides will come first in the suggestion list, and these suggestions will be sorted according to locationHint, from nearest to farthest. Suggestions from other countries will not be sorted according to locationHint. If no hint is intended, pass "new LatLon()" as argument.

  • timeoutSecs (Number) - Specify how long (in seconds) the server will be searching for suggestions before giving up. Specify a timeout of 0 means never time out. When time is out, the server returns whatever suggestions it has found so far with a status of "Timeout".

  • callback (Function) - The arbitrary callback to execute once the geocoding request returns.

    Arguments
  • (Optional) errorCallback (Function) - A callback to execute if an error or timeout occurs when performing the geocode. Returns the error or timeout that occurred when performing the query. Defaults to null.

    Arguments
    • error (Telogis.Errors.GeoBaseError) - An exception describing the problem that was encountered by the geocoder.

  • server (Object) - An optional object that contains server.url (The address of the GeoStream server as a string) and server.authToken (The GeoStream authentication token to be used for requesting tiles) to be used for this request.