Help / WLanguage / WLanguage functions / Standard functions / Geolocation functions
  • Special cases
  • Required application feature
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Asks to be notified when the device gets close to a given location.
// Enable the notification request
GPSDetectPosition(DetectionProc, 1.145258, 30.968745)
// Procedure called during the notification
PROCÉDURE DetectionProc(Enter is boolean)
IF Enter = True THEN
Info("You have reached your destination.")
<Result> = GPSDetectPosition(<WLanguage procedure> , <Latitude> , <Longitude> [, <Radius> [, <Timeout>]])
<Result>: Integer
Detection identifier.
This identifier is used in the following cases:
  • to stop the notification mechanism. Simply pass this identifier as a parameter to GPSStopDetection.
  • to identify the location processed in the WLanguage procedure called (case where the same WLanguage procedure is used to process several locations).
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback" procedure) called when the device enters into or exits from the region delimited by the specified parameters.
For more details on this procedure, see Parameters of the procedure used by GPSDetectPosition.
<Latitude>: Real
Latitude of the proximity location.
<Longitude>: Real
Longitude of the proximity location.
<Radius>: Optional real
Radius (in meters), around the proximity location, from which the notification is to be generated.
If this parameter is not specified, the radius around the location will be set to 50 meters.
<Timeout>: Optional integer or optional Duration
Timeout (in hundredths of a second) of the proximity alert. This timeout starts from the call to the function.
  • No timeout will be defined if this parameter is set to -1 or if it is not specified.
  • If this timeout is specified, the notification mechanism will automatically stop at the end of the timeout.
This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s or 10 ms).

Special cases

  • To stop receiving notifications, use GPSEnd.
  • To stop detecting the proximity of a specific location;
    • return False in the associated WLanguage procedure,
    • use the GPSStopDetection function.
  • You can detect the proximity to multiple locations by calling GPSDetectPosition for each location. If the same procedure is called for several locations, it is possible to differentiate these locations in the WLanguage procedure with the <Detection identifier> parameter. This parameter corresponds to the result of GPSDetectPosition.
  • Location measurements can be more or less accurate depending on the parameters of the location provider. Therefore, it may happen that no notification is sent if the device briefly passes near the monitored area. Similarly, a notification may be received if the device comes very close to the monitored area without entering it.
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required feature: Geolocation
This feature allows the applications to access the geolocation features found on the device or on the computer.
Business / UI classification: Business Logic
Component: wd270java.dll
Minimum version required
  • Version 15
This page is also available for…
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help