Discussion:
Problem with multiple SelectFeature Controls within one map
(too old to reply)
John, Steffen
2017-05-02 09:13:44 UTC
Permalink
Hi!

I'm using OpenLayers2 within Geoexplorer and Geonode. By default in Geonode, SelectFeatures controls are added for each layer in the map to request the getFeatureInfo.
In addition, I made an extension to Geonode, which also includes adding some SelectFeatures Controls to an additional draw layer.

Now I have the problem, that the SelectFeatures Controls from my extension are not working anymore, whenever a layer is loaded which has the SelectFeature Control for the GetFeatureInfo.

When the layer with the GetFeature Select Control is loaded after the extension, the extension works and not the getfeatureinfo in the layer.

To summerize, only the selectFeatureControl works, which is loaded first. I tried deactivating those GetFeatureInfo Select Controls, but this didn't help. There must be somehow a conflict between those.

Here ist the code of the selectcontrols from my extension:

editSelectMultiple: new OpenLayers.Control.SelectFeature(
[drawLayer], {
clickout: true,
toggle: true,
multiple: false,
hover: false,
multipleKey: 'shiftKey',
toggleKey: 'ctrlKey',
multiple: true,
vertexRenderIntent: 'select',
box: true,
onSelect: function(feature) {
if (drawLayer.selectedFeatures.length == 1) {
if (!Ext.getCmp('measureWindow')){
showMeasureWindow();
}
setMeasureWindowValues(null, feature);

} else {
closeMeasureWindow();
}

}
}
),
hover: new OpenLayers.Control.SelectFeature(
[drawLayer], {
hover: true,
highlightOnly: true,
renderIntent: "temporary"
}
),

Does anyone has an idea of how to fix that?

Thanks in advance,
Steffen

Continue reading on narkive:
Loading...