Implement forEachLayerAtPixel for webgl

This commit is contained in:
tsauerwein
2015-01-23 17:35:07 +01:00
parent 6cc5bd466d
commit dce4210a5b
4 changed files with 219 additions and 0 deletions

View File

@@ -162,6 +162,21 @@ ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtPixel =
};
/**
* @inheritDoc
*/
ol.renderer.webgl.VectorLayer.prototype.forEachLayerAtPixel =
function(coordinate, frameState, callback, thisArg) {
var hasFeature = this.hasFeatureAtPixel(coordinate, frameState);
if (hasFeature) {
return callback.call(thisArg, this.getLayer());
} else {
return undefined;
}
};
/**
* Handle changes in image style state.
* @param {goog.events.Event} event Image style change event.