[OpenLayers-Dev] Wanted: a generic control wrapper

Ludwig Max Brinckmann ludwigbrinckmann at gmail.com
Wed Nov 8 12:26:58 EST 2006


I find that there is a little too much combination of 'business-logic' and
presentation in the way the LayerSwitcher is implemented. One aspect of it
is the actual layer control, but the other is just having a control that can
be opened and closed.

I do not know if you have considered separating the two, so that there would
be a generic control, which would set up the open/close functionality and
have some ways of positioning it on the page plus a control over the size
when opened.
A second bit of functionality would be e.g. the layerswitcher, which would
simply fill a div in the generic control and to which the generic control
would delegate when redrawing the contents.
This would make it easier to develop custom controls that one could fill
with additional functionality, with a shared behaviour/appearance on the
screen.

I hacked out some simple stuff that I just need for a demo here, but you can
see the base idea at
http://iceds.ge.ucl.ac.uk/OL/control.html

On the right hand side are three controls, the top a variation of the
layerswitcher, the bottom two browsers that will allow adding a layer to
OpenLayers by clicking on a WMS Layer. All three controls just use the same
dummy control to handle the opening and there are ways to set the size and
position....

(The green sliders in the layerswitcher are supposed to enable a user to
adjust the opacity of a layer, but somehow the sliders do not get the mouse
focus, as the map dragging monopolises it. The layers are also supposed to
be restackable using scriptaculous sortable, but in this version it does not
work for the same reason).

I have only tested this on firefox (it does not work at all on IE) and there
a quite a few bugs in it, but I thought submitting the idea to get some more
input on how this could be done in the most generic fashion.

Ludwig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20061108/3a201d1f/attachment.html


More information about the Dev mailing list