Pass layer to forEachFeatureAtPixel callback

This commit is contained in:
Tom Payne
2013-12-02 16:45:50 +01:00
parent f1a9f76841
commit e9267e401c
4 changed files with 8 additions and 4 deletions

View File

@@ -92,6 +92,7 @@ ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtPixel =
goog.asserts.assert(!ol.extent.isEmpty(this.renderedExtent_));
goog.asserts.assert(!isNaN(this.renderedResolution_));
var coordinate = this.getMap().getCoordinateFromPixel(pixel);
var layer = this.getLayer();
var renderGeometryFunction = this.getRenderGeometryFunction_();
goog.asserts.assert(goog.isFunction(renderGeometryFunction));
return this.replayGroup_.forEachGeometryAtCoordinate(this.renderedExtent_,
@@ -103,7 +104,7 @@ ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtPixel =
function(geometry, data) {
var feature = /** @type {ol.Feature} */ (data);
goog.asserts.assert(goog.isDef(feature));
return callback.call(opt_obj, feature);
return callback.call(opt_obj, feature, layer);
});
}
};