ol 10.2.2-dev.1730888074380 → 10.2.2-dev.1730916385053
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ol.d.ts +10 -0
- package/dist/ol.d.ts.map +1 -1
- package/dist/ol.js +1 -1
- package/dist/ol.js.map +1 -1
- package/geom/Geometry.js +5 -5
- package/layer/BaseVector.d.ts +4 -0
- package/layer/BaseVector.d.ts.map +1 -1
- package/layer/BaseVector.js +5 -0
- package/layer/Vector.d.ts +4 -12
- package/layer/Vector.d.ts.map +1 -1
- package/layer/Vector.js +2 -7
- package/layer/VectorImage.d.ts +8 -8
- package/layer/VectorImage.d.ts.map +1 -1
- package/layer/VectorImage.js +5 -5
- package/math.d.ts +8 -0
- package/math.d.ts.map +1 -1
- package/math.js +15 -0
- package/package.json +1 -1
- package/proj/Projection.d.ts +21 -19
- package/proj/Projection.d.ts.map +1 -1
- package/proj/Projection.js +21 -19
- package/proj/proj4.js +6 -6
- package/proj/projections.d.ts +2 -2
- package/proj/projections.d.ts.map +1 -1
- package/proj/projections.js +1 -1
- package/proj/transforms.d.ts +2 -2
- package/proj/transforms.d.ts.map +1 -1
- package/proj/transforms.js +3 -4
- package/proj/utm.d.ts +26 -0
- package/proj/utm.d.ts.map +1 -0
- package/proj/utm.js +292 -0
- package/proj.d.ts +17 -5
- package/proj.d.ts.map +1 -1
- package/proj.js +120 -16
- package/util.js +1 -1
package/geom/Geometry.js
CHANGED
|
@@ -330,11 +330,11 @@ class Geometry extends BaseObject {
|
|
|
330
330
|
tmpTransform,
|
|
331
331
|
outCoordinates,
|
|
332
332
|
);
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
transformed,
|
|
336
|
-
|
|
337
|
-
|
|
333
|
+
const projTransform = getTransform(sourceProj, destination);
|
|
334
|
+
if (projTransform) {
|
|
335
|
+
return projTransform(transformed, transformed, stride);
|
|
336
|
+
}
|
|
337
|
+
return transformed;
|
|
338
338
|
}
|
|
339
339
|
: getTransform(sourceProj, destination);
|
|
340
340
|
this.applyTransform(transformFn);
|
package/layer/BaseVector.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default BaseVectorLayer;
|
|
2
|
+
/**
|
|
3
|
+
* *
|
|
4
|
+
*/
|
|
5
|
+
export type ExtractedFeatureType<T> = T extends import("../source/Vector.js").default<infer U extends import("../Feature.js").FeatureLike> ? U : never;
|
|
2
6
|
export type Options<FeatureType extends import("../Feature").FeatureLike, VectorSourceType extends import("../source/Vector.js").default<FeatureType> | import("../source/VectorTile.js").default<FeatureType>> = {
|
|
3
7
|
/**
|
|
4
8
|
* A CSS class name to set to the layer element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseVector.d.ts","sourceRoot":"","sources":["BaseVector.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"BaseVector.d.ts","sourceRoot":"","sources":["BaseVector.js"],"names":[],"mappings":";;;;iCAea,CAAC,IACD,CAAC,SAAS,OAAO,qBAAqB,EAAE,OAAO,CAAC,MAAM,CAA6C,SAAnC,OAAO,eAAe,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK;oBAI7E,WAAW,SAA9C,OAAQ,YAAY,EAAE,WAAY,EAC0E,gBAAgB,SAA3H,OAAO,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAC,GAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,WAAW,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDxH;;;;;;;;;;;;GAYG;AACH,8BANgD,WAAW,SAA9C,OAAQ,YAAY,EAAE,WAAY,EAC0E,gBAAgB,SAA3H,OAAO,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAC,GAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,WAAW,CAAE,EAE+G,YAAY,SAArO,OAAO,mCAAmC,EAAE,OAAO,GAAC,OAAO,uCAAuC,EAAE,OAAO,GAAC,OAAO,wCAAwC,EAAE,OAAO,GAAC,OAAO,kCAAkC,EAAE,OAAQ;IAIpO;;OAEG;IACH,0EAyDC;IA9CC;;;OAGG;IACH,mBAA2E;IAE3E;;;OAGG;IACH,sBACiE;IAEjE;;;;OAIG;IACH,eAAkB;IAElB;;;;OAIG;IACH,uBAA+B;IAI/B;;;OAGG;IACH,8BAGW;IAEX;;;OAGG;IACH,gCAGW;IA8Bb;;OAEG;IACH,mBAFY,MAAM,GAAC,SAAS,CAI3B;IAED;;;OAGG;IACH,kBAHY,CAAS,IAA+B,EAA/B,OAAO,eAAe,EAAE,OAAO,EAAE,IAA+B,EAA/B,OAAO,eAAe,EAAE,OAAO,KAAG,MAAM,GAAC,IAAI,GAAC,SAAS,CAO5G;IAED;;;;;OAKG;IACH,YAHY,OAAO,mBAAmB,EAAE,SAAS,GAAC,OAAO,kBAAkB,EAAE,aAAa,GAAC,IAAI,GAAC,SAAS,CAKxG;IAED;;;;OAIG;IACH,oBAHY,OAAO,mBAAmB,EAAE,aAAa,GAAC,SAAS,CAK9D;IAED;;;OAGG;IACH,2BAHY,OAAO,CAKlB;IAED;;;OAGG;IACH,6BAHY,OAAO,CAKlB;IAgBD;;;OAGG;IACH,4BAHW,OAAO,cAAc,EAAE,aAAa,GAAC,IAAI,GAAC,SAAS,QAK7D;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,4HAMC;CACF;kBAxRiB,YAAY"}
|
package/layer/BaseVector.js
CHANGED
|
@@ -12,6 +12,11 @@ import {
|
|
|
12
12
|
rulesToStyleFunction,
|
|
13
13
|
} from '../render/canvas/style.js';
|
|
14
14
|
|
|
15
|
+
/***
|
|
16
|
+
* @template T
|
|
17
|
+
* @typedef {T extends import("../source/Vector.js").default<infer U extends import("../Feature.js").FeatureLike> ? U : never} ExtractedFeatureType
|
|
18
|
+
*/
|
|
19
|
+
|
|
15
20
|
/**
|
|
16
21
|
* @template {import('../Feature').FeatureLike} FeatureType
|
|
17
22
|
* @template {import("../source/Vector.js").default<FeatureType>|import("../source/VectorTile.js").default<FeatureType>} VectorSourceType<FeatureType>
|
package/layer/Vector.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export default VectorLayer;
|
|
2
|
-
|
|
3
|
-
* *
|
|
4
|
-
*/
|
|
5
|
-
export type ExtractedFeatureType<T> = T extends import("../source/Vector.js").default<infer U extends import("../Feature.js").FeatureLike> ? U : never;
|
|
6
|
-
export type Options<VectorSourceType extends import("../source/Vector.js").default<FeatureType> = import("../source/Vector.js").default<any>, FeatureType extends import("../Feature.js").FeatureLike = ExtractedFeatureType<VectorSourceType>> = {
|
|
2
|
+
export type Options<VectorSourceType extends import("../source/Vector.js").default<FeatureType> = import("../source/Vector.js").default<any>, FeatureType extends import("../Feature.js").FeatureLike = import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>> = {
|
|
7
3
|
/**
|
|
8
4
|
* A CSS class name to set to the layer element.
|
|
9
5
|
*/
|
|
@@ -109,13 +105,9 @@ export type Options<VectorSourceType extends import("../source/Vector.js").defau
|
|
|
109
105
|
[x: string]: any;
|
|
110
106
|
} | undefined;
|
|
111
107
|
};
|
|
112
|
-
/***
|
|
113
|
-
* @template T
|
|
114
|
-
* @typedef {T extends import("../source/Vector.js").default<infer U extends import("../Feature.js").FeatureLike> ? U : never} ExtractedFeatureType
|
|
115
|
-
*/
|
|
116
108
|
/**
|
|
117
109
|
* @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
|
|
118
|
-
* @template {import('../Feature.js').FeatureLike} [FeatureType=ExtractedFeatureType<VectorSourceType>]
|
|
110
|
+
* @template {import('../Feature.js').FeatureLike} [FeatureType=import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>]
|
|
119
111
|
* @typedef {Object} Options
|
|
120
112
|
* @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
|
|
121
113
|
* @property {number} [opacity=1] Opacity (0, 1).
|
|
@@ -175,11 +167,11 @@ export type Options<VectorSourceType extends import("../source/Vector.js").defau
|
|
|
175
167
|
* options means that `title` is observable, and has get/set accessors.
|
|
176
168
|
*
|
|
177
169
|
* @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
|
|
178
|
-
* @template {import('../Feature.js').FeatureLike} [FeatureType=ExtractedFeatureType<VectorSourceType>]
|
|
170
|
+
* @template {import('../Feature.js').FeatureLike} [FeatureType=import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>]
|
|
179
171
|
* @extends {BaseVectorLayer<FeatureType, VectorSourceType, CanvasVectorLayerRenderer>}
|
|
180
172
|
* @api
|
|
181
173
|
*/
|
|
182
|
-
declare class VectorLayer<VectorSourceType extends import("../source/Vector.js").default<FeatureType> = import("../source/Vector.js").default<any>, FeatureType extends import("../Feature.js").FeatureLike = ExtractedFeatureType<VectorSourceType>> extends BaseVectorLayer<FeatureType, VectorSourceType, CanvasVectorLayerRenderer> {
|
|
174
|
+
declare class VectorLayer<VectorSourceType extends import("../source/Vector.js").default<FeatureType> = import("../source/Vector.js").default<any>, FeatureType extends import("../Feature.js").FeatureLike = import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>> extends BaseVectorLayer<FeatureType, VectorSourceType, CanvasVectorLayerRenderer> {
|
|
183
175
|
/**
|
|
184
176
|
* @param {Options<VectorSourceType, FeatureType>} [options] Options.
|
|
185
177
|
*/
|
package/layer/Vector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vector.d.ts","sourceRoot":"","sources":["Vector.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Vector.d.ts","sourceRoot":"","sources":["Vector.js"],"names":[],"mappings":";oBAOmE,gBAAgB,SAAtE,OAAQ,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAE,+CACb,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAFlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,0BALmE,gBAAgB,SAAtE,OAAQ,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAE,+CACb,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;IAKhD;;OAEG;IACH,0EAEC;CAQF;sCAnFqC,mCAAmC;4BAD7C,iBAAiB"}
|
package/layer/Vector.js
CHANGED
|
@@ -4,14 +4,9 @@
|
|
|
4
4
|
import BaseVectorLayer from './BaseVector.js';
|
|
5
5
|
import CanvasVectorLayerRenderer from '../renderer/canvas/VectorLayer.js';
|
|
6
6
|
|
|
7
|
-
/***
|
|
8
|
-
* @template T
|
|
9
|
-
* @typedef {T extends import("../source/Vector.js").default<infer U extends import("../Feature.js").FeatureLike> ? U : never} ExtractedFeatureType
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
7
|
/**
|
|
13
8
|
* @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
|
|
14
|
-
* @template {import('../Feature.js').FeatureLike} [FeatureType=ExtractedFeatureType<VectorSourceType>]
|
|
9
|
+
* @template {import('../Feature.js').FeatureLike} [FeatureType=import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>]
|
|
15
10
|
* @typedef {Object} Options
|
|
16
11
|
* @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
|
|
17
12
|
* @property {number} [opacity=1] Opacity (0, 1).
|
|
@@ -72,7 +67,7 @@ import CanvasVectorLayerRenderer from '../renderer/canvas/VectorLayer.js';
|
|
|
72
67
|
* options means that `title` is observable, and has get/set accessors.
|
|
73
68
|
*
|
|
74
69
|
* @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
|
|
75
|
-
* @template {import('../Feature.js').FeatureLike} [FeatureType=ExtractedFeatureType<VectorSourceType>]
|
|
70
|
+
* @template {import('../Feature.js').FeatureLike} [FeatureType=import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>]
|
|
76
71
|
* @extends {BaseVectorLayer<FeatureType, VectorSourceType, CanvasVectorLayerRenderer>}
|
|
77
72
|
* @api
|
|
78
73
|
*/
|
package/layer/VectorImage.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default VectorImageLayer;
|
|
2
|
-
export type Options<
|
|
2
|
+
export type Options<VectorSourceType extends import("../source/Vector.js").default<FeatureType> = import("../source/Vector.js").default<any>, FeatureType extends import("../Feature.js").FeatureLike = import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>> = {
|
|
3
3
|
/**
|
|
4
4
|
* A CSS class name to set to the layer element.
|
|
5
5
|
*/
|
|
@@ -99,8 +99,8 @@ export type Options<FeatureType extends import("../Feature.js").FeatureLike = im
|
|
|
99
99
|
} | undefined;
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
|
-
* @template {import("../
|
|
103
|
-
* @template {import(
|
|
102
|
+
* @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
|
|
103
|
+
* @template {import('../Feature.js').FeatureLike} [FeatureType=import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>]
|
|
104
104
|
* @typedef {Object} Options
|
|
105
105
|
* @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
|
|
106
106
|
* @property {number} [opacity=1] Opacity (0, 1).
|
|
@@ -155,16 +155,16 @@ export type Options<FeatureType extends import("../Feature.js").FeatureLike = im
|
|
|
155
155
|
* property on the layer object; for example, setting `title: 'My Title'` in the
|
|
156
156
|
* options means that `title` is observable, and has get/set accessors.
|
|
157
157
|
*
|
|
158
|
-
* @template {import("../
|
|
159
|
-
* @template {import(
|
|
158
|
+
* @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
|
|
159
|
+
* @template {import('../Feature.js').FeatureLike} [FeatureType=import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>]
|
|
160
160
|
* @extends {BaseVectorLayer<FeatureType, VectorSourceType, CanvasVectorImageLayerRenderer>}
|
|
161
161
|
* @api
|
|
162
162
|
*/
|
|
163
|
-
declare class VectorImageLayer<
|
|
163
|
+
declare class VectorImageLayer<VectorSourceType extends import("../source/Vector.js").default<FeatureType> = import("../source/Vector.js").default<any>, FeatureType extends import("../Feature.js").FeatureLike = import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>> extends BaseVectorLayer<FeatureType, VectorSourceType, CanvasVectorImageLayerRenderer> {
|
|
164
164
|
/**
|
|
165
|
-
* @param {Options<
|
|
165
|
+
* @param {Options<VectorSourceType, FeatureType>} [options] Options.
|
|
166
166
|
*/
|
|
167
|
-
constructor(options?: Options<
|
|
167
|
+
constructor(options?: Options<VectorSourceType, FeatureType> | undefined);
|
|
168
168
|
/**
|
|
169
169
|
* @type {number}
|
|
170
170
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorImage.d.ts","sourceRoot":"","sources":["VectorImage.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"VectorImage.d.ts","sourceRoot":"","sources":["VectorImage.js"],"names":[],"mappings":";oBAOmE,gBAAgB,SAAtE,OAAQ,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAE,+CACb,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAFlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,+BALmE,gBAAgB,SAAtE,OAAQ,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAE,+CACb,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;IAKhD;;OAEG;IACH,0EAaC;IANC;;;OAGG;IACH,oBAC2D;IAG7D;;OAEG;IACH,iBAFY,MAAM,CAIjB;CAQF;2CAjG0C,wCAAwC;4BADvD,iBAAiB"}
|
package/layer/VectorImage.js
CHANGED
|
@@ -5,8 +5,8 @@ import BaseVectorLayer from './BaseVector.js';
|
|
|
5
5
|
import CanvasVectorImageLayerRenderer from '../renderer/canvas/VectorImageLayer.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @template {import("../
|
|
9
|
-
* @template {import(
|
|
8
|
+
* @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
|
|
9
|
+
* @template {import('../Feature.js').FeatureLike} [FeatureType=import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>]
|
|
10
10
|
* @typedef {Object} Options
|
|
11
11
|
* @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
|
|
12
12
|
* @property {number} [opacity=1] Opacity (0, 1).
|
|
@@ -62,14 +62,14 @@ import CanvasVectorImageLayerRenderer from '../renderer/canvas/VectorImageLayer.
|
|
|
62
62
|
* property on the layer object; for example, setting `title: 'My Title'` in the
|
|
63
63
|
* options means that `title` is observable, and has get/set accessors.
|
|
64
64
|
*
|
|
65
|
-
* @template {import("../
|
|
66
|
-
* @template {import(
|
|
65
|
+
* @template {import("../source/Vector.js").default<FeatureType>} [VectorSourceType=import("../source/Vector.js").default<*>]
|
|
66
|
+
* @template {import('../Feature.js').FeatureLike} [FeatureType=import("./BaseVector.js").ExtractedFeatureType<VectorSourceType>]
|
|
67
67
|
* @extends {BaseVectorLayer<FeatureType, VectorSourceType, CanvasVectorImageLayerRenderer>}
|
|
68
68
|
* @api
|
|
69
69
|
*/
|
|
70
70
|
class VectorImageLayer extends BaseVectorLayer {
|
|
71
71
|
/**
|
|
72
|
-
* @param {Options<
|
|
72
|
+
* @param {Options<VectorSourceType, FeatureType>} [options] Options.
|
|
73
73
|
*/
|
|
74
74
|
constructor(options) {
|
|
75
75
|
options = options ? options : {};
|
package/math.d.ts
CHANGED
|
@@ -101,4 +101,12 @@ export function floor(n: number, decimals: number): number;
|
|
|
101
101
|
* @return {number} The next bigger integer.
|
|
102
102
|
*/
|
|
103
103
|
export function ceil(n: number, decimals: number): number;
|
|
104
|
+
/**
|
|
105
|
+
* Wraps a number between some minimum and maximum values.
|
|
106
|
+
* @param {number} n The number to wrap.
|
|
107
|
+
* @param {number} min The minimum of the range (inclusive).
|
|
108
|
+
* @param {number} max The maximum of the range (exclusive).
|
|
109
|
+
* @return {number} The wrapped number.
|
|
110
|
+
*/
|
|
111
|
+
export function wrap(n: number, min: number, max: number): number;
|
|
104
112
|
//# sourceMappingURL=math.d.ts.map
|
package/math.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["math.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AACH,6BANW,MAAM,OACN,MAAM,OACN,MAAM,GACL,MAAM,CAKjB;AAED;;;;;;;;;;GAUG;AACH,0CARW,MAAM,KACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,MAAM,CAgBjB;AAED;;;;;;;GAOG;AACH,oCANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,MAAM,CAMjB;AAED;;;;;;GAMG;AACH,uCAJW,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAEnB,KAAK,CAAC,MAAM,CAAC,GAAC,IAAI,CAgD7B;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,0BAJW,MAAM,KACN,MAAM,GACL,MAAM,CAKjB;AAED;;;;;;;GAOG;AACH,wBALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,2BAJW,MAAM,YACN,MAAM,GACL,MAAM,CAKjB;AAED;;;;;;GAMG;AACH,yBAJW,MAAM,YACN,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,yBAJW,MAAM,YACN,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,wBAJW,MAAM,YACN,MAAM,GACL,MAAM,CAIjB"}
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["math.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AACH,6BANW,MAAM,OACN,MAAM,OACN,MAAM,GACL,MAAM,CAKjB;AAED;;;;;;;;;;GAUG;AACH,0CARW,MAAM,KACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,MAAM,CAgBjB;AAED;;;;;;;GAOG;AACH,oCANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,MAAM,CAMjB;AAED;;;;;;GAMG;AACH,uCAJW,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAEnB,KAAK,CAAC,MAAM,CAAC,GAAC,IAAI,CAgD7B;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,0BAJW,MAAM,KACN,MAAM,GACL,MAAM,CAKjB;AAED;;;;;;;GAOG;AACH,wBALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,2BAJW,MAAM,YACN,MAAM,GACL,MAAM,CAKjB;AAED;;;;;;GAMG;AACH,yBAJW,MAAM,YACN,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,yBAJW,MAAM,YACN,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,wBAJW,MAAM,YACN,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,wBALW,MAAM,OACN,MAAM,OACN,MAAM,GACL,MAAM,CAQjB"}
|
package/math.js
CHANGED
|
@@ -197,3 +197,18 @@ export function floor(n, decimals) {
|
|
|
197
197
|
export function ceil(n, decimals) {
|
|
198
198
|
return Math.ceil(toFixed(n, decimals));
|
|
199
199
|
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Wraps a number between some minimum and maximum values.
|
|
203
|
+
* @param {number} n The number to wrap.
|
|
204
|
+
* @param {number} min The minimum of the range (inclusive).
|
|
205
|
+
* @param {number} max The maximum of the range (exclusive).
|
|
206
|
+
* @return {number} The wrapped number.
|
|
207
|
+
*/
|
|
208
|
+
export function wrap(n, min, max) {
|
|
209
|
+
if (n >= min && n < max) {
|
|
210
|
+
return n;
|
|
211
|
+
}
|
|
212
|
+
const range = max - min;
|
|
213
|
+
return ((((n - min) % range) + range) % range) + min;
|
|
214
|
+
}
|
package/package.json
CHANGED
package/proj/Projection.d.ts
CHANGED
|
@@ -58,28 +58,30 @@ export type Options = {
|
|
|
58
58
|
*/
|
|
59
59
|
/**
|
|
60
60
|
* @classdesc
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* code will suffice.
|
|
61
|
+
* In most cases, you should not need to create instances of this class.
|
|
62
|
+
* Instead, where projection information is required, you can use a string
|
|
63
|
+
* projection code or identifier (e.g. `EPSG:4326`) instead of a projection
|
|
64
|
+
* instance.
|
|
66
65
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
66
|
+
* The library includes support for transforming coordinates between the following
|
|
67
|
+
* projections:
|
|
69
68
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
69
|
+
* * WGS 84 / Geographic - Using codes `EPSG:4326`, `CRS:84`, `urn:ogc:def:crs:EPSG:6.6:4326`,
|
|
70
|
+
* `urn:ogc:def:crs:OGC:1.3:CRS84`, `urn:ogc:def:crs:OGC:2:84`, `http://www.opengis.net/gml/srs/epsg.xml#4326`,
|
|
71
|
+
* or `urn:x-ogc:def:crs:EPSG:4326`
|
|
72
|
+
* * WGS 84 / Spherical Mercator - Using codes `EPSG:3857`, `EPSG:102100`, `EPSG:102113`, `EPSG:900913`,
|
|
73
|
+
* `urn:ogc:def:crs:EPSG:6.18:3:3857`, or `http://www.opengis.net/gml/srs/epsg.xml#3857`
|
|
74
|
+
* * WGS 84 / UTM zones - Using codes `EPSG:32601` through `EPSG:32660` for northern zones
|
|
75
|
+
* and `EPSG:32701` through `EPSG:32760` for southern zones. Note that the built-in UTM transforms
|
|
76
|
+
* are lower accuracy (with errors on the order of 0.1 m) than those that you might get in a
|
|
77
|
+
* library like [proj4js](https://github.com/proj4js/proj4js).
|
|
79
78
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
79
|
+
* For additional projection support, or to use higher accuracy transforms than the built-in ones, you can use
|
|
80
|
+
* the [proj4js](https://github.com/proj4js/proj4js) library. With `proj4js`, after adding any new projection
|
|
81
|
+
* definitions, call the {@link module:ol/proj/proj4.register} function.
|
|
82
|
+
*
|
|
83
|
+
* You can use the {@link module:ol/proj.get} function to retrieve a projection instance
|
|
84
|
+
* for one of the registered projections.
|
|
83
85
|
*
|
|
84
86
|
* @api
|
|
85
87
|
*/
|
package/proj/Projection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Projection.d.ts","sourceRoot":"","sources":["Projection.js"],"names":[],"mappings":";;;;;UAOc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAUG,MAAM,QAAE,OAAO,kBAAkB,EAAE,UAAU,KAAE,MAAM;;AAZ5E;;;;;;;;;;;;;;;;;GAiBG;AAEH
|
|
1
|
+
{"version":3,"file":"Projection.d.ts","sourceRoot":"","sources":["Projection.js"],"names":[],"mappings":";;;;;UAOc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAUG,MAAM,QAAE,OAAO,kBAAkB,EAAE,UAAU,KAAE,MAAM;;AAZ5E;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAyEjB;IAtEC;;;OAGG;IACH,cAAyB;IAEzB;;;;;;OAMG;IACH,eAAuE;IAEvE;;;;;;OAMG;IACH,gBAAmE;IAEnE;;;;;;OAMG;IACH,qBACgE;IAEhE;;;OAGG;IACH,yBACyE;IAEzE;;;OAGG;IACH,gBAAoE;IAEpE;;;OAGG;IACH,kBAAiD;IAEjD;;;OAGG;IACH,gCAAyD;IAEzD;;;OAGG;IACH,yBAA4B;IAE5B;;;OAGG;IACH,uBAA2C;IAG7C;;OAEG;IACH,YAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH,WAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,aAHY,OAAO,cAAc,EAAE,MAAM,CAKxC;IAED;;;;OAIG;IACH,YAHY,OAAO,YAAY,EAAE,KAAK,CAKrC;IAED;;;;;;OAMG;IACH,oBAHY,MAAM,GAAC,SAAS,CAK3B;IAED;;;;OAIG;IACH,kBAHY,OAAO,cAAc,EAAE,MAAM,CAKxC;IAED;;;;;;;;;;OAUG;IACH,sBAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,YAHY,OAAO,CAKlB;IAED;;;;OAIG;IACH,kBAHW,OAAO,QAMjB;IAED;;OAEG;IACH,sBAFY,OAAO,yBAAyB,EAAE,OAAO,CAIpD;IAED;;OAEG;IACH,6BAFW,OAAO,yBAAyB,EAAE,OAAO,QAInD;IAED;;;;OAIG;IACH,kBAHW,OAAO,cAAc,EAAE,MAAM,QAMvC;IAED;;;;;OAKG;IACH,4BAJW,OAAO,cAAc,EAAE,MAAM,QAMvC;IAED;;;;;OAKG;IACH,4BAHW,CAAS,IAAM,EAAN,MAAM,EAAE,IAAqC,EAArC,OAAO,kBAAkB,EAAE,UAAU,KAAE,MAAM,QAKxE;IAED;;;;OAIG;IACH,0BAHY,CAAS,IAAM,EAAN,MAAM,EAAE,IAAqC,EAArC,OAAO,kBAAkB,EAAE,UAAU,KAAE,MAAM,GAAC,SAAS,CAKnF;CACF"}
|
package/proj/Projection.js
CHANGED
|
@@ -24,28 +24,30 @@ import {METERS_PER_UNIT} from './Units.js';
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @classdesc
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* code will suffice.
|
|
27
|
+
* In most cases, you should not need to create instances of this class.
|
|
28
|
+
* Instead, where projection information is required, you can use a string
|
|
29
|
+
* projection code or identifier (e.g. `EPSG:4326`) instead of a projection
|
|
30
|
+
* instance.
|
|
32
31
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* The library includes support for transforming coordinates between the following
|
|
33
|
+
* projections:
|
|
35
34
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
35
|
+
* * WGS 84 / Geographic - Using codes `EPSG:4326`, `CRS:84`, `urn:ogc:def:crs:EPSG:6.6:4326`,
|
|
36
|
+
* `urn:ogc:def:crs:OGC:1.3:CRS84`, `urn:ogc:def:crs:OGC:2:84`, `http://www.opengis.net/gml/srs/epsg.xml#4326`,
|
|
37
|
+
* or `urn:x-ogc:def:crs:EPSG:4326`
|
|
38
|
+
* * WGS 84 / Spherical Mercator - Using codes `EPSG:3857`, `EPSG:102100`, `EPSG:102113`, `EPSG:900913`,
|
|
39
|
+
* `urn:ogc:def:crs:EPSG:6.18:3:3857`, or `http://www.opengis.net/gml/srs/epsg.xml#3857`
|
|
40
|
+
* * WGS 84 / UTM zones - Using codes `EPSG:32601` through `EPSG:32660` for northern zones
|
|
41
|
+
* and `EPSG:32701` through `EPSG:32760` for southern zones. Note that the built-in UTM transforms
|
|
42
|
+
* are lower accuracy (with errors on the order of 0.1 m) than those that you might get in a
|
|
43
|
+
* library like [proj4js](https://github.com/proj4js/proj4js).
|
|
45
44
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
45
|
+
* For additional projection support, or to use higher accuracy transforms than the built-in ones, you can use
|
|
46
|
+
* the [proj4js](https://github.com/proj4js/proj4js) library. With `proj4js`, after adding any new projection
|
|
47
|
+
* definitions, call the {@link module:ol/proj/proj4.register} function.
|
|
48
|
+
*
|
|
49
|
+
* You can use the {@link module:ol/proj.get} function to retrieve a projection instance
|
|
50
|
+
* for one of the registered projections.
|
|
49
51
|
*
|
|
50
52
|
* @api
|
|
51
53
|
*/
|
package/proj/proj4.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
addEquivalentProjections,
|
|
8
8
|
addProjection,
|
|
9
9
|
createSafeCoordinateTransform,
|
|
10
|
-
get,
|
|
11
10
|
} from '../proj.js';
|
|
11
|
+
import {get as getCachedProjection} from './projections.js';
|
|
12
12
|
import {get as getTransform} from './transforms.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -49,7 +49,7 @@ export function register(proj4) {
|
|
|
49
49
|
let i, j;
|
|
50
50
|
for (i = 0; i < len; ++i) {
|
|
51
51
|
const code = projCodes[i];
|
|
52
|
-
if (!
|
|
52
|
+
if (!getCachedProjection(code)) {
|
|
53
53
|
const def = proj4.defs(code);
|
|
54
54
|
let units = /** @type {import("./Units.js").Units} */ (def.units);
|
|
55
55
|
if (!units && def.projName === 'longlat') {
|
|
@@ -67,10 +67,10 @@ export function register(proj4) {
|
|
|
67
67
|
}
|
|
68
68
|
for (i = 0; i < len; ++i) {
|
|
69
69
|
const code1 = projCodes[i];
|
|
70
|
-
const proj1 =
|
|
70
|
+
const proj1 = getCachedProjection(code1);
|
|
71
71
|
for (j = 0; j < len; ++j) {
|
|
72
72
|
const code2 = projCodes[j];
|
|
73
|
-
const proj2 =
|
|
73
|
+
const proj2 = getCachedProjection(code2);
|
|
74
74
|
if (!getTransform(code1, code2)) {
|
|
75
75
|
if (proj4.defs[code1] === proj4.defs[code2]) {
|
|
76
76
|
addEquivalentProjections([proj1, proj2]);
|
|
@@ -148,13 +148,13 @@ export async function fromEPSGCode(code) {
|
|
|
148
148
|
|
|
149
149
|
const epsgCode = 'EPSG:' + code;
|
|
150
150
|
if (proj4.defs(epsgCode)) {
|
|
151
|
-
return
|
|
151
|
+
return getCachedProjection(epsgCode);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
proj4.defs(epsgCode, await epsgLookup(code));
|
|
155
155
|
register(proj4);
|
|
156
156
|
|
|
157
|
-
return
|
|
157
|
+
return getCachedProjection(epsgCode);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/**
|
package/proj/projections.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export function clear(): void;
|
|
|
5
5
|
/**
|
|
6
6
|
* Get a cached projection by code.
|
|
7
7
|
* @param {string} code The code for the projection.
|
|
8
|
-
* @return {import("./Projection.js").default} The projection (if cached).
|
|
8
|
+
* @return {import("./Projection.js").default|null} The projection (if cached).
|
|
9
9
|
*/
|
|
10
|
-
export function get(code: string): import("./Projection.js").default;
|
|
10
|
+
export function get(code: string): import("./Projection.js").default | null;
|
|
11
11
|
/**
|
|
12
12
|
* Add a projection to the cache.
|
|
13
13
|
* @param {string} code The projection code.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projections.d.ts","sourceRoot":"","sources":["projections.js"],"names":[],"mappings":"AASA;;GAEG;AACH,8BAEC;AAED;;;;GAIG;AACH,0BAHW,MAAM,GACL,OAAO,iBAAiB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"projections.d.ts","sourceRoot":"","sources":["projections.js"],"names":[],"mappings":"AASA;;GAEG;AACH,8BAEC;AAED;;;;GAIG;AACH,0BAHW,MAAM,GACL,OAAO,iBAAiB,EAAE,OAAO,GAAC,IAAI,CAQjD;AAED;;;;GAIG;AACH,0BAHW,MAAM,cACN,OAAO,iBAAiB,EAAE,OAAO,QAI3C"}
|
package/proj/projections.js
CHANGED
|
@@ -17,7 +17,7 @@ export function clear() {
|
|
|
17
17
|
/**
|
|
18
18
|
* Get a cached projection by code.
|
|
19
19
|
* @param {string} code The code for the projection.
|
|
20
|
-
* @return {import("./Projection.js").default} The projection (if cached).
|
|
20
|
+
* @return {import("./Projection.js").default|null} The projection (if cached).
|
|
21
21
|
*/
|
|
22
22
|
export function get(code) {
|
|
23
23
|
return (
|
package/proj/transforms.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export function remove(source: import("./Projection.js").default, destination: i
|
|
|
25
25
|
* Get a transform given a source code and a destination code.
|
|
26
26
|
* @param {string} sourceCode The code for the source projection.
|
|
27
27
|
* @param {string} destinationCode The code for the destination projection.
|
|
28
|
-
* @return {import("../proj.js").TransformFunction|
|
|
28
|
+
* @return {import("../proj.js").TransformFunction|null} The transform function (if found).
|
|
29
29
|
*/
|
|
30
|
-
export function get(sourceCode: string, destinationCode: string): import("../proj.js").TransformFunction |
|
|
30
|
+
export function get(sourceCode: string, destinationCode: string): import("../proj.js").TransformFunction | null;
|
|
31
31
|
//# sourceMappingURL=transforms.d.ts.map
|
package/proj/transforms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["transforms.js"],"names":[],"mappings":"AAWA;;GAEG;AACH,8BAEC;AAED;;;;;;;GAOG;AACH,4BAJW,OAAO,iBAAiB,EAAE,OAAO,eACjC,OAAO,iBAAiB,EAAE,OAAO,eACjC,OAAO,YAAY,EAAE,iBAAiB,QAShD;AAED;;;;;;;;GAQG;AACH,+BAJW,OAAO,iBAAiB,EAAE,OAAO,eACjC,OAAO,iBAAiB,EAAE,OAAO,GAChC,OAAO,YAAY,EAAE,iBAAiB,CAWjD;AAED;;;;;GAKG;AACH,gCAJW,MAAM,mBACN,MAAM,GACL,OAAO,YAAY,EAAE,iBAAiB,GAAC,
|
|
1
|
+
{"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["transforms.js"],"names":[],"mappings":"AAWA;;GAEG;AACH,8BAEC;AAED;;;;;;;GAOG;AACH,4BAJW,OAAO,iBAAiB,EAAE,OAAO,eACjC,OAAO,iBAAiB,EAAE,OAAO,eACjC,OAAO,YAAY,EAAE,iBAAiB,QAShD;AAED;;;;;;;;GAQG;AACH,+BAJW,OAAO,iBAAiB,EAAE,OAAO,eACjC,OAAO,iBAAiB,EAAE,OAAO,GAChC,OAAO,YAAY,EAAE,iBAAiB,CAWjD;AAED;;;;;GAKG;AACH,gCAJW,MAAM,mBACN,MAAM,GACL,OAAO,YAAY,EAAE,iBAAiB,GAAC,IAAI,CAOtD"}
|
package/proj/transforms.js
CHANGED
|
@@ -57,12 +57,11 @@ export function remove(source, destination) {
|
|
|
57
57
|
* Get a transform given a source code and a destination code.
|
|
58
58
|
* @param {string} sourceCode The code for the source projection.
|
|
59
59
|
* @param {string} destinationCode The code for the destination projection.
|
|
60
|
-
* @return {import("../proj.js").TransformFunction|
|
|
60
|
+
* @return {import("../proj.js").TransformFunction|null} The transform function (if found).
|
|
61
61
|
*/
|
|
62
62
|
export function get(sourceCode, destinationCode) {
|
|
63
|
-
let transform;
|
|
64
63
|
if (sourceCode in transforms && destinationCode in transforms[sourceCode]) {
|
|
65
|
-
|
|
64
|
+
return transforms[sourceCode][destinationCode];
|
|
66
65
|
}
|
|
67
|
-
return
|
|
66
|
+
return null;
|
|
68
67
|
}
|
package/proj/utm.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {string} code The projection code.
|
|
3
|
+
* @return {UTMZone|null} The UTM zone info (or null if not UTM).
|
|
4
|
+
*/
|
|
5
|
+
export function zoneFromCode(code: string): UTMZone | null;
|
|
6
|
+
/**
|
|
7
|
+
* @param {string} code The projection code.
|
|
8
|
+
* @return {import('./Projection.js').default|null} A projection or null if unable to create one.
|
|
9
|
+
*/
|
|
10
|
+
export function makeProjection(code: string): import("./Projection.js").default | null;
|
|
11
|
+
/**
|
|
12
|
+
* @param {import('./Projection.js').default} projection The projection.
|
|
13
|
+
* @return {import('../proj.js').Transforms|null} The transforms lookup or null if unable to handle projection.
|
|
14
|
+
*/
|
|
15
|
+
export function makeTransforms(projection: import("./Projection.js").default): import("../proj.js").Transforms | null;
|
|
16
|
+
export type UTMZone = {
|
|
17
|
+
/**
|
|
18
|
+
* The zone number (1 - 60).
|
|
19
|
+
*/
|
|
20
|
+
number: number;
|
|
21
|
+
/**
|
|
22
|
+
* The northern hemisphere.
|
|
23
|
+
*/
|
|
24
|
+
north: boolean;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=utm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utm.d.ts","sourceRoot":"","sources":["utm.js"],"names":[],"mappings":"AA6MA;;;GAGG;AACH,mCAHW,MAAM,GACL,OAAO,GAAC,IAAI,CA4BvB;AA8BD;;;GAGG;AACH,qCAHW,MAAM,GACL,OAAO,iBAAiB,EAAE,OAAO,GAAC,IAAI,CAQjD;AAED;;;GAGG;AACH,2CAHW,OAAO,iBAAiB,EAAE,OAAO,GAChC,OAAO,YAAY,EAAE,UAAU,GAAC,IAAI,CAY/C;;;;;YAhRa,MAAM;;;;WACN,OAAO"}
|