[OpenLayers-Users] Hover control sample (share)
Eric Lemoine
eric.c2c at gmail.com
Thu Jan 15 12:10:27 EST 2009
Thanks for sharing your code Alexandre.
I thought about a Feature control in the past. That control would use
a Feature handler internally and would be configured to work either in
hover or click mode, just like the SelectFeature control. But, as
yours, it wouldn't select features, but just trigger events when
features are hovered or clicked. To avoid code duplication I also
imagined that the SelectFeature control could be based on that control
instead of relying directly on the Feature handler.
But I had the same reasoning as you: why bother? Building a custom
Feature handler-based control is easy enough...
But, actually, there are so many people needing that thing that it may
be valuable to have it in trunk.
Cheers,
Eric
2009/1/15, Alexandre Dube <adube at mapgears.com>:
> Hi list,
>
> I just want to share a sample of Handler.Hover usage I do. The result
> is a Control.Hover I use to change the style of features hover the mouse
> without selecting them and display a popup at the same time. You could
> also register events on "hoverfeatureset" and "hoverfeaturereset" to do
> more stuff if you want.
>
> See the example :
>
> http://dev.openlayers.org/sandbox/adube/openlayers/examples/hover-control.html
>
> See the code :
>
> http://dev.openlayers.org/sandbox/adube/openlayers/lib/OpenLayers/Control/Hover.js
>
> At first I wanted it to be a new OpenLayers feature, but then I
> thought that Handlers were created for the purpose of customizing our
> own controls depending of what our needs are. So this Hover control is
> one of many possible usage of Handlers, so IMHO it's not useful to make
> it a new feature. Sharing it is enough.
>
> Comments are welcomed,
>
> --
> Alexandre Dubé
> Mapgears
> www.mapgears.com
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
More information about the Users
mailing list