[OpenLayers-Users] Control SelectFeature errors

Christopher Schmidt crschmidt at metacarta.com
Mon Oct 26 12:49:05 EDT 2009


On Fri, Oct 23, 2009 at 10:16:13AM +0200, Jimmy Aumard wrote:
> 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?

Since your code is incomplete, it's hard to know. Perhaps a full example of
your code would allow for a better understanding. It looks like your layers may
not be vector layers. 

> Cheers
> 
> Jim

> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list