Weird bounds when seeing multiple earth

12 views
Skip to first unread message

chuby.qc

unread,
Feb 8, 2011, 10:31:21 AM2/8/11
to Google Maps JavaScript API v3
So let's say you've got a really big div containing your map, or
you're zoomed out enough to see more than one earth. Not necessarily
complete earths, but for example, you see Alaska twice.

At this point, if you get the map's bounds, both south west bounds and
north east bounds will have the same longitude value.

Is this normal? Should this be filed as a bug?

The problem is, we use these value to control both the position and
the size of an overlay view. When both longitudes are equal, the
overlay's width is 0, so we don't see it.

We use the api v3.3, but saw the same behaviour with api v3.0.

Thanks.

ChubyQC

unread,
Feb 8, 2011, 10:37:25 AM2/8/11
to Google Maps JavaScript API v3
I'm sorry, I misinterpreted what was happening. The longitudes aren't actually equal, but the fromLatLngToDivPixel returns the same x value.

It's a bit different, and I might be able to find a workaround for my problem then.

Rossko

unread,
Feb 8, 2011, 10:40:45 AM2/8/11
to Google Maps JavaScript API v3
> So let's say you've got a really big div containing your map, or
> you're zoomed out enough to see more than one earth. Not necessarily
> complete earths, but for example, you see Alaska twice.
> At this point, if you get the map's bounds, both south west bounds and
> north east bounds will have the same longitude value.

But what would you expect to get? When more than one-earth's worth is
shown on the screen, the concept of bounds becomes a bit meaningless;
a bounds bigger than the world makes no sense yet that might be the
thing that is wanted.
You can write code to detect this situation and deal with how you
wish ; I do not think Google can do that for you because different
folk will want different results.

chuby.qc

unread,
Feb 8, 2011, 11:56:09 AM2/8/11
to Google Maps JavaScript API v3
You're right.

I'm actually managing these special cases now.
Reply all
Reply to author
Forward
0 new messages