[OpenLayers-Users] Control SelectFeature errors

Jimmy Aumard jimmy.aumard at gmail.com
Fri Oct 23 04:16:13 EDT 2009


Hi,

I try to use the control selectFeature on multiple layers but I have an
error.

I try this:

var selectFeature=new OpenLayers.Control.SelectFeature(layers,{
        multiple:false, hover:false,
        clickout:true, toggle:false,
    });

    selectFeature.onSelect=function(feature){
        alert(feature.fid);
    };

    selectFeature.onUnselect=function(feature){
        alert(feature.fid);
    };

I firebug give me :
 this.layer.getFeatureFromEvent is not a function
http://192.168.40.67/www/OpenLayers-2.8/lib/OpenLayers/Handler/Feature.js
Line 229

And :
layer.selectedFeatures is undefined
http://192.168.40.67/www/OpenLayers-2.8/lib/OpenLayers/Control/SelectFeature.js
Line 288

Where is my error?

Cheers

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091023/b2ddc4fb/attachment.html


More information about the Users mailing list