PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview of Map control
  • Creating a Map control
  • Popup for displaying markers
  • Displaying and handling maps
  • Displaying the maps
  • Maps handled by the user
  • Specific features
  • Internet Explorer: Required versions
  • Modifying the permissions
  • Map control and Google license
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
Overview of Map control
The Map control allows you to display a map in order to geolocate, display points of interest (POI) and more, ...
This map comes from:
  • Android the Google Maps service for Android applications.
    Caution: The use of the Map control is subject to specific terms and conditions. For more details, see Conditions for using the Map control. Check the Google license before deploying your applications.
  • iPhone/iPad Apple's geolocation service for iPhone/iPad applications from iOS 6.
    Remarks:
    • The Google Maps service is used for iPhone/iPad applications in iOS 5.
    • You must comply with the service license.
  • WINDEVWEBDEV - Server codePHP the Google Maps service for Web sites via the Google Maps API.
    The use of the Map control is subject to specific terms and conditions. Depending on the use mode, you may have to use a Google key (MapLicenseGgl). Check the Google license before deploying your applications.
  • Universal Windows 10 App the Bing Maps service for applications in Universal Windows 10 App mode.
    Caution:
    • The use of the Map control is subject to specific terms and conditions. A Bing key must be used (MapLicenseBing). Check the Bing license before deploying your applications.
    • Using an address specified with a string in a Map control may return inconsistent results. It is recommended to specify positions via variables of type Address or geoPosition.
The map displayed is interactive: you have the ability to zoom, move, ... It can be displayed in map view or satellite view.

Creating a Map control

To create a Map control:
  1. On the "Creation" tab, in the "Graphic controls" group, click "Map".
  2. Click where the control will be created in the window or page.
To view the control characteristics, select "Description" in the context menu of the control.
The "General" tab allows you to define:
  • the display mode: map or satellite,
  • whether traffic information is shown or hidden.
  • WINDEVWEBDEV - Server codeUniversal Windows 10 AppAndroidPHP whether the zoom buttons must be displayed (or not) in the control,
  • AndroidiPhone/iPad how the compass is displayed.
  • the image used for the POI markers.
    Android These markers can be displayed with or without a shadow.
  • the popup displayed by default when a marker is clicked on. This popup can correspond to:
    • None: the default popup will be used.
    • WINDEVUniversal Windows 10 AppAndroidiPhone/iPad Preset window: In this case, an internal window is automatically integrated into your project.
    • WEBDEV - Server code Preset page: In this case, an internal page is automatically integrated into your project.
    • WINDEVUniversal Windows 10 AppAndroidiPhone/iPad an internal window in your project.
    • WEBDEV - Server code an internal page in your project.
The "Details" tab is used to define:
  • WINDEV whether zoom by double click is enabled,
  • WEBDEV - Server codeAndroidiPhone/iPad gesture options:
    • AndroidiPhone/iPad Enable zoom.
    • AndroidiPhone/iPad Enable rotation.
    • AndroidiPhone/iPad Enable scrolling.
    • AndroidiPhone/iPad Enable tilt.
    • WEBDEV - Server code double-tap to zoom.
  • WINDEVUniversal Windows 10 AppAndroidiPhone/iPad remember the last position displayed.
Remarks:
  • AndroidiPhone/iPad A single Map control can be used in a window. Several Map controls cannot be used in the same window.
  • WINDEV The Map control cannot be used in automated tests.
  • AndroidiPhone/iPad geoRunApp is used to start the device's native maps application.

Popup for displaying markers

Depending on the platform, when a preset window or page is used to manage marker popups, the following elements are included:
  • WINDEV FI_WinDevPopupMarqueur_WD (internal window in the WDFAA component).
  • WINDEV Mobile FI_WinDevPopupMarqueur_WM (internal window in the WDFAA component).
  • WEBDEV - Server code the IPAGE_WEBDEVPopupMarker internal page.
These elements contain:
  • two controls used to display the name and description of the marker.
  • a declaration code to handle the current Marker variable.
Displaying and handling maps

Displaying the maps

When the window containing a Map control is opened, a world map is automatically displayed: the map is centered on Europe, with medium zoom level.
WINDEVUniversal Windows 10 AppAndroidiPhone/iPad You can display the last position: simply select "Remember last position displayed" in the "Details" tab of the Map control description window. 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:
  • Universal Windows 10 AppAndroidiPhone/iPad by scrolling the map with one or more fingers.
  • WINDEVWEBDEV - Server codePHP by scrolling the map using the mouse.
  • WINDEVWEBDEV - Server codeUniversal Windows 10 AppAndroidPHP via the control positioning buttons (if "Show zoom buttons" has been selected in the "General" tab of the control description window).
The user can zoom in or out:
  • WINDEVWEBDEV - Server codeUniversal Windows 10 AppAndroidPHP by using the zoom buttons of the control (if the option has been selected in the "General" tab of the control description window).
  • Universal Windows 10 AppAndroidiPhone/iPad by performing a "scale" or "pinch" gesture: spreading two fingers apart on the screen allows zooming in, and pinching them together allows zooming out.
  • Universal Windows 10 AppAndroid by double-tapping the map to zoom in one level on a position (if this option has been checked in the "General" tab of the control description window).
  • WINDEV by double-clicking the map to zoom one level on a position (if this option has been checked in the "General" tab of the control description window).
  • programmatically with the Zoom property.
AndroidiPhone/iPad If "Enable zoom" is disabled (in the "Details" tab of the control description or WithZoom property), the user will not be able to zoom in or out.
AndroidiPhone/iPad Remark: Optional events specific to the Map control can also be used. For more details, see Events associated with the Map control.
WINDEVWEBDEV - Server codePHP For more details on the options available at runtime, see Map control: Automatic Application Features (AAF).
Specific features
WINDEVWEBDEV - Server code

Internet Explorer: Required versions

WINDEV In a WINDEV application, the Map control uses Internet Explorer's ActiveX on the client computer. To use the Map control in the application, the client computer must have Internet Explorer 10 or 11.
WEBDEV - Server code To view a Map control in a WEBDEV site, the Web user must use:
  • Internet Explorer 10 or 11.
  • Another browser (Chrome, Firefox, etc.).
Android

Modifying the permissions

Using a Map control automatically adds the INTERNET permission to the list of permissions required by the application.

Map control and Google license

WINDEVWEBDEV - Server codeAndroidPHP Caution: Google license
You must specify a license key to use the maps service.
A Google Developer account is required to get a Google Maps API key. Refer to the Google license to learn more about the terms of service (free or paid service, usage quota, etc.).
When the developer account is available, 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.
    • Click "Enable APIs and services".
    • Click "Maps JavaScript API".
    • Click "Enable" to enable the Google Maps JavaScript API.
    • Click "Credentials". Then, click the link "Credentials in APIs & Services".
    • Click "Create credentials".
    • Select "API key".
    • 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.
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 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.
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment