This project is read-only.

How to zoom and center the map automatically

Jul 12, 2009 at 10: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((,14);, zoom);


Any suggestions to implement this in GoogleMaps control?


Jul 14, 2009 at 8: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.