On my map, there are markers scattered around and a radius (circle overlay) on a marker indicating your location. Is there a way to check if any of the other markers fall within this circle?
UPDATE
I tackled this issue by iterating through each marker, utilizing the geometry library to calculate the distance between your marker and the others. I then used a simple if statement to determine if it's less than 100 meters.
function checkAllChests() {
var Current = 0;
$.each(treasureArray, function() {
//var thisLocation = treasureArray[Current].getPosition();
var distanceBetween = Math.ceil(google.maps.geometry.spherical.computeDistanceBetween(treasureArray[Current].getPosition(), marker_me.getPosition()));
if(distanceBetween < 100) {
alert('CAN OPEN THIS CHEST');
}
Current++;
});
}
Note that the code above relies on jQuery, so it won't work without jQuery.