ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Geolocation functions
  • Special cases
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Initializes the parameters of geolocation WLanguage functions and finds a location provider.
To define the device position, you have the ability to use two types of "localization providers":
  • the network of GPS satellites.
  • the triangulation performed from the network of mobile and Wi-Fi antennas.
Each provider differs by the precision of its information, its energy consumption and the required hardware configuration (presence of a GPS chip, Internet access, etc.).
Example
Syntax
GPSInitParameter(<Provider to find> [, <Options>])
<Provider to find>: Integer constant
Type of requested location provider.
gpsAutoDefines the most suitable provider according to the criteria specified in the <Options> parameter.
gpsNetworkCalculates the position by using the network of mobile or Wi-Fi antennas.
gpsSatelliteCalculates the position by using the network of GPS satellites.

WINDEV This parameter is ignored.
<Options>: Optional combination of Integer constants
Selection criteria for the location provider.
The possible values are:
gpsAltitudeIndicates whether the provider must be able to specify the altitude of the device.
WINDEV This constant is not available.
gpsDirectionIndicates whether the provider must be able to specify the move direction of the device.
WINDEV This constant is not available.
gpsEnergyHighIndicates whether the provider can require a high quantity of energy.
WINDEV This constant is not available.
gpsEnergyLowIndicates whether the provider must require a low quantity of energy.
WINDEV This constant is not available.
gpsEnergyMediumIndicates whether the provider can require a medium quantity of energy.
WINDEV This constant is not available.
gpsPrecisionHighThe position is calculated with high accuracy.
gpsPrecisionLowThe position is calculated with low accuracy.
gpsSpeedIndicates whether the provider must be able to specify the moving speed.
WINDEV This constant is not available.

Remarks:
  • The gpsPrecisionxx constants are exclusive between themselves.
  • The gpsEnergyxx constants are exclusive between themselves.
  • No constant is required. If no constant is specified, the function will search for a location provider that consumes the least amount of energy with any precision and without any specific characteristics.
Remarks

Special cases

  • Depending on the type of device on which the application is started, there may be no provider corresponding to all the specified criteria (no GPS chip, no Internet access, ...).
    If no supplier matches the specified criteria, the criteria will be dropped one after the other until a valid supplier is found, in the following order: energy consumption, accuracy, direction, speed and z-order.
  • The geolocation functions can, according to the selected setting and to the call frequency, consume a lot of resources on the device (battery, bandwidth, etc.). GPSEnd must be called when the location functions are no longer used by the application.
  • If a geolocation function is called, but the parameters have not yet been defined by GPSInitParameter, the application will try to use the GPS location first and then the mobile antenna network if the GPS system is not available.
  • GPS functions don't allow you to geolocate "indoors": you can't position yourself using Wi-Fi terminals alone.
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.
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
Component: wd300java.dll
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help