Sub Getcurrentposition( ); Sub Makepoivisible( Apoitypeid As Long, Avisibility As Boolean) - TomTom Navigator SDK Installation And Use Manual

Version 3.0 build 193
Table of Contents

Advertisement

5. Communicating with TomTom Navigator from Visual Basic
• 23 − AutoZoomOn: turn on automatic zooming
• 24 − AutoZoomOff: turn off automatic zooming
Example:
The following example invocation call demonstrates how to switch the map display to night colors:
Sub SwitchToNightView
On Error GoTo SwitchToNightView_Error
Call TTNav.SendDirectCommand(3)
SwitchToNightView_Exit:
Exit Sub
SwitchToNightView_Error:
MsgBox "Failed to change to night view mode"
Resume SwitchToNightView_Exit
End Sub

5.2.19. Sub GetCurrentPosition( )

Supported Since: TTN 1.42
Obtains the current position information from GPS. The GPS data is available after this call in the
read−only properties GpsStatus, Longitude, Latitude, Direction and Speed:
Property GpsStatus As Long: Indication of the quality of the GPS data (if < 0 indicates an error)
Property Longitude As Long: Longitude in millionths of degree (WGS84 format)
Property Latitude As Long: Latitude in millionths of degree (WGS84 format)
Property Direction As Long: Direction in degrees: zero is north, clockwise
Property Speed As Long: Speed in kilometers per hour
If GetCurrentPosition has never been called, GpsStatus will be −1, indicating that these properties don't
contain valid GPS information.
Example:
The shows how the GetCurrentPosition call can be used to warn when the driver is driving too fast.
Sub CheckSpeed
On Error GoTo CheckSpeed_Error
Call TTNav.GetCurrentPosition
If TTNav.GpsStatus >= 0 And TTNav.Speed > 120 Then
MsgBox "You are driving too fast!"
End If
CheckSpeed_Exit:
Exit Sub
CheckSpeed_Error:
MsgBox "Failed to get the current location"
Resume CheckSpeed_Exit
End Sub
5.2.20. Sub MakePoiVisible( aPoiTypeID As Long, aVisibility As
Boolean)
Command Parameters:
• aPoiTypeID As Long: POI unique type identifier
• aVisibility As Boolean: whether to show or hide this POI type on the map
20

Advertisement

Table of Contents
loading

Table of Contents