HowTo: Using Geolocation Tracking

Official Content
This documentation is valid for:

In order to create an application to keep track of the device position, it is possible to program a Panel for Smart Devices object with three events (buttons):

The first allows to start the tracking points

Event 'StartTracking'
    Composite
        Geolocation.ClearLocationHistory()
        Geolocation.StartTracking(60,100,"",0)
        msg("Start")
    EndComposite
EndEvent

The second one allows to stop the tracking points:

Event 'StopTracking'
    Composite
        Geolocation.EndTracking()
        msg("Stop")
    EndComposite
EndEvent

At the end, the GeoPoints can be recovered with GetLocationHistory Method and it would be showed as an SDMAP grid: 

Event 'SetPositionsInMap'
    &locationCollection = Geolocation.GetLocationHistory(&Today)
Endevent

To download an example click  here.

Note that the tracking system can be expensive in terms of battery so the tracking operations should be started and ended based on the specific needs of the application.

Notes

  • In iOS, if the developer wants to do background tracking it is necessary to include the 'location' value to the Background Modes property.

See also

Geolocation - Show points near me
Geolocation - Showing My Location
Geolocation external object




Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.