That's right: the default map types use the Mercator projection, in which the poles are rendered infinitely far up/down the map. So as you pan up/down you approach the poles but cannot reach them.
Have you tried limiting latitude to 85 instead? Android brevity On Aug 20, 2011 11:59 AM, "Jeremy" <jer...@pinkgeo.com> wrote: > I'm trying to figure out how to make my map unable to pan beyond the north > or south poles. I don't know if there is an existing script, but I couldn't > find anything and tried my hand at something. Unfortunately its flawed > because it doesn't seem like there is a 90 or -90 latitude in the maps API > (it just seems the values reported back get excedingly close to 90 but never > reach it or pass beyond it) and that it causes stack size errors. > > Anyone know of a simpler method that actually works? > > > google.maps.event.addListener(map, "center_changed", mapDragged); > > function mapDragged(){ > var bounds = map.getBounds(); > if(bounds.getSouthWest().lat() < -90){ > map.fitBounds(new google.maps.LatLngBounds(new > google.maps.LatLng(bounds.getSouthWest().lat(), > bounds.getSouthWest().lng()), new google.maps.LatLng(-90, > bounds.getNorthEast().lng()))); > } > } > > -- > You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. > To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/9v7aVnhbp2YJ. > To post to this group, send email to google-maps-js-api-v3@googlegroups.com. > To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.