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
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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: Many WLanguage functions are specific to Map control management.. 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 a minimum zoom level.
The last memorized position can be displayed by selecting the "Remember last position displayed" option 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:
  • or the <Map>.DisplayPosition function: This function can be used with a specific position (geoPosition type variable) or on a town or monument..
    For example:
    // Centre la carte affichée par le champ "CARTE_Position" 
    // sur une position géographique 
    MaPosition is geoPosition
    CARTE_Position.AffichePosition(MaPosition)
    
    // Centre la carte affichée par le champ "CARTE_Position" sur une ville 
    // à partir de son nom
    CARTE_Position.AffichePosition("Montpellier, France")
    
    // Centre la carte affichée par le champ "CARTE_Position" sur un monument 
    // à partir de son nom
    CARTE_Position.AffichePosition("Tour Eiffel")
  • a direct assign command with a specific location. In this case, the location is displayed without animations.
    Example:
    // Centre la carte affichée par le champ "CARTE_Position" 
    // sur une position géographique
    MaPosition is geoPosition
    CARTE_Position = MaPosition
Managing advanced parameters (WEBDEV)
Map control functions
The WLanguage functions used with Map controls can be classified into several categories:
  • The functions used to manage the positions 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.
  • The functions used to follow the movements of 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,
    • use any shape you want,
    • 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

  • WINDEV MapLicenseGgl allows you to specify the Google ID required when using a Map control with the Google Maps API for Work. For more details, see the Google Maps APIs terms of service.
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: 09/17/2024

Send a report | Local help