GMap: map.setZoom

Just a quick note…

If you have a map with multiple markers you may be using “map.setZoom((map.getBoundsZoomLevel(bounds)));” to rezoom the map then “map.setCenter(bounds.getCenter());” to center it.

Sometimes this means that although the ‘point’ is in view the marker gets pushed off the top of the screen.

So, a quick fix: “map.setZoom((map.getBoundsZoomLevel(bounds))*-1*);” this simply sets the zoom level one level lower for you so all your points (and their context) are in view.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.