Home | Sign in | English EN
  • Special cases
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Displays the current location of the device in a Map control and updates the location as it moves.
// Start movement tracking in the Map control
<Result> = MapFollowMovement(<Map control> [, <Compass> [, <WLanguage procedure>]])
<Result>: Boolean
  • True if the following of movement was enabled,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Map control>: Control name
Name of the Map control to be used. If this parameter corresponds to an empty string (""), the Map control to which the current event belongs will be used.
<Compass>: Optional boolean
  • True to enable the compass. A compass is displayed in the Map control to indicate the orientation of the move. This option is available for the devices equipped with an orientation sensor.
  • False (default value) to disable the compass.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called each time a movement notification is received. This procedure has the following format:
PROCEDURE <Procedure name> (<Position>)

where <Position> is a variable of type geoPosition that contains information about the device's location at the time of the notification.
The parameters of this procedure are optional. There is no need to pass parameters to this procedure. Indeed, these parameters are automatically filled during each call.
If this procedure returns False, the map displayed in the Map control will not be refreshed.
If this parameter is not specified, whenever a change of device position is notified, the map displayed in the Map control is automatically centered on the new position.

Special cases

  • To stop following the move, use MapEndOfMove.
  • A blue circle may appear around the marker, indicating the current position of the device. This circle is a representation of the level of precision regarding the position. The more it is extended, less precise the position will be. To define the location of the device, the function uses two types of "location providers":
    • the network of GPS satellites,
    • the triangulation performed from the network of mobile and Wi-Fi antennas.
    The location provider depends on the location settings of the device when the function is called
  • A certain amount of time may elapse between the call to MapFollowMovement and the actual display of the device location on the map. This time corresponds to the time taken by the location provider (GPS or mobile/Wi-Fi network) to define the current location of the device. Once this position is found, the map control is automatically centered on this one.
Related Examples:
WM Geolocation Cross-platform examples (WINDEV Mobile): WM Geolocation
[ + ] This example explains how to perform proximity searches with geolocation :
- search around me
- search in a city, at a given address, or close to a specific address.
The results are displayed in a looper and in a map with markers.
WM Sports Cross-platform examples (WINDEV Mobile): WM Sports
[ + ] This example is a sport application used to save your performances.
The application calculates the distance, the time, the average speed and the number of calories spent according to the sport.
The run is displayed on a map control via markers and an itinerary.

The example also includes a server part used to synchronize the user data.
This webservice is available in the WEBDEV "WW_Sports" example.
Component: WDJS.DLL
Minimum version required
  • Version 17
This page is also available for…
Click [Add] to post a comment