editing controls, preserve selection

9 messages Options
Embed this post
Permalink
Pierre GIRAUD

editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink
Hello all,

Recently I worked on Tim's code to enhance the editing functionnalities.

The result can be seen in the camptocamp/feature sandbox.

I'm now facing an little issue. What is frustrating for the user is
that each time he switches between the two different editing controls
(modifyFeature and deleteVertex), the current selection is lost. The
user need to reselect a feature so that he can modify it.

The problem is that when a control is deactivated, the select control
it relies on is also deactivate and the selectFeature.unselect()
method is called.

Does someone has an idea of a workaround to let a control preserve
selection so that another control can use it ?

Regards

Pierre
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Cameron Shorter

Re: editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink
Pierre,
I suspect that for some controls it makes sense to deselect a feature
when you change controls, and for others (like yours) it doesn't make sense.
So it probably should be a flag a control should set. (I haven't looked
into the code to see where this should happen).

Pierre GIRAUD wrote:

> Hello all,
>
> Recently I worked on Tim's code to enhance the editing functionnalities.
>
> The result can be seen in the camptocamp/feature sandbox.
>
> I'm now facing an little issue. What is frustrating for the user is
> that each time he switches between the two different editing controls
> (modifyFeature and deleteVertex), the current selection is lost. The
> user need to reselect a feature so that he can modify it.
>
> The problem is that when a control is deactivated, the select control
> it relies on is also deactivate and the selectFeature.unselect()
> method is called.
>
> Does someone has an idea of a workaround to let a control preserve
> selection so that another control can use it ?
>
> Regards
>
> Pierre
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>
>  


--
Cameron Shorter
Systems Architect, http://lisasoft.com.au
Tel: +61 (0)2 8570 5050
Mob: +61 (0)419 142 254

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Tim Schaub-3

Re: editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink
In reply to this post by Pierre GIRAUD
Hey-

Pierre GIRAUD wrote:
> The problem is that when a control is deactivated, the select control
> it relies on is also deactivate and the selectFeature.unselect()
> method is called.

The unselect method should not be called when the SelectFeature control
is deactivated.

I can confirm that things work like they should by going to
http://openlayers.org/dev/examples/select-feature.html

After drawing a polygon, I click the "select polygon on click" input to
activate the SelectFeature control.

I click a polygon, it gets selected, and turns blue.

I click the "draw polygon" input deactivating the SelectFeature control
and activating the DrawFeature control, and the polygon stays blue.

Are you seeing something different?

Tim

>
> Does someone has an idea of a workaround to let a control preserve
> selection so that another control can use it ?
>
> Regards
>
> Pierre
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>
> !DSPAM:4033,46cc2faf22141849620573!
>

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Steven M. Ottens

Re: editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink
In reply to this post by Pierre GIRAUD
Hi Pierre,

I'm currently more involved in user interaction design and not so  
much in coding so it could be that I'm cutting corners which are hard  
to cut but:

why do you need to switch between modifyFeature control and  
deleteVertex control?
IMO you can stay in modfiyFeature mode and allow the user to delete a  
vertex by selecting it and press the delete key or hit the right  
mouse button and select 'delete' .
I am aware that this approach forces the user to understand that a  
webpage has more controls than mere links: keyboard, scrollwheel and  
the right mouse button behave differently than in the classic Web.  
I've been a great advisory (?) of backwards compatibility but  
sometimes you need to take the extra step and force people to spend  
10s more time to get the new paradigm to save 9s every time they do  
the action.

This rambling has mainly focussed on your approach of feature editing  
and doesn't solve you core question of preservation of selection,  
sorry about that. I hope you solve your issue but even more I hope  
you reconsider your current design (TBH there are valid reasons to  
keep your current design, but ease of coding isn't one IMHO :)

good luck
steven

On Aug 22, 2007, at 2:44 PM, Pierre GIRAUD wrote:

> Hello all,
>
> Recently I worked on Tim's code to enhance the editing  
> functionnalities.
>
> The result can be seen in the camptocamp/feature sandbox.
>
> I'm now facing an little issue. What is frustrating for the user is
> that each time he switches between the two different editing controls
> (modifyFeature and deleteVertex), the current selection is lost. The
> user need to reselect a feature so that he can modify it.
>
> The problem is that when a control is deactivated, the select control
> it relies on is also deactivate and the selectFeature.unselect()
> method is called.
>
> Does someone has an idea of a workaround to let a control preserve
> selection so that another control can use it ?
>
> Regards
>
> Pierre
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Tim Schaub-3

Re: editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink
Steven M. Ottens wrote:

> Hi Pierre,
>
> I'm currently more involved in user interaction design and not so  
> much in coding so it could be that I'm cutting corners which are hard  
> to cut but:
>
> why do you need to switch between modifyFeature control and  
> deleteVertex control?
> IMO you can stay in modfiyFeature mode and allow the user to delete a  
> vertex by selecting it and press the delete key or hit the right  
> mouse button and select 'delete' .
> I am aware that this approach forces the user to understand that a  
> webpage has more controls than mere links: keyboard, scrollwheel and  
> the right mouse button behave differently than in the classic Web.  
> I've been a great advisory (?) of backwards compatibility but  
> sometimes you need to take the extra step and force people to spend  
> 10s more time to get the new paradigm to save 9s every time they do  
> the action.
>
> This rambling has mainly focussed on your approach of feature editing  
> and doesn't solve you core question of preservation of selection,  
> sorry about that. I hope you solve your issue but even more I hope  
> you reconsider your current design (TBH there are valid reasons to  
> keep your current design, but ease of coding isn't one IMHO :)
>

I like the idea of creating small, single function controls.  Then
additional controls can be created that aggregate these.  I think this
gives us the most flexibility.

We've done a lot of work to get things this way currently.

So you've got a drag handler.  A box handler has a drag handler.  Then,
a zoom box control has a box handler.  This way, other things can also
make use of the drag handler (like the drag pan control) and other
things can make use of the box handler (like a box selection control).

The same goes for feature editing.  We've now got a drag feature control
in the trunk.  This uses a drag handler and a feature handler.  Alone,
it doesn't do that much, it lets you drag feature around.  We're also
putting together a modify feature control.  This uses a select feature
control and a drag feature control.  Together, it lets you select a
feature and drag around its verticies.

Next, we need delete vertex and add vertex controls.  Alone, these would
do just what they say.  These could be aggregated with a modify feature
control (and even a draw feature control if you like) into a single
feature editing control that lets you drag around verticies, add new
ones, and delete existing ones. Combined with a draw feature control,
this would give you one control to draw and edit.

Of course, there will be a lot of room for help from interaction
designers.  Ideally, we'll be able to use a combination of keyboard and
mouse input to activate and deactivate specific functionality in these
controls.

So, perhaps you were suggesting the same - but I wanted to make sure
that it was clear that it *doesn't* make sense to develop the
full-featured editing control before having the individual pieces in
place.

Tim

> good luck
> steven
>
> On Aug 22, 2007, at 2:44 PM, Pierre GIRAUD wrote:
>
>> Hello all,
>>
>> Recently I worked on Tim's code to enhance the editing  
>> functionnalities.
>>
>> The result can be seen in the camptocamp/feature sandbox.
>>
>> I'm now facing an little issue. What is frustrating for the user is
>> that each time he switches between the two different editing controls
>> (modifyFeature and deleteVertex), the current selection is lost. The
>> user need to reselect a feature so that he can modify it.
>>
>> The problem is that when a control is deactivated, the select control
>> it relies on is also deactivate and the selectFeature.unselect()
>> method is called.
>>
>> Does someone has an idea of a workaround to let a control preserve
>> selection so that another control can use it ?
>>
>> Regards
>>
>> Pierre
>> _______________________________________________
>> Dev mailing list
>> [hidden email]
>> http://openlayers.org/mailman/listinfo/dev
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>
> !DSPAM:4033,46ccb5d4206011096210785!
>

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Eric Lemoine

Re: editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink
In reply to this post by Tim Schaub-3
On 8/22/07, Tim Schaub <[hidden email]> wrote:

> Hey-
>
> Pierre GIRAUD wrote:
> > The problem is that when a control is deactivated, the select control
> > it relies on is also deactivate and the selectFeature.unselect()
> > method is called.
>
> The unselect method should not be called when the SelectFeature control
> is deactivated.
>
> I can confirm that things work like they should by going to
> http://openlayers.org/dev/examples/select-feature.html
>
> After drawing a polygon, I click the "select polygon on click" input to
> activate the SelectFeature control.
>
> I click a polygon, it gets selected, and turns blue.
>
> I click the "draw polygon" input deactivating the SelectFeature control
> and activating the DrawFeature control, and the polygon stays blue.
>
> Are you seeing something different?

Hi,

You're right Tim, unselect() doesn't get called when deactivating the
SelectFeature Control.

However, I've noticed an issue, which might be what Pierre is running
into. Draw a polygon, choose "select polygon on click", click on the
polygon, then click on + or - on the zoom control, and your selection
will go away. The problem doesn't appear when clicking on the
LayerSwitcher or on the Pan Control.

--
Eric
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Eric Lemoine

Re: editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink
On 8/23/07, Eric Lemoine <[hidden email]> wrote:

> On 8/22/07, Tim Schaub <[hidden email]> wrote:
> > Hey-
> >
> > Pierre GIRAUD wrote:
> > > The problem is that when a control is deactivated, the select control
> > > it relies on is also deactivate and the selectFeature.unselect()
> > > method is called.
> >
> > The unselect method should not be called when the SelectFeature control
> > is deactivated.
> >
> > I can confirm that things work like they should by going to
> > http://openlayers.org/dev/examples/select-feature.html
> >
> > After drawing a polygon, I click the "select polygon on click" input to
> > activate the SelectFeature control.
> >
> > I click a polygon, it gets selected, and turns blue.
> >
> > I click the "draw polygon" input deactivating the SelectFeature control
> > and activating the DrawFeature control, and the polygon stays blue.
> >
> > Are you seeing something different?
>
> Hi,
>
> You're right Tim, unselect() doesn't get called when deactivating the
> SelectFeature Control.
>
> However, I've noticed an issue, which might be what Pierre is running
> into. Draw a polygon, choose "select polygon on click", click on the
> polygon, then click on + or - on the zoom control, and your selection
> will go away. The problem doesn't appear when clicking on the
> LayerSwitcher or on the Pan Control.

One additionnal note: after clicking to + or - on the zoom control, if
you go back and click again on the feature, the selection won't work.
You'll need to click a second time to actually select the feature.

--
Eric
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Pierre GIRAUD

Re: editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink
In reply to this post by Tim Schaub-3
Comments below.

On 8/23/07, Tim Schaub <[hidden email]> wrote:

> Steven M. Ottens wrote:
> > Hi Pierre,
> >
> > I'm currently more involved in user interaction design and not so
> > much in coding so it could be that I'm cutting corners which are hard
> > to cut but:
> >
> > why do you need to switch between modifyFeature control and
> > deleteVertex control?
> > IMO you can stay in modfiyFeature mode and allow the user to delete a
> > vertex by selecting it and press the delete key or hit the right
> > mouse button and select 'delete' .
> > I am aware that this approach forces the user to understand that a
> > webpage has more controls than mere links: keyboard, scrollwheel and
> > the right mouse button behave differently than in the classic Web.
> > I've been a great advisory (?) of backwards compatibility but
> > sometimes you need to take the extra step and force people to spend
> > 10s more time to get the new paradigm to save 9s every time they do
> > the action.
> >
> > This rambling has mainly focussed on your approach of feature editing
> > and doesn't solve you core question of preservation of selection,
> > sorry about that. I hope you solve your issue but even more I hope
> > you reconsider your current design (TBH there are valid reasons to
> > keep your current design, but ease of coding isn't one IMHO :)
> >
>
> I like the idea of creating small, single function controls.  Then
> additional controls can be created that aggregate these.  I think this
> gives us the most flexibility.
>
> We've done a lot of work to get things this way currently.
>
> So you've got a drag handler.  A box handler has a drag handler.  Then,
> a zoom box control has a box handler.  This way, other things can also
> make use of the drag handler (like the drag pan control) and other
> things can make use of the box handler (like a box selection control).
>
> The same goes for feature editing.  We've now got a drag feature control
> in the trunk.  This uses a drag handler and a feature handler.  Alone,
> it doesn't do that much, it lets you drag feature around.  We're also
> putting together a modify feature control.  This uses a select feature
> control and a drag feature control.  Together, it lets you select a
> feature and drag around its verticies.
>
> Next, we need delete vertex and add vertex controls.  Alone, these would
> do just what they say.  These could be aggregated with a modify feature
> control (and even a draw feature control if you like) into a single
> feature editing control that lets you drag around verticies, add new
> ones, and delete existing ones. Combined with a draw feature control,
> this would give you one control to draw and edit.
>
> Of course, there will be a lot of room for help from interaction
> designers.  Ideally, we'll be able to use a combination of keyboard and
> mouse input to activate and deactivate specific functionality in these
> controls.
>
> So, perhaps you were suggesting the same - but I wanted to make sure
> that it was clear that it *doesn't* make sense to develop the
> full-featured editing control before having the individual pieces in
> place.

I'm okay with that.
In the camptocamp/feature sandbox modify-feature's example, we can add
a vertex by moving a virtual point. This way I think we don't need an
individual addVertex control. I might be wrong.
On the other hand, I agree that the deleteVertex needs to be
redesigned to become an individual piece.

About the problem of selection preservation, I pushed my reflexions further.
First of all, the unselect was called in the full featured controls. I
just have to comment some code to keep the features selected when I
switch between tools. My problem now is that I probably don't want to
preserve the selection when I use a drawFeature control.
I had a look at some vector editing desktop software. Inkscape is a
good reference IMO and switching between different tools, the
selection is kept until user starts drawing a new geometry.
So, I now think that the drawFeature control could have an optional
selectControl that selects the drawn feature and unselects in the same
way the previous selected one.

What is your opinion about that ?

Pierre

>
> Tim
>
> > good luck
> > steven
> >
> > On Aug 22, 2007, at 2:44 PM, Pierre GIRAUD wrote:
> >
> >> Hello all,
> >>
> >> Recently I worked on Tim's code to enhance the editing
> >> functionnalities.
> >>
> >> The result can be seen in the camptocamp/feature sandbox.
> >>
> >> I'm now facing an little issue. What is frustrating for the user is
> >> that each time he switches between the two different editing controls
> >> (modifyFeature and deleteVertex), the current selection is lost. The
> >> user need to reselect a feature so that he can modify it.
> >>
> >> The problem is that when a control is deactivated, the select control
> >> it relies on is also deactivate and the selectFeature.unselect()
> >> method is called.
> >>
> >> Does someone has an idea of a workaround to let a control preserve
> >> selection so that another control can use it ?
> >>
> >> Regards
> >>
> >> Pierre
> >> _______________________________________________
> >> Dev mailing list
> >> [hidden email]
> >> http://openlayers.org/mailman/listinfo/dev
> >
> > _______________________________________________
> > Dev mailing list
> > [hidden email]
> > http://openlayers.org/mailman/listinfo/dev
> >
> > !DSPAM:4033,46ccb5d4206011096210785!
> >
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Steven M. Ottens

Re: editing controls, preserve selection

Reply Threaded More More options
Print post
Permalink

On Aug 23, 2007, at 12:56 PM, Pierre GIRAUD wrote:

> Comments below.
>
> On 8/23/07, Tim Schaub <[hidden email]> wrote:
>> Steven M. Ottens wrote:
>>> Hi Pierre,
>>>
>>> I'm currently more involved in user interaction design and not so
>>> much in coding so it could be that I'm cutting corners which are  
>>> hard
>>> to cut but:
>>>
>>> why do you need to switch between modifyFeature control and
>>> deleteVertex control?
>>>
>>
<snip>

>> Next, we need delete vertex and add vertex controls.  Alone, these  
>> would
>> do just what they say.  These could be aggregated with a modify  
>> feature
>> control (and even a draw feature control if you like) into a single
>> feature editing control that lets you drag around verticies, add new
>> ones, and delete existing ones. Combined with a draw feature control,
>> this would give you one control to draw and edit.
>>
>> Of course, there will be a lot of room for help from interaction
>> designers.  Ideally, we'll be able to use a combination of  
>> keyboard and
>> mouse input to activate and deactivate specific functionality in  
>> these
>> controls.
>>
>> So, perhaps you were suggesting the same - but I wanted to make sure
>> that it was clear that it *doesn't* make sense to develop the
>> full-featured editing control before having the individual pieces in
>> place.

Like I said I was cutting corners, obviously it makes sense to first  
develop the pieces before finishing the puzzle. I was already looking  
at the puzzle ;)


>
> I'm okay with that.
> In the camptocamp/feature sandbox modify-feature's example, we can add
> a vertex by moving a virtual point. This way I think we don't need an
> individual addVertex control. I might be wrong.
> On the other hand, I agree that the deleteVertex needs to be
> redesigned to become an individual piece.
>
I like the virtual vertices to add new vertices.
Having a separate deleteVertex control makes sense as long as it is  
possible to combine it with the modifyFeature to a single tool as Tim  
said above.

> About the problem of selection preservation, I pushed my reflexions  
> further.
> First of all, the unselect was called in the full featured controls. I
> just have to comment some code to keep the features selected when I
> switch between tools. My problem now is that I probably don't want to
> preserve the selection when I use a drawFeature control.
> I had a look at some vector editing desktop software. Inkscape is a
> good reference IMO and switching between different tools, the
> selection is kept until user starts drawing a new geometry.
> So, I now think that the drawFeature control could have an optional
> selectControl that selects the drawn feature and unselects in the same
> way the previous selected one.
>
> What is your opinion about that ?
>
It makes sense, if you start drawing a new feature there's no need to  
keep the old one selected. Even more it is confusing to edit one  
feature while another one is selected. People will probably think it  
as a (rendering) bug.

Steven
> Pierre


_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev