[OpenLayers-Users] Can multiple mouse handler controls be active?

Jean-François Gigand jf at geonef.fr
Sun Aug 21 19:47:05 EDT 2011


Hi Rohan,

If you want multiple vector layers to be selectable, you just have to
pass them as an array to the select control, instead of creating one
select control for each layer.

Hope this helps,

Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/




2011/8/22 Rohan Parkes <melanchthon76 at gmail.com>:
> I have a vector layer displaying geometries, with a selectFeature control.
> When the user selects a feature, one or more vector layers become active on
> top of the lowest layer, displaying geometries that abut the selected
> geometry. Additionally, there is a top layer with icons that displays a
> popup containing infomation about the abutting geometry when clicked.
>
> The icon layer is implemented as a vector layer rather than as a marker
> layer. (The documentation seems to indicate that the marker layer type is
> deprecated. There were additional reasone why this wasn't the favoured
> solution.) To make the icons clickable, I have added a customised click
> control to that layer, inspired by an example in the OL demos.
>
> The problem is that when active, the click control seems to be preventing
> the clicks from permeating to the featureSelect control, so that when the
> top icon layer displays, the user can no longer select a geometry on the
> lowest layer. This is not a problem in IE, but is in every other browser.
>
> The Feature handler in the click control has parameters called stopClick and
> stopDown that seem to be designed to allow mouse events to permeate, but
> setting them to true has no effect (and in any case, as they default to
> false, they should be causing the same problem in IE).
>
> Is it possible to have multiple controls active that respond to mouse
> events? Otherwise, can anyone suggest a better implementation for what I am
> trying to build?
>
> Rohan Parkes
> Melbourne
> Australia
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>


More information about the Users mailing list