[OpenLayers-Users] RE SelectFeature on vector layer under WMS layer

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Wed Dec 18 07:42:50 PST 2013


Did you try to modify the index of your wfs layer?
setLayerIndex or setLayerZIndex...not sure
I think setLayerIndex would be better
steve





Marc-André Trottier <trottier.marcandre at gmail.com>@lists.osgeo.org 
Envoyé par : openlayers-users-bounces at lists.osgeo.org
2013-12-18 09:13

A
openlayers-users at lists.osgeo.org
cc

Objet
[OpenLayers-Users] SelectFeature on vector layer under WMS layer








I have a selectFeature define on my vector layer :
so, 'featureselected' event never start because my WMS layer is on top.
i looked for start manually the event but i was stopped when i saw on line 
#212 of Feature.js, the param 'evt' don't have the polygon who must be 
selected. 
How can i do this ?

P.S.: all that start with IE 8, because it can not support correctly 
labelling on layer vector. 
on IE 8, label is selected when you pass over and the polygon is 
unselected. 

some code : 

reg_admin = new OpenLayers.Layer.Vector("reg_admin", {
isBaseLayer:false,
rendererOptions: {zIndexing: true},
minResolution: 1200,
maxResolution: 5000,
clone:"",
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url:  "/cgi-wms/mapserv?map=dpop&service=wfs&version=1.1.0",
featureType: "dpop_criminalite_generale_v_s",
geometryName: "geom_s"
}),
filter:
new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.EQUAL_TO,
property: "year",
value: "2012"
                    })
});

reg_admin.events.on({
'featureselected': function(e) {
bla bla bla
},
'featureunselected': function(e) {
bla bla bla
}
});

var selecthover = new OpenLayers.Control.SelectFeature(
reg_admin,
{
 multiple: false,
 hover: true
}
);

numeroRegion = new OpenLayers.Layer.WMS( "numberOnly",
 '/cgi-wms/adnInternetV2?',
{layers: 'numberOnly',
  format: szFormat,
 transparent: true,
 NOCACHE: Math.random()
},
oWMSOverlayOptions
);
numeroRegion.setVisibility(true);
numeroRegion.displayInLayerSwitcher = false;

map.addControl(selecthover);
selecthover.activate();
map.addLayers([fondRelief, reg_admin, numeroRegion ]);


_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20131218/91b7394e/attachment-0001.html>


More information about the Users mailing list