Map1.on("extent-change", extentChange1); Map2.on("extent-change", extentChange2); function extentChange1(evt){ Map2.setExtent(evt.extent); } function extentChange2(evt){ Map1.setExtent(evt.extent); }
Hi Joesph,
Based on the description what I understand is that you have two maps and if extent for either of the map is changed(map1 or map2) the same extent is supposed to be set to the other map.
Hope I understand it correctly.
Please find the below fiddle and let me know if that's what you are looking for:
http://jsfiddle.net/patelmanya/uER7L/6/
map.on("extent-change", extentChange1);
//if you use the below as well then the map will keep going in infinite loop.
//map2.on("extent-change", extentChange2);
map.on("zoom-end", extentChange1);
map2.on("zoom-end", extentChange2);
function extentChange1(evt) {
map2.setExtent(evt.extent);
}
function extentChange2(evt) {
map.setExtent(evt.extent);
}
Hope this helps.
Best Regards,
Manish Patel
Hi Ganesh,
I tried to attach the extent change event for both the maps but in that case the maps keep changing the extent and goes in infinite loop. I may have to play around with it for a while. I can certainly update once I get some thing solid.
Regards,
Manish Patel