Hi,
Our application needs a functionallity where we can sync 2 maps i.e. if we
zoom/pan on one, it should be reflected on the other. I am able to achieve this
however, I am not able to sync the maps when a new layer is added. For testing
purpose, I have written "ContextModelListenerAdapter" which listen to the
context changes on one of the map (mainmap) . If I add the new layer in the
layerAdded() function, it adds it to the second map(map2) & is not added to the
mainmap, code snippet is :-
contextListener = new ContextModelListenerAdapter() {
protected void layerAdded(Notification msg) {
Layer layerAdded = (Layer) msg.getNewValue();
map2.sendCommandASync(new AddLayerCommand(layerAdded));
}
....
mainmap.getContextModel().eAdapters().add(contextListener);
Please help...
Thanks
Elvie _______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel