PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Browsers allowing the geo-localization
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 22 and later
Windows This function is now available for the WINDEV applications.
New in version 22
Windows This function is now available for the WINDEV applications.
Windows This function is now available for the 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
WEBDEV - Browser code

Enabling the notification mechanism in browser code Hide the details

GPSFollowMovement(<Procedure Name>)
<Procedure Name>: Character string (with or without quotes)
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 when the notification is performed. 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 the geo-localization.
    gpsErrorPositionUnable to define the position (internal error of provider for example).
    gpsErrorTimeoutThe position was not retrieved within the time-out.

Disabling the notification mechanism

GPSFollowMovement()
Remarks
WEBDEV - Browser code

Browsers allowing the geo-localization

Caution: The geo-localization is available for the most recent browsers only:
  • 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 geo-localization function, the browser requests the authorization to localize.
Note: 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 : wd240java.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