ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Map functions
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
Adds a new marker onto a map displayed in a Map control.
// Displays a marker: a procedure is run during a click on this marker
MyLocation is geoPosition
MyLocation.Latitude = 43.613708
MyLocation.Longitude = 3.876972
 
MyMarker is Marker
MyMarker.Position = MyLocation
MyMarker.ActionClick = ProcMarkerClick
 
MapAddMarker(MAP_Position, MyMarker)
PROCEDURE ProcMarkerClick(MyMark is Marker)
 
ToastDisplay(StringBuild("Position: %1 N, %2 E ", MyMark.Position.Latitude, ...
MyMark.Position.Longitude))
Syntax

Adding a new marker from a Maker variable Hide the details

<Result> = MapAddMarker(<Map control> , <Marker>)
<Result>: Boolean
  • True if the marker was added,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Map control>: Control name
Name of the Map control to be used. If this parameter corresponds to an empty string (""), the Map control to which the current event belongs will be used.
<Marker>: Marker variable
Name of the Marker variable describing the marker to display.
Caution: If the Position property of the marker has not been specified, a fatal error will occur.

Adding a new marker from a geoPosition variable Hide the details

<Result> = MapAddMarker(<Map control> , <Position>)
<Result>: Boolean
  • True if the marker was added,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Map control>: Control name
Name of the Map control to be used. If this parameter corresponds to an empty string (""), the Map control to which the current event belongs will be used.
<Position>: geoPosition variable
Name of the geoPosition variable describing the position of marker to display.

Adding a new marker using a latitude and longitude Hide the details

<Result> = MapAddMarker(<Map control> , <Latitude> , <Longitude>)
<Result>: Boolean
  • True if the marker was added,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Map control>: Control name
Name of the Map control to be used. If this parameter corresponds to an empty string (""), the Map control to which the current event belongs will be used.
<Latitude>: Real
Latitude of marker that will be added onto the map.
<Longitude>: Real
Longitude of marker that will be added onto the map.
Remarks
  • To delete a specific marker from a Map control, use MapDeleteMarker.
  • To change a marker in a Map control, use MapModifyMarker.
  • To delete all markers from a Map control, use MapDeleteAll.
  • To add several markers on a Map control, the Name property of the Marker variable must be unique for each marker (even if the GPS positions are different).
    Example:
    Pos is geoPosition
     
    FOR EACH PRODUCT
    POI is Marker
    Pos.Latitude = PRODUCT.Latitude
    Pos.Longitude = PRODUCT.Longitude
     
    POI.Position = Pos
    // POI.Name must be different for each iteration in the loop.
    POI.Name = "Product " + PRODUCT.Reference
    MapAddMarker(MAP_MyMap, POI)
    END
  • You can handle the position of the marker with the Alignment property of the Marker variable.
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.
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.
Component: wd290obj.dll
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help