[OpenLayers-Dev] Select Feature - programatically select - doesn't check if feature is already selected

Alexandre Dube adube at mapgears.com
Thu Aug 6 08:30:26 EDT 2009


Hi Ivan,

Do you have an example showing when this can happen ? I've been playing 
with the SelectFeature control and can't figure how you can have the 
same feature added 2 times to the layer.selectedFeatures array, unless 
you do it manually.

Regards,

Alexandre

Ivan Grcic wrote:
> If we do several times:
>
> selectContorl.select(feature)
>
> feature is added to layer.selectedFeature array several times.
>
> Should we first check  if the feature is allready selected (ill open a ticket)
>
> if (OpenLayers.Util.indexOf(layer.selectedFeatures, feature) == -1) {
>     this.select(feature);
> }
>
> Or we leave selectControl as it is, and leave this to user to solve it
> on application level?
>
> Regards
>
>   


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Dev mailing list