On Aug 6, 10:10 pm, Lorenz <[email protected]> wrote:
> Hi,
> i'm trying to use GLatLngBounds but i'm not able to understand if a
> point(GLatLng) is within the rectangle builded by GLatLngBounds.
>
> First of all, how it is builded the rectangle?I understand that the
> first point (p1)is used for the first corner (S-W), the second(p2) for
> the second corner(N-E)..is it correct??
That's correct. This isn't...
> > p1++++++++++
> > + +
> > + +
> > + +
> > +++++++++++p2
...because p1 should be in the SW corner, not the NW.
var sw=new GLatLng(...);
var ne=new GLatLng(...);
var bounds=new GLatLngBounds(sw,ne);
var point = new GLatLng(...);
if (bounds.containsLatLng(point)) { alert("success") }
Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---