Warn once when suspicious coordinate are used

This commit is contained in:
Andreas Hocevar
2022-02-14 14:55:58 +01:00
parent 75a3adccce
commit 63fc00902f
3 changed files with 72 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import {DEFAULT_TILE_SIZE} from './tilegrid/common.js';
import {
METERS_PER_UNIT,
createProjection,
disableCoordinateWarning,
fromUserCoordinate,
fromUserExtent,
getUserProjection,
@@ -241,7 +242,7 @@ const DEFAULT_MIN_ZOOM = 0;
* A View has a `projection`. The projection determines the
* coordinate system of the center, and its units determine the units of the
* resolution (projection units per pixel). The default projection is
* Spherical Mercator (EPSG:3857).
* Web Mercator (EPSG:3857).
*
* ### The view states
*
@@ -406,6 +407,9 @@ class View extends BaseObject {
if (options.extent) {
options.extent = fromUserExtent(options.extent, this.projection_);
}
if (options.projection) {
disableCoordinateWarning();
}
this.applyOptions_(options);
}