How to zoom and center the map automatically

Jul 12, 2009 at 9:25 PM

Hi all,

anyone knows how to zoom and center the map so that all markers appear?

 

Using Dojo:

function findcenter(...){

var clat=(bounds.getNorthEast().lat()+bounds.getSouthWest().lat())/2;
var clng=(bounds.getNorthEast().lng()+bounds.getSouthWest().lng())/2;

}

var zoom=Math.min((this.map.getBoundsZoomLevel(bounds)-1),14);
this.map.setCenter(this.findCenter(bounds), zoom);

 

Any suggestions to implement this in GoogleMaps control?

 

Jul 14, 2009 at 7:16 AM

I love this control so far, it's much easier to implement then the Shabdar control but Shabdar does have one advantage ".RecenterMap = true". Will you be able to let me know if this is coming soon? I'd love to change my project over to this great control as it's much much simpler to work with.