PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

This page concerns the 23 + version of WINDEV, WEBDEV, WINDEV Mobile. Upgrade your version.
  • Overview
  • Initializing a map
  • Displaying a map
  • Managing advanced parameters (WEBDEV)
  • The following functions can be used with the Map controls
  • Notes
  • Properties specific to the Map controls
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
WINDEV Mobile allows you to handle a Map control by programming. To do so, use the variable of the Map control in the code.WINDEV, WEBDEV and WINDEV Mobile allow you to handle a Map control by programming. To do so, use the variable of the Map control in the code.
The variable of the Map control corresponds to the name of the Map control.
This help page explains how to handle a Map control by programming.
Note: Several WLanguage functions are specific to the management of Map controls. See the functions for managing the Maps for more details.
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 20 and later
WINDEVWindows The Map control is now available for the WINDEV applications in Windows.
WEBDEV - Server codeWEBDEV - Browser codeWindowsLinux The Map control is now available for the WEBDEV sites in Windows and Linux.
WEBDEV - Server codePHP The Map control is now available for the WEBDEV sites in PHP.
New in version 20
WINDEVWindows The Map control is now available for the WINDEV applications in Windows.
WEBDEV - Server codeWEBDEV - Browser codeWindowsLinux The Map control is now available for the WEBDEV sites in Windows and Linux.
WEBDEV - Server codePHP The Map control is now available for the WEBDEV sites in PHP.
WINDEVWindows The Map control is now available for the WINDEV applications in Windows.
WEBDEV - Server codeWEBDEV - Browser codeWindowsLinux The Map control is now available for the WEBDEV sites in Windows and Linux.
WEBDEV - Server codePHP The Map control is now available for the WEBDEV sites in PHP.
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.
Initializing a map

Displaying a map

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 minimum zoom level.
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.
To display a map corresponding to a specific location, use:
  • <Map>.DisplayPosition: This function can be used with a specific position (geoPosition variable), or on a town or a monument.
    For example:
    // Centers the map displayed by the "MAP_Position" control
    // on a geographical location
    MyPosition is geoPosition
    MAP_Position.Display(MyPosition)

    // Centers the map displayed by the "MAP_Position" control on a city
    // from its name
    MAP_Position.DisplayPosition("Montpellier, France")

    // Centers the map displayed by the "MAP_Position" control on a monument
    // from its name
    MAP_Position.DisplayPosition("Eiffer Tower")
  • a direct assign command with a specific position. In this case, the position is displayed without any animation.
    Example:
    // Centers the map displayed by the "MAP_Position" control
    // on a geographical location
    MyPosition is geoPosition
    MAP_Position = MyPosition
Managing advanced parameters (WEBDEV)
WEBDEV - Server codeWEBDEV - Browser code Several settings are available for the Map control found in WEBDEV. WEBDEV gives you the ability to use additional parameters, available in the Google API for map management.
To do so, two functions are available:
  • MapConfigureGglAPI (that can be used in server code) allows you to specify the additional parameters that will be managed on the Map control. These parameters are global to the project.
  • <Map>.GetJSObject (that can be used in browser code) allows you to retrieve the map and its options in a dynamic object in order to handle the control in Javascript code.
Example:
  • Declaring the libraries to load in server code:
    // Server code
    MapConfigureGglAPI("libraries=geometry,places","language=fr")
  • Retrieving the dynamic object in browser code:
    // Browser code
    MyMap is object dynamic
    MyMap = MAP_Browser.GetJSObject()
    // Call to the Javascript function
    FindAddress()
  • Javascript function used to handle the Map control:
    // Javascript function that is using the dynamic object
    function FindAddress()
    {
    var infowindow;
    // Rome: 41.873144, 12.480391
    var pyrmont = new google.maps.LatLng(41.873144, 12.480391);
    var request = {
    location: pyrmont,
    radius: 500,
    types: ['store']
    };
    infowindow = new google.maps.InfoWindow();
    var service = new google.maps.places.PlacesService(MyMap);
    service.nearbySearch(request, ReturnAddress_WB);

    }
The following functions can be used with the Map controls
The WLanguage functions that can be used with the Map controls can be classified in several categories:

Notes

  • AndroidiPhone/iPad geoRunApp is used to start the native mapping application of the device.
  • Versions 18 and later
    Android GglGetLicense is used to get the Google license for the library used by the Map control. This license must be displayed in the application that is using the Map control.
    New in version 18
    Android GglGetLicense is used to get the Google license for the library used by the Map control. This license must be displayed in the application that is using the Map control.
    Android GglGetLicense is used to get the Google license for the library used by the Map control. This license must be displayed in the application that is using the Map control.
  • Versions 20 and later
    WINDEVWEBDEV - Server code MapLicenseGgl allows you to specify the Google identifier required for using a Map control with the Google Map API for Work option. For more details, check the user license of Google Maps API.
    WEBDEV - Server code You also have the ability to enter the "Google Maps API" license in the description window of the project ("Advanced" tab).
    New in version 20
    WINDEVWEBDEV - Server code MapLicenseGgl allows you to specify the Google identifier required for using a Map control with the Google Map API for Work option. For more details, check the user license of Google Maps API.
    WEBDEV - Server code You also have the ability to enter the "Google Maps API" license in the description window of the project ("Advanced" tab).
    WINDEVWEBDEV - Server code MapLicenseGgl allows you to specify the Google identifier required for using a Map control with the Google Map API for Work option. For more details, check the user license of Google Maps API.
    WEBDEV - Server code You also have the ability to enter the "Google Maps API" license in the description window of the project ("Advanced" tab).
  • Versions 21 and later
    Universal Windows 10 App MapLicenseBing is used to specify the Bing key required for using the Map control in an application in Universal Windows 10 app mode.
    New in version 21
    Universal Windows 10 App MapLicenseBing is used to specify the Bing key required for using the Map control in an application in Universal Windows 10 app mode.
    Universal Windows 10 App MapLicenseBing is used to specify the Bing key required for using the Map control in an application in Universal Windows 10 app mode.
Properties specific to the Map controls
The following properties are used to manage a Map control by programming.
MapModeReturns or modifies the display mode of the map in the Map control.
ValueUsed to center the map on the position corresponding to the specified geoPosition variable.
ZoomReturns or modifies the zoom level used to display the map.
To find out the entire list of WLanguage properties that can be used with a Map control, see Properties associated with the Map control.
Minimum required version
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment