Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

How to reset the map with the new bounds passed in !! (See related posts)

// description of your code here
when we load a new map, we need to reset the zoom of the map if the markers are outside the view port that we currently have. So this code takes care of that


   1  
   2      bounds = new GLatLngBounds
   3      points.each(function(point){
   4        bounds.extend(point)
   5      })
   6      map.setZoom(map.getBoundsZoomLevel(bounds))

You need to create an account or log in to post comments to this site.


Click here to browse all 5556 code snippets

Related Posts