This is a good point, and implementing it means we can remove a fair bit of
code. We only need to make sure that we have the renderGeometryFunction on
all layers we select from, but no other mapping.
On 11 Mar 2014 08:52, "Éric Lemoine" <notifications@github.com> wrote:

> In src/ol/interaction/selectinteraction.js:
>
> > +    }
> > +    var layerMap = this.layerMap_;
> > +    this.renderGeometryFunctions_[goog.getUid(layer)] = function(
> > +        geometry, object) {
> > +      if (object instanceof ol.Feature) {
> > +        return layerMap[goog.getUid(object)] !== layer;
> > +      }
> > +      return true;
> > +    };
> > +    if (goog.array.indexOf(renderGeometryFunctions.getArray(),
> > +        this.renderGeometryFunctions_) == - 1) {
> > +      var renderGeometryFunction =
> > +          this.renderGeometryFunctions_[goog.getUid(layer)];
> > +      renderGeometryFunctions.push(renderGeometryFunction);
> > +    }
> > +    this.layerMap_[goog.getUid(feature)] = layer;
>
> Even if we do not add the feature in the collection multiple times we
> should skip it in the layers it was selected from. Maybe I overlooked
> something and your patch already handles this.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/openlayers/ol3/pull/1834/files#r10464205>
> .
>