I'm doing it like this:
map = new OpenLayers.Map (...);
overviewMapControl = new OpenLayers.Control.OverviewMap (...);
// Update the base layer of the overview map along with the base
layer of the main map.
map.events.register ('changebaselayer', this, function (layer,
properties)
{
if (overviewMapControl.ovmap) {
overviewMapControl.ovmap.setBaseLayer
(overviewMapControl.ovmap.getLayersByName (layer.layer.name)[0]);
}
// else the overview map is not drawn yet.
});
You must make sure that you've added to the overview map all the same
layers you added to the big map, and that they have unique names (the
first parameter for a layer constructor).
Janis
On 2011.05.19. 18:52, Sukuchha Shrestha wrote:
Hello nice people,
I want to synchronize the layerswitcher and overview map. I mean when
i select my layerA in layerswitcher, the overview map should display
layerA and similarly when i select my layerB in layerswitcher the
overview map should display layerB.
Any idea how to do it !
thanks
sukuchha
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users