this is my code google maps markers with circle, so I want on click not to draw markers if theres circles crossing each other
google.maps.event.addListener(map, 'click', function(event) {
var marker3 = placeMarker(event.latLng);
google.maps.event.addListener(marker3, 'click', function(event) {
});
});
function placeMarker(location) {
var marker3 = new google.maps.Marker({
position: location,
map: map,
draggable:true,
});
radius = new google.maps.Circle(circleRadius);
radius.bindTo('center', marker3, 'position');
return marker3;
}
circleRadius
, place the marker. If not, do nothing.circleRadius
? Where does it come from? Is it always the same radius for each marker? "if circles cross each others", do you need to compare 2 markers or 1 markers towards many? Depending on your answers to these, you would get different answers. Dr.Molle's answer seems like a good solution if there are many markers.