Add defines for certain reprojection constants

This commit is contained in:
Petr Sloup
2015-07-13 17:24:54 +02:00
parent f481070f82
commit be6bf00d74
4 changed files with 54 additions and 18 deletions
+40
View File
@@ -28,6 +28,13 @@ ol.DEFAULT_MAX_ZOOM = 42;
ol.DEFAULT_MIN_ZOOM = 0;
/**
* @define {number} Default maximum allowed threshold (in pixels) for
* reprojection triangulation. Default is `0.5`.
*/
ol.DEFAULT_RASTER_REPROJ_ERROR_THRESHOLD = 0.5;
/**
* @define {number} Default high water mark.
*/
@@ -166,6 +173,39 @@ ol.OVERVIEWMAP_MAX_RATIO = 0.75;
ol.OVERVIEWMAP_MIN_RATIO = 0.1;
/**
* @define {number} Maximum number of source tiles for raster reprojection.
* If too many source tiles are determined to be loaded to create a single
* reprojected tile the browser can become unresponsive or even crash.
* This can happen if the developer defines projections improperly and/or
* with unlimited extents.
* If too many tiles are required, no tiles are loaded and
* `ol.TileState.ERROR` state is set. Default is `100`.
*/
ol.RASTER_REPROJ_MAX_SOURCE_TILES = 100;
/**
* @define {number} Maximum number of subdivision steps during raster
* reprojection triangulation. Prevents high memory usage and large
* number of proj4 calls when for certain transformations and areas.
* At most `2*(4^this)` triangles are created. Default is `5`.
*/
ol.RASTER_REPROJ_MAX_SUBDIVISION = 5;
/**
* @define {number} Maximum allowed size of triangle relative to world width.
* When transforming corners of world extent between certain projections,
* The resulting triangulation seems to have zero error and no subdivision
* is performed.
* If the triangle width is more than this (relative to world width; 0-1),
* subdivison is forced (respecting `ol.RASTER_REPROJ_MAX_SUBDIVISION`).
* Default is `0.25`.
*/
ol.RASTER_REPROJ_MAX_TRIANGLE_WIDTH = 0.25;
/**
* @define {number} Tolerance for geometry simplification in device pixels.
*/