two maps in app - not overview

949
4
10-14-2011 04:10 AM
deleted-user-VeZur_n9o0OZ
New Contributor III
Hi all,

I'm writing an app which requires two seperate maps. They need to display difference featurelayers but be responsive to changes in extent to one another. I've managed to create two basic maps and add a baselayer to both. However, I only have control over the second map i.e if i click and pan the left hand map - the right hand map moves. Can i pass control to a map depending on where I've clicked? In the overview map sample you are not able to do this to the overview map.

Thanks,
James
0 Kudos
4 Replies
HemingZhu
Occasional Contributor III
Hi all,

I'm writing an app which requires two seperate maps. They need to display difference featurelayers but be responsive to changes in extent to one another. I've managed to create two basic maps and add a baselayer to both. However, I only have control over the second map i.e if i click and pan the left hand map - the right hand map moves. Can i pass control to a map depending on where I've clicked? In the overview map sample you are not able to do this to the overview map.

Thanks,
James


I think a feasible way to achieve your goal is to activate and synchronize both  map's OnExtentChange event and make sure the two map have the same extent all the time.
0 Kudos
derekswingley1
Frequent Contributor
The "Compare Web Maps" template on arcgis.com does this, here's an example:  http://apps.arcgis.com/hosted/Compare/Configure/index.html?webmap=ce4cbe1d06e2484284ffd692dfa62545

Make sure you check on "scale" and "location" under synchronize maps near the bottom of the page.
0 Kudos
deleted-user-VeZur_n9o0OZ
New Contributor III
Derek thanks for pointing me towards that template. It has all the functionality and more that I need in my app. I have dowloaded the source and tried to take the pieces of code i need. I've noticed in my left hand map my basemap does not refresh when I navigate but my operational layer does. Has anyone observed that behavoir?

Thanks,
James
0 Kudos
deleted-user-VeZur_n9o0OZ
New Contributor III
Derek,

As per my post here:http://forums.arcgis.com/threads/33051-How-to-refresh-map

I was able to resolve the issue by creating two seperate basemap objects rather than adding the same one to both maps.

Thanks,
James
0 Kudos