Snap view center to pixel
@@ -1139,11 +1139,15 @@ ol.PluggableMap.prototype.renderFrame_ = function(time) {
|
|||||||
layerStates[ol.getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
|
layerStates[ol.getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
|
||||||
}
|
}
|
||||||
viewState = view.getState();
|
viewState = view.getState();
|
||||||
|
var center = viewState.center;
|
||||||
|
var pixelResolution = viewState.resolution / this.pixelRatio_;
|
||||||
|
center[0] = Math.round(center[0] / pixelResolution) * pixelResolution;
|
||||||
|
center[1] = Math.round(center[1] / pixelResolution) * pixelResolution;
|
||||||
frameState = /** @type {olx.FrameState} */ ({
|
frameState = /** @type {olx.FrameState} */ ({
|
||||||
animate: false,
|
animate: false,
|
||||||
coordinateToPixelTransform: this.coordinateToPixelTransform_,
|
coordinateToPixelTransform: this.coordinateToPixelTransform_,
|
||||||
extent: extent,
|
extent: extent,
|
||||||
focus: !this.focus_ ? viewState.center : this.focus_,
|
focus: !this.focus_ ? center : this.focus_,
|
||||||
index: this.frameIndex_++,
|
index: this.frameIndex_++,
|
||||||
layerStates: layerStates,
|
layerStates: layerStates,
|
||||||
layerStatesArray: layerStatesArray,
|
layerStatesArray: layerStatesArray,
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |