PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview of Map control
  • Creating a Map control
  • Displaying and handling maps
  • Displaying the maps
  • Maps handled by the user
  • Specific features
  • Modifying the permissions
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
Overview of Map control
Versions 18 and later
iPhone/iPad The Map control is now available for the iPhone/iPad applications.
New in version 18
iPhone/iPad The Map control is now available for the iPhone/iPad applications.
iPhone/iPad The Map control is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App The Map control is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App The Map control is now available in Universal Windows 10 App mode.
Universal Windows 10 App The Map control is now available in Universal Windows 10 App mode.
The Map control allows you to display a map in order to geolocate, display points of interest (P.O.I), ...
This map comes from:
  • Android the Google Maps service for the Android applications.
    Caution: The use of Map control is subject to specific terms and conditions. See Conditions for using the Map control for more details. Check the Google license before deploying your applications.
  • Versions 18 and later
    iPhone/iPad of Apple geo-localization service for the iPhone/iPad applications from iOS 6.
    Notes:
    • For the iPhone/iPad applications in iOS 5, the Google Maps service is used.
    • You must comply with the service license.
    New in version 18
    iPhone/iPad of Apple geo-localization service for the iPhone/iPad applications from iOS 6.
    Notes:
    • For the iPhone/iPad applications in iOS 5, the Google Maps service is used.
    • You must comply with the service license.
    iPhone/iPad of Apple geo-localization service for the iPhone/iPad applications from iOS 6.
    Notes:
    • For the iPhone/iPad applications in iOS 5, the Google Maps service is used.
    • You must comply with the service license.
  • Versions 21 and later
    Universal Windows 10 App of the Bing Map service for the applications in Universal Windows 10 App mode.
    Caution:
    • The use of Map control is subject to specific terms and conditions. A Bing key must be used (MapLicenseBing). Check the Bing license before deploying your applications.
    • The positioning via a character string may return inconsistent results. We recommend that you use a positioning via an Address variable or via a geoPosition variable.
    New in version 21
    Universal Windows 10 App of the Bing Map service for the applications in Universal Windows 10 App mode.
    Caution:
    • The use of Map control is subject to specific terms and conditions. A Bing key must be used (MapLicenseBing). Check the Bing license before deploying your applications.
    • The positioning via a character string may return inconsistent results. We recommend that you use a positioning via an Address variable or via a geoPosition variable.
    Universal Windows 10 App of the Bing Map service for the applications in Universal Windows 10 App mode.
    Caution:
    • The use of Map control is subject to specific terms and conditions. A Bing key must be used (MapLicenseBing). Check the Bing license before deploying your applications.
    • The positioning via a character string may return inconsistent results. We recommend that you use a positioning via an Address variable or via a geoPosition variable.
Android Caution: Evolutions of Google license
From June 22 2016, the conditions for using the Google mapping services have evolved. From now on, a license key must necessarily be specified to use this service. You must:
  1. Generate the key in the Google developer console (https://console.developers.google.com). The operations to perform are as follows (valid at the date this page was written):
    • Use a Google account to connect to the developer console.
    • Create a project if necessary.
    • Access the "API manager" of the project.
    • In the "Google Maps API" item, click the "Google Maps JavaScript API" link.
    • Click "Enable" to enable the Google Maps Javascript API.
    • In the "Identifiers" item, expand the "Create identifiers" button.
    • Select "API key".
      • For a WEBDEV site, select "Browser key". We advise you to specify the domain that will be using the key to monitor the queries and to avoid any usurpation.
      • For a WINDEV application, select "Server key". We advise you to specify the address that will be using the key to monitor the queries and to avoid any usurpation.
    • Validate the key creation and copy the key created by Google.
  2. Specify the key used in the application or in the site with MapLicenseGgl.
From June 11 2018, the conditions for using the Google mapping services have evolved. The license key for using this service now requires a payment.
The map displayed is interactive: you have the ability to zoom, to move, ... It can be displayed in street map view or in satellite view.

Creating a Map control

To create a Map control:
  1. In the window editor, click (or select "Insert .. Control .. Map control").On the "Creation" pane, in the "Graphic controls" group, click "Map".
  2. Click the position where the control will be created in the window or page.
To display the control characteristics, select "Description" from the popup menu of control. The "General" tab is used to define the main options of control:
  • the display mode: map or satellite,
  • AndroidUniversal Windows 10 App whether the zoom buttons must be displayed (or not) in the control,
  • AndroidUniversal Windows 10 App scaling by double tap,
  • AndroidiPhone/iPadUniversal Windows 10 App storing the last position displayed.
  • the image used for the POI markers.
    Android These markers can be displayed with a shadow or not.
Notes:
  • AndroidiPhone/iPad Only one Map control can be used per window or page. You cannot have several Map controls in the same window or page.
  • AndroidiPhone/iPad geoRunApp is used to start the native mapping application of the device.
Displaying and handling maps

Displaying the maps

When the window containing a Map control is opened, a map of the world is automatically displayed: the map is centered around the equator, with the lowest zoom level. When the window containing a Map control is opened, a map of the world is automatically displayed: the map is centered on Europe, with medium zoom level.
AndroidiPhone/iPadUniversal Windows 10 App You have the ability to display the last position stored: to do so, select "Store the last displayed position" in the "General" tab of the description window of Map control. In this case, the last position is displayed with the same zoom level.

Maps handled by the user

The user can move on the map:
  • AndroidiPhone/iPadUniversal Windows 10 App by scrolling the map with one or more fingers.
  • AndroidUniversal Windows 10 App via the control positioning buttons (if the "Display the zoom buttons" option was selected in the "General" tab of the description window of control).
The zoom used for the display can be modified:
  • AndroidiPhone/iPadUniversal Windows 10 App by performing a "scale" or "pinch" gesture: spreading out two fingers on the screen is used to zoom in and tightening two fingers on the screen is used to zoom out.
  • AndroidUniversal Windows 10 App by using the zoom buttons of the control (if the option was selected in the "General" tab of the description window of control).
  • AndroidUniversal Windows 10 App by double-tapping the map to zoom in one level on a position (if this option was selected in the"General" tab of the description window of control).
  • by programming with ..Zoom.
AndroidiPhone/iPad Note: Optional events specific to the Map control can also be used. See Events associated with the Map control for more details.
Specific features
Android

Modifying the permissions

Using a Map control automatically adds the INTERNET permission to the list of permissions required by the application.
Related Examples:
The Map control Unit examples (WEBDEV): The Map control
[ + ] This example explains how to use the Map control of WEBDEV.
It can be used to display a map that includes markers as well as an itinerary.
The Map control Unit examples (WINDEV): The Map control
[ + ] Using the Map control of WINDEV.
It is used to display a map that includes markers as well as an itinerary.
The GglGetStaticMap function Unit examples (WINDEV): The GglGetStaticMap function
[ + ] Using gglGetMap to display a Google map in an Image control.
WM Geo-localization Cross-platform examples (WINDEV Mobile): WM Geo-localization
[ + ] This example explains how to perform proximity searches with geolocalization:
- 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.
Minimum version required
  • Version 17
This page is also available for…
Comments
Example
MapLicenseGgl("AIzaSyDbSVKYPwB1a-_vPbDzAr6LgAfIj4iW2hc")

PositionWx is geoPosition
PositionWx.Latitude = -25.4401779
PositionWx.Longitude = -49.2118695

MarkerWx is Marker
MarkerWx.Description = "WX INFORMATICA"
MarkerWx.Name = "WX INFORMATICA"
MarkerWx.Position = PositionWx

MapAddMarker(GoogleMaps,MarkerWx)

GoogleMaps.DisplayPosition(PositionWx)
GoogleMaps..Zoom = 18
BOLLER
13 Jul. 2018
Example Webdev
MapLicenseGgl("AIzaSyDbSVKYPwB1a-_vPbDzAr6LgAfIj4iW2hc")

PositionWx is geoPosition
PositionWx.Latitude = -25.4401779
PositionWx.Longitude = -49.2118695

MarkerWx is Marker
MarkerWx.Description = "WX INFORMATICA"
MarkerWx.Name = "WX INFORMATICA"
MarkerWx.Position = PositionWx

MapAddMarker(GoogleMaps,MarkerWx)

GoogleMaps.DisplayPosition(PositionWx)
GoogleMaps..Zoom = 18
BOLLER
13 Jul. 2018