My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 1757: Bug: fitBounds() doesn't work across the 180 meridian
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Oct 2009


Sign in to add a comment
 
Reported by [email protected], Oct 2, 2009
I would have expected the following : 

  var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(-
35, 170), new google.maps.LatLng(-45, -170));
  console.log(bounds.toSpan().lng()) // 20
  gmap.fitBounds(bounds);

to zoom the map in to roughly fit New Zealand.  Instead I get an extremely 
zoomed-out map, showing the entire world.

The bounds variable in my example appears to be successfully set up to be 
a rectangle crossing the 180 longitudinal meridian (note the span has a 
longitude of 20 degrees), but fitBounds ignores this and seems to try to fit 
the very wide rectangle starting at -170, and taking the long way round to 
get to +170.

Is this a known problem?
Oct 5, 2009
#1 d.l%[email protected]
Thanks for reporting this.  I've reproduced this on my end and reported it to the team.  
Status: Confirmed
Labels: Internal-2168456
Oct 7, 2009
#2 d.l%[email protected]
(No comment was entered for this change.)
Status: FixedNotReleased
Oct 15, 2009
#3 d.l%[email protected]
(No comment was entered for this change.)
Status: Fixed
Labels: Fixed-18
Sign in to add a comment

Powered by Google Project Hosting