How can I test if a LatLng point is within the bounds of a circle? (Google Maps JavaScript v3)
The getBounds() method returns the bounding box for the circle, which
You might use the Circle object to show it;
new google.maps.Circle({
map : map,
center : new google.maps.LatLng(lat,lng),
strokeColor:'#00FFCC',
strokeWeight:2,
fillOpacity:0,
radius:radiusm
});
And apply the Pythagorean theorem to coordinates: but in this case to make it a "real" circle since the ration between 1° of lat and longitude varies across latitudes, you should at the very least adjust them like:
var kmRadius = 100; //(radius of 100 km)
var lat_gap = kmRadius/111.1;
var lng_gap = lat_gap / Math.cos(lat / (Math.PI/180));