Home | Sign in | English EN
  • Browsers allowing the geolocation
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Requests to be notified periodically of the device's current location.
// Enables a procedure to receive the device's location at regular intervals
// Procedure
PROCEDURE MovementProc(pos is geoPosition)
Info(" Latitude: " + pos.Latitude)  
Info(" Longitude: " + pos.Longitude)
WEBDEV - Browser code

Enabling the notification mechanism in browser code Hide the details

GPSFollowMovement(<WLanguage procedure>)
<WLanguage procedure>: Procedure name
Name of WLanguage procedure called at each notification. This procedure has the following format:
PROCEDURE <Procedure name>(<Location>, <Error>)
  • <Location> is a variable of type geoPosition that contains information about the device's location at the time of the notification. To determine if a value was assigned to the Speed, Accuracy, Direction or Altitude properties of a geoPosition variable when the location was retrieved, use the SpeedValid, AccuracyValid, DirectionValid and AltitudeValid properties.
  • <Error> is an Integer constant corresponding to the error code and that can take the following values:
    gpsErrorOKNo error was detected.
    gpsErrorPositionUnable to determine the location (e.g., access provider internal error).
    gpsErrorRightsThe browser has no sufficient rights to use geolocation.
    gpsErrorTimeoutThe location could not be retrieved within the timeout.

Disabling the notification mechanism

WEBDEV - Browser code

Browsers allowing the geolocation

Caution: Geolocation is only available on certain modern browsers:
  • FireFox from version 3.5,
  • Chrome from version 5.0.342.1,
  • Opera from version 10.6,
  • Safari from version 5.0.
During the call to a geolocation function, the browser requests a location authorization.Remark: From Chrome 50 (including on Android), GPSFollowMovement can only be used on the sites secured via an SSL certificate for example. If the site is not secured, the function returns a result that cannot be used. During the test in local (localhost), the function operates properly.
Related Examples:
Android GPS Android (WINDEV Mobile): Android GPS
[ + ] This example presents the use of the GPS functions of WLanguage in an Android application.
It is used to retrieve at regular interval:
- The latitude
- The longitude
- The altitude
- The speed
- The direction
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: wd270java.dll
Minimum version required
  • Version 15
This page is also available for…
GPS Functions

10 Nov. 2018