Forum Home

Create Simple Marker

Here multiple markers are added in the map.In case of marker,firstly you have to create an instance of marker and then add it to the overlay.



Add Markers

   var bounds = agmap.getBoundingBox();

   var southWest = bounds.getSouthWest();
   var northEast = bounds.getNorthEast();                
   var lngSpan = northEast.longitude() - southWest.longitude();
   var latSpan = northEast.latitude() - southWest.latitude();

   for (var i = 0; i < 5; i++) 
   {
      var coord = new AGCoord(southWest.latitude() + latSpan * Math.random(),southWest.longitude() + lngSpan * Math.random());
      var oMarker = new AGMarker(coord);
      agmap.addOverlay(oMarker);	                
   }