[OpenLayers-Users] Programatically hiding layers

David H. McCoy davidhmccoy at COX.NET
Fri Feb 1 14:42:18 EST 2008


Ah, OpenLayers.map isn't the base layer, but the Google map is. Use the
OpenLayers.Map.setBaseLayer() method.


David H. McCoy wrote:
> 
> Hello everyone!
>   I have a baselayer that is an instance of OpenLayers.Map. I then added a
> Google layer, then an Image layer, and finally, a Marker layer.
> 
> Then the app starts up, it displays a Google Map with a set of markerts.
> When you click on a marker, I want to hide the Google map layer, and
> display the Image layer. However, using setVisibility(false) hides the
> Google layer, but setVisibility(true) doesn't reveal the Image layer.
> 
> When you look at the LayerSwitcher control, the Google layer is still
> selected. Switching to the Image layer, of course, shows the image layer.
> 
> Is there a way to programatically switch from one layer to another? What
> am I missing?
> 
> Thanks!
> 

-- 
View this message in context: http://www.nabble.com/Programatically-hiding-layers-tp15231604p15231992.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list