Avoid modifying coordinate in forEachLayerAtCoordinate

This commit is contained in:
Tim Schaub
2016-12-19 14:00:34 -07:00
parent e2bdbb1dbe
commit 3634b3dd10
+1 -1
View File
@@ -129,7 +129,7 @@ ol.renderer.canvas.IntermediateCanvas.prototype.forEachLayerAtCoordinate = funct
// so that for example also transparent polygons are detected // so that for example also transparent polygons are detected
return ol.renderer.canvas.Layer.prototype.forEachLayerAtCoordinate.apply(this, arguments); return ol.renderer.canvas.Layer.prototype.forEachLayerAtCoordinate.apply(this, arguments);
} else { } else {
var pixel = ol.transform.apply(this.coordinateToCanvasPixelTransform, coordinate); var pixel = ol.transform.apply(this.coordinateToCanvasPixelTransform, coordinate.slice());
ol.coordinate.scale(pixel, frameState.viewState.resolution / this.renderedResolution); ol.coordinate.scale(pixel, frameState.viewState.resolution / this.renderedResolution);
if (!this.hitCanvasContext_) { if (!this.hitCanvasContext_) {