Wanted: a generic control wrapper

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Wanted: a generic control wrapper

Ludwig
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



_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Wanted: a generic control wrapper

Cameron Shorter
Sounds like you are asking for a ToolBar or ControlBar.
A ToolBar shows an array of Tool Icons. When you select a tool, you get
a Control popup, or you change the way a Control works.

The entire Toolbar should be able to be hidden or expanded.

There should be a distinction between the different types of buttons.
They can be:
* 2 State - on/off, multiple tools can be selected at once
* Radio buttons - on/off, pressing one button deselects other radio buttons
* One Shot

(I'm also interested in this sort of functionality)

Ludwig Max Brinckmann wrote:

> 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
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev


--
Cameron Shorter
http://cameron.shorter.net
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Wanted: a generic control wrapper

Ludwig
One step at a time. For the moment I just wanted to factor out the code the operates the generics of a control. But once this is done then OpenLayers would have the base to build some sort of dashboard for controls.

Ludwig

On 11/8/06, Cameron Shorter <[hidden email]> wrote:
Sounds like you are asking for a ToolBar or ControlBar.
A ToolBar shows an array of Tool Icons. When you select a tool, you get
a Control popup, or you change the way a Control works.

The entire Toolbar should be able to be hidden or expanded.

There should be a distinction between the different types of buttons.
They can be:
* 2 State - on/off, multiple tools can be selected at once
* Radio buttons - on/off, pressing one button deselects other radio buttons
* One Shot

(I'm also interested in this sort of functionality)

Ludwig Max Brinckmann wrote:

> 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
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev


--
Cameron Shorter
http://cameron.shorter.net


_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Wanted: a generic control wrapper

Erik Uzureau
Dear Ludwig,
I like this idea for factoring out generic code into Control.js --
your demo looks cool. Would you be interested in contributing to the
OpenLayers codebase?

Check out:

http://trac.openlayers.org/wiki/HowToContribute

for information on how to get this code into the project.

Thanks for your interest and input and hope to hear from you
Erik

On 11/9/06, Ludwig Max Brinckmann <[hidden email]> wrote:

> One step at a time. For the moment I just wanted to factor out the code the
> operates the generics of a control. But once this is done then OpenLayers
> would have the base to build some sort of dashboard for controls.
>
>  Ludwig
>
>
> On 11/8/06, Cameron Shorter <[hidden email]> wrote:
> > Sounds like you are asking for a ToolBar or ControlBar.
> > A ToolBar shows an array of Tool Icons. When you select a tool, you get
> > a Control popup, or you change the way a Control works.
> >
> > The entire Toolbar should be able to be hidden or expanded.
> >
> > There should be a distinction between the different types of buttons.
> > They can be:
> > * 2 State - on/off, multiple tools can be selected at once
> > * Radio buttons - on/off, pressing one button deselects other radio
> buttons
> > * One Shot
> >
> > (I'm also interested in this sort of functionality)
> >
> > Ludwig Max Brinckmann wrote:
> > > 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
> > >
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Dev mailing list
> > > [hidden email]
> > > http://openlayers.org/mailman/listinfo/dev
> >
> >
> > --
> > Cameron Shorter
> > http://cameron.shorter.net
> >
>
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>
>
>
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev