[OpenLayers-Dev] editing controls, preserve selection

Eric Lemoine eric.c2c at gmail.com
Thu Aug 23 01:08:29 EDT 2007


On 8/23/07, Eric Lemoine <eric.c2c at gmail.com> wrote:
> On 8/22/07, Tim Schaub <tschaub at openplans.org> 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



More information about the Dev mailing list