mapControl.getMarkerGroupPositions Method


mapObj.getMarkerGroupPositions(markerGroup1 [, ...markerGroupN]);



The marker group to get the latitude/longitude. Can be specified as a string containing the name of a single marker group or an array of marker groups.


Additional marker group to get the latitude/longitude. You can specify as many marker groups as you want, separated by commas.


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.


Get the latitude/longitude of all the markers in one or more marker groups on the map.


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.


//get a pointer to the map control for variable 'mymap1'
var mapObj = {dialog.object}.getControl('mymap1');

if (mapObj) {
    var markers = mapObj.getMarkerGroupPositions('myMarkerGroup1','myMarkerGroup2');
    var msg = ""

    for (var marker in markers) {
        var markerLoc = markers[marker];
        msg = msg + "Marker '"+marker+"': "+markerLoc[0]+","+markerLoc[1];
    }"Markers in Groups",msg,"o");