mapControl.getMarkerPositions Method
Syntax
Arguments
- markerName1string
The marker to get the latitude/longitude. Can be specified as a string containing the name of a single marker or an array of markers.
- markerNameNstring
Additional marker to get the latitude/longitude. You can specify as many markers as you want, separated by commas.
Returns
- resultobject array
Returns a JavaScript object of key-value pairs where the key is the marker name and the value is an array that contains the latitude and longitude values of the marker's location.
Description
Get the latitude/longitude of all the one or more markers on the map.
Discussion
The method will return a javascript object where the name of the marker is used as the key for the marker's latitude/longitude. For example, if you have a marker named 'myMarker1', the javascript would have a property named 'myMarker1'. The value for 'myMarker1' would be an array of latitude and longitude values.
Example
//get a pointer to the map control for variable 'mymap1' var mapObj = {dialog.object}.getControl('mymap1'); if (mapObj) { var vals = mapObj.getMarkerPositions('myMarker1','myMarker2','myMarker3'); }