|
|
|
|
- Overview
- Initializing a map
- Displaying a map
- Managing advanced parameters (WEBDEV)
- The following functions can be used with the Map controls
- Remarks
- Properties specific to Map controls
Handling a Map control through programming (prefix syntax)
WINDEV, WEBDEV and WINDEV Mobile allow you to handle a Map control through 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 through programming. Remark: Several WLanguage functions are specific to the management of Map controls. For more details, see Map control functions.
Displaying a map When the 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 display the last position: you just need to select "Remember last position displayed" in the "General" tab of the Map control description window. In this case, the last position is displayed with the same zoom level. To display a map corresponding to a specific location, use: - the <Map>.DisplayPosition function: 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.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 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) 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: - The functions used to manage the positions on the map:
| | <Map>.DisplayPosition | Centers the map displayed in a Map control on a geographical position or on a specific location. | <Map>.GetPosition | Returns the geographical position of the point located in the center of the map currently displayed in a Map control. | <Map>.InfoPosition | Returns the coordinates (in pixels) of the point corresponding to a geographical position (latitude and longitude). | <Map>.InfoXY | Returns 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>.EndOfMove | Stops following the device movement in a Map control. | <Map>.FollowMovement | Displays the current location of the device in a Map control and updates the location as it moves. |
- The functions used to manage the markers on the map. These functions use the Marker variables to define the characteristics of these markers.
- The functions used to manage the itineraries on the map.
- The functions used to handle the additional options of the Google API for map management:
| | MapConfigureGglAPI | Declares additional parameters for the Map control that will be transmitted to the Google API. | <Map>.ExecuteJS | Runs the native code of Google Maps API in a Map control in JavaScript. | <Map>.GetJSObject | Returns the instance of the API of Map control. |
Properties specific to Map controls The following properties are used to manage a Map control through programming: | | MapMode | Returns or modifies the display mode of the map in the Map control. | Value | Used to center the map on the position corresponding to the specified geoPosition variable. | Zoom | Returns or modifies the zoom level used to display the map. |
For a complete list of WLanguage properties that can be used with a Map control, see Properties associated with Map controls.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|