Select to view content in your preferred language

Get Zoom level of map for use in centerAndZoom()

3666
2
05-09-2011 07:31 AM
DavidMelville
New Contributor
Hi all,

For the purposes of synchronizing two maps on the same webpage, how can I get the zoom level of one map to use in the method centerAndZoom() of the other map?

Thanks is advance,
Dave
0 Kudos
2 Replies
derekswingley1
Deactivated User
0 Kudos
JeffPace
MVP Alum
cant you just use

this.map2.setLevel(this.map.getLevel()));

assuming they use the same tiling scheme?

you could even put it in an event listener for onextentchange

dojo.connect(this.map, "OnExtentChange", this, "changeMap2");

function: changeMap2(){
this.map2.setLevel(this.map.getLevel()));
}

pardon my terrible pseudo code.
0 Kudos