Hi Mike,
Your explain makes a lot of sense, Thank you very much.(btw, i love
your tutorial all the time)
It's true that my map cross the international date line, and now i
understand that when the map cross the line, the range of longitudes
actually contains two parts.
41.1328125 to 180
-180 to -97.38281250000001
But I can't just delete my switch code, since the purpose of this page
is to load all the markers latlng within the current map viewpoint
from database, to cut the long story short, i have a marker table
contains the lat and lng, now i will generate the sql to load the
markers, the sql will looks like
select xxx from xxx where lat<[maxLat] and lat>[minLat] and
lng<[maxLng] and lng>[minLng]
I didn't come to any idea yet how can i get the range of lat and lng
when the map crossed the international line,
Jeru
On Oct 27, 1:32 am, Mike Williams <[EMAIL PROTECTED]> wrote:
> The international date line goes through the map. Your code switches the
> lngs when that happens, so the range of lngs that you're looking at is
> the part of the world that's *outside* the viewport.
>
> When you set zoom level 2, the ranges of longitude that are inside the
> viewport are
> 41.1328125 to 180
> -180 to -97.38281250000001
> Sydney is inside the first of those
>
> When you use zoom level 5, the range of longitudes outside the map gets
> larger.
>
> Delete these lines from your test page:
>
> if (maxLat < minLat) {
> maxLat = swPoint.lat();
> minLat = nePoint.lat();
> }
>
> if (maxLng < minLng) {
> maxLng = swPoint.lng();
> minLng = nePoint.lng();
> }
>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---