PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Special cases
  • Required permissions
  • Required application feature
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
Displays the current location of the device in a Map control and updates the location as it moves.
Android Remark: This function is available in the Android emulator and in the Android simulator.
Versions 18 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 18
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 20 and later
WEBDEV - Browser code This function is now available in Browser code.
New in version 20
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code This function is now available in Browser code.
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.
Example
// Start movement tracking in the Map control
MAP_Position.FollowMovement()
Syntax
<Result> = <Map control>.FollowMovement([<Compass> [, <WLanguage procedure>]])
<Result>: Boolean
  • True if the following of movement was enabled,
  • False otherwise. To get the details of the error, use ErrorInfo.
<Map control>: Control name
Name of the Map control to be used.
<Compass>: Optional boolean
  • True to enable the compass. A compass is displayed in the Map control to indicate the orientation of the move. This option is available for the devices equipped with an orientation sensor.
  • False (default value) to disable the compass.
<WLanguage procedure>: Optional procedure name
Name of the WLanguage procedure ("callback") called each time a movement notification is received. This procedure has the following format:
PROCEDURE <Procedure name> (<Position>)

where <Position> is a geoPosition variable containing information about the position of the device when the notification is performed.
The parameters of this procedure are optional. There is no need to pass parameters to this procedure. Indeed, these parameters are automatically filled during each call.
If this procedure returns False, the map displayed in the Map control will not be refreshed.
If this parameter is not specified, whenever a change of device position is notified, the map displayed in the Map control is automatically centered on the new position.
Remarks

Special cases

  • To stop following the move, use <Map>.EndOfMove.
  • A blue circle may appear around the marker, indicating the current position of the device. This circle is a representation of the level of precision regarding the position. The more it is extended, less precise the position will be. To define the location of the device, the function uses two types of "location providers":
    • the network of GPS satellites,
    • the triangulation performed from the network of mobile and Wi-Fi antennas.
    The location provider depends on the location settings of the device when the function is called
  • A period of time may pass between the call to <Map>.FollowMovement and the effective display of the device position on the map. This time corresponds to the time taken by the location provider (GPS or mobile/Wi-Fi network) to define the current location of the device. Once this position is found, the map control is automatically centered on this one.
Android

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: ACCESS_FINE_LOCATION
This permission allows an application to access a specific location (GPS).
Android 10 specific case: Android 10 has implemented a new permission for the functions that allow locating the device: ACCESS_BACKGROUND_LOCATION.
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 these permissions at any time in the Android settings.
Android 11 specific case: The use of this function requires the implementation of the Permission: ACCESS_BACKGROUND_LOCATION allowing the location of the device.
This permission allows using the function when the application is in the background.
If the application requires background localization, you must:
  • Manually add the Permission "ACCESS_BACKGROUND_LOCATION" in the wizard generation of the Android application.
  • Explicitly request the Permission location in the background from the user with the PermissionRequest function. For example:
    PermissionRequest(permBackgroundLocation, Callback)
    INTERNAL PROCÉDURE Callback(p is Permission)
    IF p.Granted THEN
    // Utilisation possible des fonctions nécessitant la localisation en arrière-plan
    END
    END
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 these permissions at any time in the Android settings.

Remarks:
  • Follow Google's specifications for applications that use location in the background. For more details, see https://support.google.com/googleplay/android-developer/answer/9799150. If these conditions are not met (including user information requirements), applications may not be authorized for publication on the Play Store.
  • The Permission background location request should only be made if the Permission location has been granted. Otherwise, the PermissionRequest function will fail.
  • If the user's choice when requesting Permission to locate in the background is more restrictive than the choice made when requesting Permission to locate, the application will automatically be restarted.
  • On devices below Android 10, if the Permission location has been granted to the application, the Permission background location request will be granted without displaying a window.
Versions 21 and later
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required feature: Geolocation
This feature allows applications to use the geolocation features of the device.
New in version 21
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required feature: Geolocation
This feature allows applications to use the geolocation features of the device.
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required feature: Geolocation
This feature allows applications to use the geolocation features of the device.
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.
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: WDJS.DLL
Minimum version required
  • Version 23
Comments
Click [Add] to post a comment