Use setBaseLayer on the map object.

Best regards,
Bart

On Jun 30, 2010, at 2:14 PM, Imran Rajjad wrote:

> 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
> _______________________________________________
> Users mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/users
> 

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to