PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Retrieved properties
  • Notes
  • Operating mode in iPhone/iPad
  • Required permissions
  • Required application feature
  • Browsers allowing the geolocation
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Asks to be regularly notified about the current device position.
Versions 16 and later
WEBDEV - Browser code This function is now available in Browser code.
New in version 16
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code This function is now available in Browser code.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Android Widget This function is now available in Android Widget mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 22 and later
WINDEVWindows This function is now available for WINDEV applications.
New in version 22
WINDEVWindows This function is now available for WINDEV applications.
WINDEVWindows This function is now available for WINDEV applications.
Example
// Branches a procedure to receive the device position at regular intervals
GPSFollowMovement(MovementProc)
// Procedure
PROCEDURE MovementProc(pos is geoPosition)
 
Info(" Latitude: " + pos..Latitude)  
Info(" Longitude: " + pos..Longitude)
Syntax
AndroidAndroid Widget iPhone/iPadUniversal Windows 10 App

Enabling the notification mechanism (in a mobile) Hide the details

GPSFollowMovement(<WLanguage procedure> [, <Timeout> [, <Distance>]])
<WLanguage procedure>: Procedure name
Name of WLanguage procedure called at each notification.
This procedure has the following format:
PROCEDURE <Procedure name>(<Position>)
<Position> is a geoPosition variable containing information about the device position at the time of notification.
<Timeout>: Optional integer or optional Duration
Minimum timeout (in hundredths of a second) between two notifications. If this parameter is not specified, the minimum time-out will be set to 60 seconds.
Remark: This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
Universal Windows 10 App This parameter is ignored.
<Distance>: Optional real
Minimum distance (in meters) between two notifications.
If this parameter is not specified, the minimum distance will be set to 5 meters.
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>(<Position>, <Error>)
where:
  • <Position> is a geoPosition variable containing information about the device position at the time of notification. To find out whether the ..Speed, ..Precision, ..Direction or ..Altitude properties of a geoPosition variable have been filled when retrieving the position, use ..SpeedValid, ..PrecisionValid, ..DirectionValid and ..AltitudeValid.
  • <Error> is an Integer constant corresponding to the error code and that can take the following values:
    gpsErrorOKNo error was detected.
    gpsErrorRightsThe browser has no sufficient rights to use geolocation.
    gpsErrorPositionUnable to define the position (internal error of provider for example).
    gpsErrorTimeoutThe position could not be retrieved within the timeout.

Disabling the notification mechanism

GPSFollowMovement()
Remarks
AndroidAndroid Widget iPhone/iPadUniversal Windows 10 App

Retrieved properties

AndroidAndroid Widget iPhone/iPadUniversal Windows 10 App

Notes

Versions 17 and later
iPhone/iPad

Operating mode in iPhone/iPad

When a GPS function is first run, the system requests geolocation permission from the user. If the user refuses, all the GPS functions used in the rest of the application will fail (fatal error).
To re-allow the use of GPS for this application, the system configuration of the application must be modified.
New in version 17
iPhone/iPad

Operating mode in iPhone/iPad

When a GPS function is first run, the system requests geolocation permission from the user. If the user refuses, all the GPS functions used in the rest of the application will fail (fatal error).
To re-allow the use of GPS for this application, the system configuration of the application must be modified.
iPhone/iPad

Operating mode in iPhone/iPad

When a GPS function is first run, the system requests geolocation permission from the user. If the user refuses, all the GPS functions used in the rest of the application will fail (fatal error).
To re-allow the use of GPS for this application, the system configuration of the application must be modified.
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: ACCESS_FINE_LOCATION.
Android 10 specific case: Android 10 has implemented a new permission for the functions that allow locating the device: ACCESS_BACKGROUND_PERMISSION.
This permission allows using the function when the application is in the background.
When this permission is added to the application, a window allows the user to:
  • allow access to the device location while the application is in the background,
  • allow access to the location only while the application is in use,
  • deny access to the location.
The user can also change this permissions at any time in the Android settings.
Versions 21 and later
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of one application feature 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.
New in version 21
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of one application feature 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.
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of one application feature 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.
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 : wd250java.dll
Minimum version required
  • Version 15
This page is also available for…
Comments
GPS Functions
https://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/519-busca-endereco-rota-endereco-das-coordendas-523/read.awp?hl=enderecodascoordenadas

https://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/2875-informatica-exemplo-google-maps-com-json-retornando-distancia/read.awp?lastview
BOLLER
10 Nov. 2018