" 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
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
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
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++
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
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
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
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
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
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
> 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
11 matches
Mail list logo