[OpenLayers-Users] Custom LayerSwitcher

Diego Guidi diegoguidi at gmail.com
Tue Mar 11 10:19:05 EDT 2008


>  I have one nearyly finished file
>  http://www.bnhelp.cz/wwwlibs/hslayers/hsAddons/Control/ExtLayerSwitcher.js

I've modified this code to maintain only a display view with a layers
management a little bit different.
Background informations:
if someone publish different wms layers, foreach layer we need to
download a separate image or a different group of tiles: if I have one
WMS and i need to show more layers, it's better to play with WMS
LAYERS parameter to make a single request and obtain a single image
that merges all layers requested.
So I've used your code to introduce, for overlays only, a concept of
virtual layers:
all layers that are not baselayers are from a single OpenLayers.WMS
layer, but when i check/uncheck one or more of virtua layers, actually
a refresh of the WMS layer is launched, using a new LAYERS string as
WMS parameter.
It's not so easy to explain, but the code is more readable that my words ;)
This is not a real "component" - the code uses some global
variables... :( - butI hope that this is a basis to start :)
Thanks to Jachym for the code, and enjoy :)
Diego
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExtLayerSwitcher.js
Type: application/x-javascript
Size: 13855 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080311/52977e01/ExtLayerSwitcher.js


More information about the Users mailing list