Add ol.renderer.canvas.ImageLayer#forEachFeatureAtPixel

This commit is contained in:
Éric Lemoine
2014-01-13 11:49:40 +01:00
parent 849e50517c
commit ee17babc05

View File

@@ -41,6 +41,27 @@ ol.renderer.canvas.ImageLayer = function(mapRenderer, imageLayer) {
goog.inherits(ol.renderer.canvas.ImageLayer, ol.renderer.canvas.Layer);
/**
* @inheritDoc
*/
ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtPixel =
function(coordinate, frameState, callback, opt_obj) {
var layer = this.getLayer();
var source = layer.getSource();
goog.asserts.assertInstanceof(source, ol.source.Image);
var extent = frameState.extent;
var resolution = frameState.view2DState.resolution;
var rotation = frameState.view2DState.rotation;
return source.forEachFeatureAtPixel(extent, resolution, rotation, coordinate,
/**
* @param {ol.Feature} feature Feature.
*/
function(feature) {
return callback.call(opt_obj, feature, this);
});
};
/**
* @inheritDoc
*/