-1

I have the following lat/long array, which i can draw it on map with success. My question is how can i have a loop and place a circle with custom Km radius (or standard radius if it's too much pain in the 4ss) for each array coordinates.

var locations = [
['lala', 37.0093833333333,24.7528638888889, 1],
['lala', 35.0093833333333,20.7528638888889, 2]
];

Thank you

John Doe
  • 183
  • 1
  • 10
  • Yes you can. What have you tried? [circle](https://developers.google.com/maps/documentation/javascript/shapes#circles) – geocodezip Jan 22 '14 at 07:42
  • possible duplicate of [Draw radius around a point in Google map](http://stackoverflow.com/questions/825794/draw-radius-around-a-point-in-google-map) – geocodezip Jan 22 '14 at 08:15

1 Answers1

2
var cityCircle     
 for (elements in your array) {
    var populationOptions = {
      strokeColor: '#FF0000',
      strokeOpacity: 0.8,
      strokeWeight: 2,
      fillColor: '#FF0000',
      fillOpacity: 0.35,
      map: map,
      center: your latlng,
      radius: your radius here
    };
    // Add the circle for this city to the map.
    cityCircle = new google.maps.Circle(populationOptions);
  }

something like this?

szpic
  • 4,346
  • 15
  • 54
  • 85