Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2018-06-11 Thread f20150352
" var rLat = (radius/3963.189) * (180/PI)" Can anyone explain how did we come up with this *rlat formula* and what value does *radius/earth's radius gives* On Tuesday, July 5, 2011 at 7:53:44 PM UTC+5:30, Karthik Reddy wrote: > > function getCirclePoints(center,radius){ > > var circlePoints = Arr

Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-05 Thread Enoch Lau
This code calculates a circle in lat-lng space, which won't appear circular on-screen (using the mercator projection), nor is a spherical cap. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To view this discussion on the web v

Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-05 Thread Enoch Lau
If you calculate the distance from the circle's center LatLng to the manually calculated circle points (in cirCoords), you'll notice that they don't have a consistent distance - those manually calculated points don't form a circle. -- You received this message because you are subscribed to the

Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-05 Thread Karthik Reddy
function getCirclePoints(center,radius){ var circlePoints = Array(); var searchPoints = Array(); var bounds = new google.maps.LatLngBounds(); with (Math) { var rLat = (radius/3963.189) * (180/PI); // miles var rLng = rLat/cos(center.lat() * (PI/180)); for (var a = 0 ; a < 361 ; a++

Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-04 Thread Ben Appleton
Hey John, Interesting: I agree your circles differ from ours. We currently use 500 vertices, computing LatLng for each using google.maps.spherical.computeOffset: http://code.google.com/apis/maps/documentation/javascript/reference.html#spherical then projecting to pixel coordinates using the Map's

Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-04 Thread John Coryat
Ben, I'm guessing by the look of the v3 function circle that there are less points involved in calculating the shape than I used. Except in extremely rare circumstances, like dealing with very high or low latitudes, your calculation would be indistinguishable from what I use. -John -- You re

Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-04 Thread John Coryat
Ben, According to my calculations, it should look like this: http://maps.huge.info/test2.htm The circle is overlaid by what should be a more egg shaped polygon. This is an approximately 200 mile radius circle. Pardon the crudeness of the polygon. My math may be incorrect though. -John -- Yo

Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-04 Thread John Coryat
Ben, http://maps.huge.info/test2.htm This should be a hugely exaggerated circle but it's not. Am I missing something? -John Coryat -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To view this discussion on the web visit htt

Re: [Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-04 Thread Ben Appleton
Hi John, google.maps.Circle correctly handles radius. Large circles do appear "egg" shaped on the map as you describe. Cheers Ben On Tue, Jul 5, 2011 at 12:49 PM, John Coryat wrote: > Be aware that a circle will not define a radius properly. Since the map > stretches the latitude in relation t

[Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-04 Thread John Coryat
Be aware that a circle will not define a radius properly. Since the map stretches the latitude in relation to the longitude, a circle will be (as a unit measurement) have different dimensions in the north-south direction as opposed to the east-west direction. If you want to represent a radius on

[Google Maps API v3] Re: Polygon in the form of a circle.

2011-07-04 Thread Rossko
> I need to draw a circle http://code.google.com/apis/maps/documentation/javascript/overlays.html#Circles -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api-v3@googlegroups.c