Move raster reprojection error threshold to a common reproj module
This commit is contained in:
@@ -107,7 +107,7 @@ In case you are creating a custom build of OpenLayers and do not need the reproj
|
|||||||
See [Custom builds](custom-builds.html#defines) tutorial on how to do this.
|
See [Custom builds](custom-builds.html#defines) tutorial on how to do this.
|
||||||
|
|
||||||
### Triangulation precision threshold
|
### Triangulation precision threshold
|
||||||
The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD` (0.5 pixel).
|
The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `ERROR_THRESHOLD` (0.5 pixel).
|
||||||
In case a different threshold needs to be defined for different sources, the `reprojectionErrorThreshold` option can be passed when constructing the tile image source.
|
In case a different threshold needs to be defined for different sources, the `reprojectionErrorThreshold` option can be passed when constructing the tile image source.
|
||||||
|
|
||||||
###Limiting visibility of reprojected map by extent
|
###Limiting visibility of reprojected map by extent
|
||||||
|
|||||||
@@ -11,13 +11,6 @@ import webgl from './webgl.js';
|
|||||||
export var ASSUME_TOUCH = false;
|
export var ASSUME_TOUCH = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {number} Default maximum allowed threshold (in pixels) for
|
|
||||||
* reprojection triangulation. Default is `0.5`.
|
|
||||||
*/
|
|
||||||
export var DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD = 0.5;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string} Default WMS version.
|
* @type {string} Default WMS version.
|
||||||
*/
|
*/
|
||||||
@@ -173,7 +166,6 @@ export default {
|
|||||||
inherits: inherits,
|
inherits: inherits,
|
||||||
VERSION: VERSION,
|
VERSION: VERSION,
|
||||||
ASSUME_TOUCH: ASSUME_TOUCH,
|
ASSUME_TOUCH: ASSUME_TOUCH,
|
||||||
DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD: DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD,
|
|
||||||
DEFAULT_WMS_VERSION: DEFAULT_WMS_VERSION,
|
DEFAULT_WMS_VERSION: DEFAULT_WMS_VERSION,
|
||||||
ENABLE_CANVAS: ENABLE_CANVAS,
|
ENABLE_CANVAS: ENABLE_CANVAS,
|
||||||
ENABLE_PROJ4JS: ENABLE_PROJ4JS,
|
ENABLE_PROJ4JS: ENABLE_PROJ4JS,
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/reproj/Image
|
* @module ol/reproj/Image
|
||||||
*/
|
*/
|
||||||
import {DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD, inherits} from '../index.js';
|
import {ERROR_THRESHOLD} from './common.js';
|
||||||
|
import {inherits} from '../index.js';
|
||||||
import _ol_ImageBase_ from '../ImageBase.js';
|
import _ol_ImageBase_ from '../ImageBase.js';
|
||||||
import _ol_ImageState_ from '../ImageState.js';
|
import _ol_ImageState_ from '../ImageState.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
@@ -48,7 +49,7 @@ var _ol_reproj_Image_ = function(sourceProj, targetProj,
|
|||||||
var sourceResolution = _ol_reproj_.calculateSourceResolution(
|
var sourceResolution = _ol_reproj_.calculateSourceResolution(
|
||||||
sourceProj, targetProj, targetCenter, targetResolution);
|
sourceProj, targetProj, targetCenter, targetResolution);
|
||||||
|
|
||||||
var errorThresholdInPixels = DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD;
|
var errorThresholdInPixels = ERROR_THRESHOLD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/reproj/Tile
|
* @module ol/reproj/Tile
|
||||||
*/
|
*/
|
||||||
import {DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD, inherits} from '../index.js';
|
import {ERROR_THRESHOLD} from './common.js';
|
||||||
|
import {inherits} from '../index.js';
|
||||||
import _ol_Tile_ from '../Tile.js';
|
import _ol_Tile_ from '../Tile.js';
|
||||||
import _ol_TileState_ from '../TileState.js';
|
import _ol_TileState_ from '../TileState.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
@@ -136,7 +137,7 @@ var _ol_reproj_Tile_ = function(sourceProj, sourceTileGrid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
var errorThresholdInPixels = opt_errorThreshold !== undefined ?
|
var errorThresholdInPixels = opt_errorThreshold !== undefined ?
|
||||||
opt_errorThreshold : DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD;
|
opt_errorThreshold : ERROR_THRESHOLD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/**
|
||||||
|
* @type {number} Default maximum allowed threshold (in pixels) for
|
||||||
|
* reprojection triangulation.
|
||||||
|
*/
|
||||||
|
export var ERROR_THRESHOLD = 0.5;
|
||||||
Reference in New Issue
Block a user