[Users] Double Map Panels with interdependence

John Buonagurio jbuonagurio at exponent.com
Tue May 17 18:32:45 CEST 2011


I think you would register the "moveend" and "zoomend" events on your
first OpenLayers map object, then call the setCenter() method on the
second map with the same zoom level and center.

It would probably look something like this:

map1.events.register('moveend', map, function() {
	map2.setCenter(this.getExtent().getCenterLonLat(),
this.getZoomForResolution(map.getResolution()));
});

map1.events.register('zoomend', map, function() {
	map2.setCenter(this.getExtent().getCenterLonLat(),
this.getZoomForResolution(map.getResolution()));
});

John Buonagurio

-----Original Message-----
From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On
Behalf Of Jason Hochschild
Sent: Tuesday, May 17, 2011 12:21 PM
To: users at geoext.org
Subject: [Users] Double Map Panels with interdependence

Has anyone put together an OpenLayers/GeoExt layout with 2 maps that
are interdependent to each other?  I've dabbled with putting multiple
independent map panels in one page, but I am thinking something like
this:

http://www.esri.com/landsat-imagery/viewer.html

A pan, zoom, etc on one map is mimicked onto the other map.  It should
be straight forward to capture all the user interaction and then run a
function to do it to the other map (I only need 2 maps, the example
above has 3), but if someone has an example I can build on rather than
start from scratch, it would of course save some time.  Thanks!

Jason
_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users


More information about the Users mailing list