Problem with multiple SelectFeature Controls within one map

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problem with multiple SelectFeature Controls within one map

John, Steffen

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')){
                               setMeasureWindowValues(null, feature);

                            } else {
                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,

Users mailing list
[hidden email]