[OpenLayers-Users] Hover control sample (share)

Eric Lemoine eric.c2c at gmail.com
Mon Jan 19 16:19:23 EST 2009


On Mon, Jan 19, 2009 at 3:30 PM, Alexandre Dube <adube at mapgears.com> wrote:
> Hi Eric,
>
>  I took a look at the SelectFeature control.  Now I understand what you
> meant and it makes sense.  Also, it's also making sense to have this control
> have the possibility to highlight on hover or on click.
>
>  "beforefeaturehighlighted" and "featurehighlighted" events make sense, but
> a "featureunhighlighted" (or some other term meaning that the feature was
> highlighted and is now no more) would also be useful.

Alexandre,

The more I think about this highlight feature control the more I think
there's no room for both a select feature and a highlight feature
controls.

What causes people trouble is that they can't use two select feature
controls, one in hover mode and the other in click mode. This is
because once a feature is hovered it is selected, and cannot be
selected again when it is clicked.

Maybe we could modify the select feature control so that (1) it
optionally uses its own selectedFeatures array, as opposed to relying
on the layer's, and (b) defines its own "beforefeatureselected",
"featureselected" and "featureunselected" event types. In this way,
one should be able to use two select feature controls, and get
"featureselected" events, from the first control when features are
hovered and from the second control when features are clicked.

Tell me what you think,

--
Eric



More information about the Users mailing list