Sub Geocode( Acity As String, Astreet As String, Ahousenr As String) - TomTom Navigator SDK Installation And Use Manual

Version 3.0 build 193
Table of Contents

Advertisement

5. Communicating with TomTom Navigator from Visual Basic
5.2.26. Sub Geocode( aCity As String, aStreet As String, aHouseNr As
String)
Command Parameters:
• aCity As String: city name.
• aStreet As String: street name.
• aHouseNr As String: house number.
Supported Since: TTN 1.51
Find the location specified by an address, given by the city name, street name and house number
arguments, and return the co−ordinates of the found location and its complete city and street names in the
corresponding read−only properties of the control. If the street name argument is empty, the function will
try to find the center of the city specified by the city name argument. The house number is always ignored
in versions of TomTom Navigator prior to 2.0. If no location is found with city and street names exactly
matching the arguments, then a city and a street will be chosen with names as similar as possible to the
given ones. This will be indicated in the geocode status property of the control.
Property GeocodeStatus As Long: Validity of the rest of the geocode properties, as explained below
Property GeocodeLongitude As Long: Longitude in millionths of degree (WGS84 format)
Property GeocodeLatitude As Long: Latitude in millionths of degree (WGS84 format)
Property GeocodeCity As String: Complete city name
Property GeocodeStreet As String: Complete street name
The geocode status property can contain the following flags:
• 8 − no location found at all, the rest of the geocode properties are invalid
• 4 − the given city name was ambiguous, random (possibly wrong) selection made
• 2 − the given street name was ambiguous, tried to make smart selection
• 1 − the house number was ignored, either because there was no house number data available or
because the given house number was not found
If Geocode has never been called, GeocodeStatus will be 8, indicating that the rest of these properties
don't contain valid information.
Example:
The following example shows how to instruct TomTom Navigator to plan a route to a given address.
Sub NavigateToAddress
On Error GoTo NavigateToAddress_Error
Call TTNav.Geocode("Zwanenburg", "Julianalaan", "12")
If TTNav.GeocodeStatus <> 8 Then
Call TTNav.NavigateToCoordinate(TTNav.GeocodeLongitude, ¬
Else
MsgBox "Address not found"
End If
NavigateToAddress_Exit:
Exit Sub
NavigateToAddress_Error:
MsgBox "Failed to navigate to address"
Resume NavigateToAddress_Exit
TTNav.GeocodeLatitude, ¬
"Julianalaan, 12")
24

Advertisement

Table of Contents
loading

Table of Contents