Add useGeographic() and setUserProjection() to the API
This commit is contained in:
+8
-8
@@ -539,18 +539,17 @@ let userProjection = null;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the projection for coordinates supplied from and returned by API methods.
|
* Set the projection for coordinates supplied from and returned by API methods.
|
||||||
* Note that this method is not yet a part of the stable API. Support for user
|
* This includes all API methods except for those interacting with tile grids.
|
||||||
* projections is not yet complete and should be considered experimental.
|
|
||||||
* @param {ProjectionLike} projection The user projection.
|
* @param {ProjectionLike} projection The user projection.
|
||||||
|
* @api
|
||||||
*/
|
*/
|
||||||
export function setUserProjection(projection) {
|
export function setUserProjection(projection) {
|
||||||
userProjection = get(projection);
|
userProjection = get(projection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the user projection if set. Note that this method is not yet a part of
|
* Clear the user projection if set.
|
||||||
* the stable API. Support for user projections is not yet complete and should
|
* @api
|
||||||
* be considered experimental.
|
|
||||||
*/
|
*/
|
||||||
export function clearUserProjection() {
|
export function clearUserProjection() {
|
||||||
userProjection = null;
|
userProjection = null;
|
||||||
@@ -561,15 +560,16 @@ export function clearUserProjection() {
|
|||||||
* Note that this method is not yet a part of the stable API. Support for user
|
* Note that this method is not yet a part of the stable API. Support for user
|
||||||
* projections is not yet complete and should be considered experimental.
|
* projections is not yet complete and should be considered experimental.
|
||||||
* @return {Projection|null} The user projection (or null if not set).
|
* @return {Projection|null} The user projection (or null if not set).
|
||||||
|
* @api
|
||||||
*/
|
*/
|
||||||
export function getUserProjection() {
|
export function getUserProjection() {
|
||||||
return userProjection;
|
return userProjection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use geographic coordinates (WGS-84 datum) in API methods. Note that this
|
* Use geographic coordinates (WGS-84 datum) in API methods. This includes all API
|
||||||
* method is not yet a part of the stable API. Support for user projections is
|
* methods except for those interacting with tile grids.
|
||||||
* not yet complete and should be considered experimental.
|
* @api
|
||||||
*/
|
*/
|
||||||
export function useGeographic() {
|
export function useGeographic() {
|
||||||
setUserProjection('EPSG:4326');
|
setUserProjection('EPSG:4326');
|
||||||
|
|||||||
Reference in New Issue
Block a user