ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Map control
  • Overview
  • Initializing a map
  • Displaying a map
  • Managing advanced parameters (WEBDEV)
  • Map control functions
  • Remarks
  • Properties specific to Map controls
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
WINDEV, WEBDEV and WINDEV Mobile allow you to programmatically manipulate Map controls. 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 programmatically manipulate Map controls.
Remark: There are multiple WLanguage functions specific to Map controls. For more details, see Map control functions.
Initializing a map

Displaying a map

When a window containing a Map control is opened, a world map is automatically displayed: the map is centered on Europe, with minimum zoom level.
You can view the last location on the map: you just need to select "Remember last position displayed" in the "General" tab of the Map control description window. In this case, the last location is displayed with the same zoom level.
To show a specific location on the map, use:
  • the <Map>.DisplayPosition function: This function can be used to show a specific location (geoPosition variable), 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.DisplayPosition(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("Eiffel Tower")
  • a direct assign command with a specific location. In this case, the location is displayed without animations.
    Example:
    // Centers the map displayed by the "MAP_Position" control
    // on a geographical location
    MyPosition is geoPosition
    MAP_Position = MyPosition
Managing advanced parameters (WEBDEV)
Map control functions
The WLanguage functions used with Map controls can be classified into several categories:
  • Functions for getting locations on the map:
    <Map>.DisplayPositionCenters the map displayed in a Map control on a geographical position or on a specific location.
    <Map>.GetPositionReturns the geographical position of the point located in the center of the map currently displayed in a Map control.
    <Map>.InfoPositionReturns the coordinates (in pixels) of the point corresponding to a geographical position (latitude and longitude).
    <Map>.InfoXYReturns the geographical position (latitude and longitude) corresponding to a point in a Map control.
  • Functions for tracking the device:
    <Map>.EndOfMoveStops following the device movement in a Map control.
    <Map>.FollowMovementDisplays the current location of the device in a Map control and updates the location as it moves.
  • Functions for handling markers on the map. These functions use Marker variables to define all marker characteristics.
    <Map>.AddMarkerAdds a new marker onto a map displayed in a Map control.
    <Map>.DeleteAllDeletes the following from a Map control:
    • all markers,
    • all shapes,
    • all images.
    <Map>.DeleteMarkerDeletes a marker from a map displayed by a Map control.
    <Map>.ModifyMarkerModifies a marker displayed in a Map control.
  • Functions for handling routes on the map.
    <Map>.AddItineraryAdds an itinerary onto a Map control.
    <Map>.DeleteItineraryDeletes an itinerary from a Map control.
  • Functions for additional Google Maps API options:
    MapConfigureGglAPIDeclares additional parameters for the Map control that will be transmitted to the Google API.
    <Map>.ExecuteJSRuns the native code of Google Maps API in a Map control in JavaScript.
    <Map>.GetJSObjectReturns the instance of the API of Map control.

Remarks

  • AndroidiPhone/iPad geoRunApp is used to start the device's native maps application.
  • Universal Windows 10 App MapLicenseBing allows you to specify the Bing key required for using a Map control in a Universal Windows Platform application.
Properties specific to Map controls
Use the following properties to programmatically manipulate Map controls:
MapModeGets or sets the map display mode in the Map control.
ValueCenters the view at the position specified by the geoPosition variable.
ZoomGets or sets the initial zoom level of the map.

For a complete list of WLanguage properties that can be used with Map controls, see Map control properties.
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/29/2023

Send a report | Local help