Allow subpixel center on view

This commit is contained in:
Andreas Hocevar
2016-07-14 23:51:00 +02:00
parent 878ca6471d
commit 51e84e10f2
3 changed files with 1 additions and 5 deletions

View File

@@ -439,11 +439,7 @@ ol.View.prototype.getState = function() {
var resolution = /** @type {number} */ (this.getResolution());
var rotation = this.getRotation();
return /** @type {olx.ViewState} */ ({
// Snap center to closest pixel
center: [
Math.round(center[0] / resolution) * resolution,
Math.round(center[1] / resolution) * resolution
],
center: center.slice(),
projection: projection !== undefined ? projection : null,
resolution: resolution,
rotation: rotation

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB