Help / WLanguage / WLanguage functions / Standard functions / Geolocation functions
  • Specific features
  • Tracking management: low precision
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Defines the WLanguage procedure that will be called when the location of the user changes.
  • Before using this function, geoTrackingEnable must be used to enable location tracking.
  • To be run in the background, this function must be called in the "Initialization" event associated with the project. For more details, see Remarks.
// -- Project initialization (REQUIRED to run the function in the background)
// Implement the TrackingProcedure procedure
PROCÉDURE TrackingProcedure(mLocation is géoPosition)
// Send the location to the server
<Result> = geoTrackingProcedure(<WLanguage procedure>)
<Result>: Boolean
  • True if the location tracking system is available,
  • False if the location tracking system is not available. To get more details on the error, use ErrorInfo.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure called when the location of the user changes.
This procedure has the following format:
PROCEDURE <Procedure name>(<Location> is geoPosition)
In this code, <Location> is a geoPosition variable corresponding to the current location of the user.
This procedure must be a global procedure of application.

Specific features

  • geoTrackingProcedure must be called in the project initialization code. Indeed, the WLanguage procedure can be called just after the initialization, for a clock in background mode for example.
  • If the application is in stand-by mode, it is automatically restarted when a location is received.
  • iPhone/iPadIOS WidgetMac Catalyst geoTrackingProcedure can be used in the background. It is recommended not to access the interface or open windows in the WLanguage procedure, since iOS does not allow accessing the interface when the application is in the background.

Tracking management: low precision

Caution: This location tracking has low precision. The events are sent only if significant changes of location occur and at time intervals exceeding several minutes. For information, the sending conditions per platform are as follows:
  • iPhone/iPadIOS WidgetMac Catalyst The events regarding the change of location are not sent if the location did not change by more than 500 meters, or if the time interval is less than 5 minutes (December 2014).
  • Android Location change events are sent at intervals that range from 30 seconds to 10 minutes, depending on the distance between locations.
For a more precise tracking, you must use GPSFollowMovement. However, this function:
  • requires the application to be started,
  • Android requires the application to be in the foreground,
  • consumes more battery.
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.
Component: wd290android.aar
Minimum version required
  • Version 21
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help