Implement forEachLayerAtPixel for canvas
This commit is contained in:
@@ -216,6 +216,22 @@ ol.renderer.canvas.Layer.prototype.getTransform = function(frameState) {
|
||||
ol.renderer.canvas.Layer.prototype.prepareFrame = goog.abstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
* @param {goog.vec.Mat4.Number} imageTransformInv The transformation matrix
|
||||
* to convert from a map pixel to a canvas pixel.
|
||||
* @return {ol.Pixel}
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.canvas.Layer.prototype.getPixelFromCoordinates =
|
||||
function(coordinate, imageTransformInv) {
|
||||
var pixelOnMap = this.getMap().getPixelFromCoordinate(coordinate);
|
||||
var pixelOnCanvas = [0, 0];
|
||||
ol.vec.Mat4.multVec2(imageTransformInv, pixelOnMap, pixelOnCanvas);
|
||||
return pixelOnCanvas;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Size} size Size.
|
||||
* @return {boolean} True when the canvas with the current size does not exceed
|
||||
|
||||
Reference in New Issue
Block a user