Reputation: 79268
I can do this to convert a lat/lng to pixel coordinates in Google maps:
var xy = map.getProjection().fromLatLngToDivPixel(new google.maps.LatLng(lat, lng));
Now I'm wondering, how do I get a distance in pixels from that point? Say I want to draw a circle with a radius of 5 miles around that. How do I do that?
Upvotes: 2
Views: 780
Reputation: 42522
The best way to draw a circle around a given point is to draw a GPolygon with many points, simulating a circle.
You can find a good example of this here. Look for the drawCircle function in the source (you will need to download the attached circle.html to check it out.
Upvotes: 0