[OpenLayers-Users] switch basemaps prgramaticaly
Imran Rajjad
rajjad at gmail.com
Wed Jun 30 08:14:48 EDT 2010
Hi list,
How do you programtically switch between base map layers such that the
radio button for the visibile is checked. I tried using setVisbility
and getVisibility, that works fine but when you pan or zoom there is
no change and no new tiles are loaded, just as you click the radio
buttons everything starts working.
I have writen a function that does that but its not good enough
function copyLayerVisblity(layerName)
{
try{
var source=opener.map.getLayersByName(layerName);
var target=map.getLayersByName(layerName);
target[0].setVisibility(source[0].getVisibility());
}catch(e)
{
console.log(layerName+" does not exist in either parent or child window")
}
}
--
I.R
More information about the Users
mailing list