# How to draw small circles within a big circle(greater radius) on the basis of marker size on google maps?

I have more than 1000 markers at different location in my Map. I read Lat and Long from a xml file and render it in Google maps and create circle over them on the basis of city name within given radius. And count the number of markers in those circle.

Now what i want to do is?

(1) When the size of markers within the given radius greater then a predefined value such as 10 then i want to draw 2 small inner circles with smaller radius within the existed big circle.the smaller circles contains their own markers.So whenever marker size is less then the predefined value, i.e., 10 then it should combine the 2 radius of these two small circles and should show only one big circle covering the markers of the two smaller circles (smaller 2 will now disappear resulting on marker size is less then 10).

My code is:

``````function codeAddress() {
var i=0;
for(i=0; i < address.length; i++ ){

geocoder.geocode( { 'address': address[i]}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
side_bar_html = "";
map.setCenter(results[0].geometry.location);
var searchCenter = results[0].geometry.location;
if (circle) circle.setMap(null);
circle = new google.maps.Circle({center:searchCenter,
fillOpacity: 0.35,
fillColor: "#FF0000",
map: map});
var bounds = new google.maps.LatLngBounds();
var foundMarkers = 0;
for (var i=0; i<gmarkers.length;i++) {
bounds.extend(gmarkers[i].getPosition())
gmarkers[i].setMap(map);
side_bar_html += '<a href="javascript:myclick(' + i + ')">' + gmarkers[i].title + '<\/a><br>';
foundMarkers++;
} else {
gmarkers[i].setMap(null);
}
}
document.getElementById("side_bar").innerHTML = side_bar_html;
if (foundMarkers > 0) {
map.fitBounds(bounds);
} else {
map.fitBounds(circle.getBounds());
}

} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});}
i++;
}

var infowindow = new google.maps.InfoWindow(
{