Hi,
I'm trying to do a circle in the map.
The function is simple. Just something like:
------------------------------------------------------------------------------------------------------
with (Math)
{
var d = circleRadius/6378.8;
var lat1 = (PI/180) * latlng.lat();
var lng1 = (PI/180) * latlng.lng();
for (var a = 0 ; a < 361 ; a++ )
{
var tc = (PI/180)*a;
var y =
asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc));
var dlng =
atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin(lat1)*sin
(y));
var x = ((lng1-dlng+PI) % (2*PI)) - PI
; // MOD function
var point = new
GLatLng(parseFloat(y*(180/PI)),parseFloat(x*(180/
PI)));
circlePoints.push(point);
bounds.extend(point);
}
circle = new GPolygon(circlePoints, '#000000',
2, 1, '#000000',
0.25);
map.addOverlay(circle);
}
------------------------------------------------------------------------------------------------------
And happily, its works very well.
But I need something more.
I need a function that verify if a point (or mouse) is inside the
circle or not.
It can be a MouseMove function, or when I put a marker.
How can I do this? To verify if the position is inside or outside the
circle?
Thanks so much for help!
Bye...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---