ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Geolocation functions
  • Properties specific to geoPosition variables
  • Functions that use geoPosition variables
  • Reinitialization
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The geoPosition type is used to handle geographic positions via WLanguage geolocation functions. A geographic position is defined by a latitude, a longitude and a measurement date. It can also include information on altitude, speed, direction and/or measurement accuracy.
The geoPosition type is used to define the advanced characteristics of a geographic position. The characteristics of this position can be defined and changed using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
pos1 is géoPosition
pos1.Latitude = 1.442951
pos1.Longitude = 43.604363
 
pos2 is géoPosition
pos2.Latitude = 2.505874
pos2.Longitude = 50.458744
 
InfoBuild("The distance between the two positions is %1 meters", géoDistance(pos1, pos2))
Remarks

Properties specific to geoPosition variables

The following properties can be used to handle geoPosition variables:
Property nameType usedEffect
AccuracyRealAccuracy of measurement (in meters).
This property is specified only when it is supported by the location provider.
This property was renamed in version 26. "Accuracy" is kept for backward compatibility.
AccuracyValidBooleanTrue if the current location contains valid accuracy information.
Accuracy is considered valid in the following cases:
  • it was assigned by programming.
  • it was initialized by the location provider.
AccuracyValid is accessible in read-only mode.
AltitudeRealAltitude of the position (in meters).
This property is specified only when it is supported by the location provider.
AltitudeValidBooleanTrue if the current location contains valid altitude information.
Altitude is considered valid in the following cases:
  • it was assigned by programming.
  • it was initialized by the location provider.
AltitudeValid is accessible in read-only mode.
DirectionRealMoving direction of the device (in degrees East of true North).
Remarks:
  • The value of Direction is taken into account unless the device moves too slowly.
  • This property is specified only when it is supported by the location provider.
DirectionValidBooleanTrue if the current location contains valid direction information.
Direction is considered valid in the following cases:
  • it was assigned by programming.
  • it was initialized by the location provider.
DirectionValid is accessible in read-only mode.
LatitudeRealLatitude of the position (in degrees).
Possible values range from -90° (South Pole) to +90° (North Pole).
LongitudeRealLongitude of the position (in degrees).
Possible values range from -180° (West longitude) to +180° (East longitude) relative to the Greenwich Meridian.
MeasurementDateDateTime variable or character stringDate and time of the measurement. This date and this time correspond to the local time on the device. To get the time in UTC format, use DateTimeLocalToUTC.
WEBDEV - Browser code This property is not specified.
PositionValidBooleanTrue if the latitude and/or the longitude have been specified for the current location.
PositionValid is accessible in read-only mode.
SpeedRealGround speed of the moving device (in meters/second).
This property is specified only when it is supported by the location provider.
SpeedValidBooleanTrue if the current location contains valid speed information.
Speed is considered valid in the following cases:
  • it was assigned by programming.
  • it was initialized by the location provider.
SpeedValid is accessible in read-only mode.

Functions that use geoPosition variables

geoAzimuthReturns the direction represented by a location in relation to another one.
geoDistanceReturns the distance between the two locations. This distance is expressed in meters by default.
geoRunAppStarts the device's native maps application to display:
  • a specific geographical location,
  • a route between two locations.
GPSGetPositionRetrieves information about the current device position.
GPSLastPositionRetrieves the information about the last known device position.
MapGetPositionReturns the geographical position of the point located in the center of the map currently displayed in a Map control.
MapInfoXYReturns the geographical position (latitude and longitude) corresponding to a point in a Map control.

Reinitialization

You can use VariableReset to reset the content of a geoPosition variable.
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.
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help