[OpenLayers-Users] select control no longer works after map.setLayerZIndex

Xavier Mamano (jorix) xavier.mamano at gmail.com
Fri Apr 26 07:46:11 PDT 2013


Hi,

See
https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Handler/Feature.js#L412
used by `this.handlers.feature.activate()` at
OpenLayers.Control.SelectFeature activation :(

Regards,


Paul Meems wrote
> Hi list,
> 
> I have a map with 3 layers. 1 base layer, 1 overlay and 1 WFS layer.
> I load them like this:
> map.addLayers([baseLayer, wfsLayer, overlayLayer]);
> 
> When an user clicks on the map it should select the feature on the WFS
> layer.
> So I have added the select contro after calling map.addLayers:
>   selectControl = new OpenLayers.Control.SelectFeature(
>       [wfsLayer],
>       {
>           clickout: true, toggle: false,
>           multiple: false, hover: false
>       }
>   );
>   map.addControl(selectControl);
>   selectControl.activate();
> 
> This works great, my features get selected when clicked.
> 
> But my overlay layer is beneath the WFS layer and I want it to be on top.
> The overlay layer is a non-filled polygon layer.
> So I added map.setLayerZIndex(overlayLayer, map.Z_INDEX_BASE[ "Feature"
> ]+10);
> after map.addLayers.
> This looks OK. My overlay layer is now above my WFS layer.
> But when I now click on the map, nothing gets selected.
> 
> Most likely I'm not doing it right. How can I make my overlay layer on top
> and my WFS layer selectable?
> 
> Thanks,
> 
> Paul
> 
> _______________________________________________
> Users mailing list

> Users at .osgeo

> http://lists.osgeo.org/mailman/listinfo/openlayers-users





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/select-control-no-longer-works-after-map-setLayerZIndex-tp5049812p5049922.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list