[OpenLayers-Users] custom layer switcher 1

Christopher Schmidt crschmidt at metacarta.com
Fri Sep 26 07:19:47 EDT 2008


On Fri, Sep 26, 2008 at 07:34:31AM +0200, Adorian Ardelean wrote:
> Hi,
> 
> Perhaps a very simple question: I would like to build a tree-like custom
> layer switcher in a floating div outside of OL map div.
> Could layers visibility (on/off) be controlled through code (base layers and
> the rest)? I did search the Nabble user forum and the examples on OL site,
> but did not find anything on this issue.

Yes.

http://dev.openlayers.org/apidocs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.setVisibility

http://dev.openlayers.org/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.setBaseLayer

The former is for overlays, the latter is for base layers.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list