ol 7.1.1-dev.1663240093930 → 7.1.1-dev.1663346022598
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.js +2 -2
- package/dist/ol.js.map +1 -1
- package/layer/BaseTile.d.ts +3 -3
- package/layer/BaseTile.d.ts.map +1 -1
- package/layer/BaseTile.js +2 -2
- package/layer/Layer.d.ts +14 -3
- package/layer/Layer.d.ts.map +1 -1
- package/layer/Layer.js +26 -2
- package/layer/VectorTile.d.ts +3 -3
- package/layer/VectorTile.d.ts.map +1 -1
- package/layer/VectorTile.js +2 -2
- package/package.json +1 -1
- package/proj/proj4.d.ts +42 -2
- package/proj/proj4.d.ts.map +1 -1
- package/proj/proj4.js +92 -2
- package/util.js +1 -1
package/layer/BaseTile.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export default BaseTileLayer;
|
|
|
2
2
|
/**
|
|
3
3
|
* *
|
|
4
4
|
*/
|
|
5
|
-
export type BaseTileLayerOnSignature<Return> = import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> & import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes |
|
|
5
|
+
export type BaseTileLayerOnSignature<Return> = import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> & import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes | import("./Layer.js").LayerEventType | 'change:preload' | 'change:useInterimTilesOnError', import("../Object").ObjectEvent, Return> & import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> & import("../Observable").CombinedOnSignature<import("../Observable").EventTypes | import("./Base").BaseLayerObjectEventTypes | import("./Layer.js").LayerEventType | 'change:preload' | 'change:useInterimTilesOnError' | import("../render/EventType").LayerRenderEventTypes, Return>;
|
|
6
6
|
export type Options<TileSourceType extends import("../source/Tile.js").default> = {
|
|
7
7
|
/**
|
|
8
8
|
* A CSS class name to set to the layer element.
|
|
@@ -79,10 +79,10 @@ export type Options<TileSourceType extends import("../source/Tile.js").default>
|
|
|
79
79
|
* @template Return
|
|
80
80
|
* @typedef {import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> &
|
|
81
81
|
* import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes|
|
|
82
|
-
*
|
|
82
|
+
* import("./Layer.js").LayerEventType|'change:preload'|'change:useInterimTilesOnError', import("../Object").ObjectEvent, Return> &
|
|
83
83
|
* import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> &
|
|
84
84
|
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("./Base").BaseLayerObjectEventTypes|
|
|
85
|
-
*
|
|
85
|
+
* import("./Layer.js").LayerEventType|'change:preload'|'change:useInterimTilesOnError'|import("../render/EventType").LayerRenderEventTypes, Return>} BaseTileLayerOnSignature
|
|
86
86
|
*/
|
|
87
87
|
/**
|
|
88
88
|
* @template {import("../source/Tile.js").default} TileSourceType
|
package/layer/BaseTile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTile.d.ts","sourceRoot":"","sources":["BaseTile.js"],"names":[],"mappings":";;;;+CAQa,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,GACjI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,QAAQ,EAAE,yBAAyB,GAClF,
|
|
1
|
+
{"version":3,"file":"BaseTile.d.ts","sourceRoot":"","sources":["BaseTile.js"],"names":[],"mappings":";;;;+CAQa,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,GACjI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,QAAQ,EAAE,yBAAyB,GAClF,OAAa,YAAY,EAAE,cAAc,GAAC,gBAAgB,GAAC,+BAA+B,EAAE,OAAO,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,GACpI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,qBAAqB,EAAE,qBAAqB,EAAE,OAAO,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,GACvI,OAAW,eAAe,EAAE,mBAAmB,CAAC,OAAO,eAAe,EAAE,UAAU,GAAC,OAAO,QAAQ,EAAE,yBAAyB,GAC7H,OAAW,YAAY,EAAE,cAAc,GAAC,gBAAgB,GAAC,+BAA+B,GAAC,OAAO,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAPtJ;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;;;;;;;GAYG;AACH;IACE;;OAEG;IACH,2DA8BC;IArBC;;OAEG;IACH,IAFU,yBAAyB,OAAO,WAAW,EAAE,SAAS,CAAC,CAE1D;IAEP;;OAEG;IACH,MAFU,yBAAyB,OAAO,WAAW,EAAE,SAAS,CAAC,CAExD;IAET;;OAEG;IACH,IAFU,yBAAyB,IAAI,CAAC,CAEjC;IAUT;;;;;OAKG;IACH,cAJY,MAAM,CAMjB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,QAMhB;IAED;;;;;OAKG;IACH,6BAJY,OAAO,CAQlB;IAED;;;;;OAKG;IACH,kDAJW,OAAO,QAMjB;CAqBF"}
|
package/layer/BaseTile.js
CHANGED
|
@@ -8,10 +8,10 @@ import TileProperty from './TileProperty.js';
|
|
|
8
8
|
* @template Return
|
|
9
9
|
* @typedef {import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> &
|
|
10
10
|
* import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes|
|
|
11
|
-
*
|
|
11
|
+
* import("./Layer.js").LayerEventType|'change:preload'|'change:useInterimTilesOnError', import("../Object").ObjectEvent, Return> &
|
|
12
12
|
* import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> &
|
|
13
13
|
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("./Base").BaseLayerObjectEventTypes|
|
|
14
|
-
*
|
|
14
|
+
* import("./Layer.js").LayerEventType|'change:preload'|'change:useInterimTilesOnError'|import("../render/EventType").LayerRenderEventTypes, Return>} BaseTileLayerOnSignature
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
/**
|
package/layer/Layer.d.ts
CHANGED
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
export function inView(layerState: State, viewState: import("../View.js").State): boolean;
|
|
9
9
|
export default Layer;
|
|
10
10
|
export type RenderFunction = (arg0: import("../Map.js").FrameState) => HTMLElement;
|
|
11
|
+
export type LayerEventType = 'sourceready' | 'change:source';
|
|
11
12
|
/**
|
|
12
13
|
* *
|
|
13
14
|
*/
|
|
14
|
-
export type LayerOnSignature<Return> = import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> & import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes |
|
|
15
|
+
export type LayerOnSignature<Return> = import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> & import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes | LayerEventType, import("../Object").ObjectEvent, Return> & import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> & import("../Observable").CombinedOnSignature<import("../Observable").EventTypes | import("./Base").BaseLayerObjectEventTypes | LayerEventType | import("../render/EventType").LayerRenderEventTypes, Return>;
|
|
15
16
|
export type Options<SourceType extends import("../source/Source.js").default = import("../source/Source.js").default> = {
|
|
16
17
|
/**
|
|
17
18
|
* A CSS class name to set to the layer element.
|
|
@@ -124,13 +125,16 @@ export type State = {
|
|
|
124
125
|
/**
|
|
125
126
|
* @typedef {function(import("../Map.js").FrameState):HTMLElement} RenderFunction
|
|
126
127
|
*/
|
|
128
|
+
/**
|
|
129
|
+
* @typedef {'sourceready'|'change:source'} LayerEventType
|
|
130
|
+
*/
|
|
127
131
|
/***
|
|
128
132
|
* @template Return
|
|
129
133
|
* @typedef {import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> &
|
|
130
134
|
* import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes|
|
|
131
|
-
*
|
|
135
|
+
* LayerEventType, import("../Object").ObjectEvent, Return> &
|
|
132
136
|
* import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> &
|
|
133
|
-
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("./Base").BaseLayerObjectEventTypes|
|
|
137
|
+
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("./Base").BaseLayerObjectEventTypes|LayerEventType|
|
|
134
138
|
* import("../render/EventType").LayerRenderEventTypes, Return>} LayerOnSignature
|
|
135
139
|
*/
|
|
136
140
|
/**
|
|
@@ -190,9 +194,11 @@ export type State = {
|
|
|
190
194
|
* [layer.setMap()]{@link module:ol/layer/Layer~Layer#setMap} instead.
|
|
191
195
|
*
|
|
192
196
|
* A generic `change` event is fired when the state of the source changes.
|
|
197
|
+
* A `sourceready` event is fired when the layer's source is ready.
|
|
193
198
|
*
|
|
194
199
|
* @fires import("../render/Event.js").RenderEvent#prerender
|
|
195
200
|
* @fires import("../render/Event.js").RenderEvent#postrender
|
|
201
|
+
* @fires import("../events/Event.js").BaseEvent#sourceready
|
|
196
202
|
*
|
|
197
203
|
* @template {import("../source/Source.js").default} [SourceType=import("../source/Source.js").default]
|
|
198
204
|
* @template {import("../renderer/Layer.js").default} [RendererType=import("../renderer/Layer.js").default]
|
|
@@ -235,6 +241,11 @@ declare class Layer<SourceType extends import("../source/Source.js").default = i
|
|
|
235
241
|
* @type {RendererType}
|
|
236
242
|
*/
|
|
237
243
|
private renderer_;
|
|
244
|
+
/**
|
|
245
|
+
* @private
|
|
246
|
+
* @type {boolean}
|
|
247
|
+
*/
|
|
248
|
+
private sourceReady_;
|
|
238
249
|
/**
|
|
239
250
|
* @protected
|
|
240
251
|
* @type {boolean}
|
package/layer/Layer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["Layer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["Layer.js"],"names":[],"mappings":"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"}
|
package/layer/Layer.js
CHANGED
|
@@ -12,13 +12,17 @@ import {listen, unlistenByKey} from '../events.js';
|
|
|
12
12
|
* @typedef {function(import("../Map.js").FrameState):HTMLElement} RenderFunction
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {'sourceready'|'change:source'} LayerEventType
|
|
17
|
+
*/
|
|
18
|
+
|
|
15
19
|
/***
|
|
16
20
|
* @template Return
|
|
17
21
|
* @typedef {import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> &
|
|
18
22
|
* import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes|
|
|
19
|
-
*
|
|
23
|
+
* LayerEventType, import("../Object").ObjectEvent, Return> &
|
|
20
24
|
* import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> &
|
|
21
|
-
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("./Base").BaseLayerObjectEventTypes|
|
|
25
|
+
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("./Base").BaseLayerObjectEventTypes|LayerEventType|
|
|
22
26
|
* import("../render/EventType").LayerRenderEventTypes, Return>} LayerOnSignature
|
|
23
27
|
*/
|
|
24
28
|
|
|
@@ -81,9 +85,11 @@ import {listen, unlistenByKey} from '../events.js';
|
|
|
81
85
|
* [layer.setMap()]{@link module:ol/layer/Layer~Layer#setMap} instead.
|
|
82
86
|
*
|
|
83
87
|
* A generic `change` event is fired when the state of the source changes.
|
|
88
|
+
* A `sourceready` event is fired when the layer's source is ready.
|
|
84
89
|
*
|
|
85
90
|
* @fires import("../render/Event.js").RenderEvent#prerender
|
|
86
91
|
* @fires import("../render/Event.js").RenderEvent#postrender
|
|
92
|
+
* @fires import("../events/Event.js").BaseEvent#sourceready
|
|
87
93
|
*
|
|
88
94
|
* @template {import("../source/Source.js").default} [SourceType=import("../source/Source.js").default]
|
|
89
95
|
* @template {import("../renderer/Layer.js").default} [RendererType=import("../renderer/Layer.js").default]
|
|
@@ -138,6 +144,12 @@ class Layer extends BaseLayer {
|
|
|
138
144
|
*/
|
|
139
145
|
this.renderer_ = null;
|
|
140
146
|
|
|
147
|
+
/**
|
|
148
|
+
* @private
|
|
149
|
+
* @type {boolean}
|
|
150
|
+
*/
|
|
151
|
+
this.sourceReady_ = false;
|
|
152
|
+
|
|
141
153
|
/**
|
|
142
154
|
* @protected
|
|
143
155
|
* @type {boolean}
|
|
@@ -214,6 +226,11 @@ class Layer extends BaseLayer {
|
|
|
214
226
|
*/
|
|
215
227
|
handleSourceChange_() {
|
|
216
228
|
this.changed();
|
|
229
|
+
if (this.sourceReady_ || this.getSource().getState() !== 'ready') {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this.sourceReady_ = true;
|
|
233
|
+
this.dispatchEvent('sourceready');
|
|
217
234
|
}
|
|
218
235
|
|
|
219
236
|
/**
|
|
@@ -224,6 +241,7 @@ class Layer extends BaseLayer {
|
|
|
224
241
|
unlistenByKey(this.sourceChangeKey_);
|
|
225
242
|
this.sourceChangeKey_ = null;
|
|
226
243
|
}
|
|
244
|
+
this.sourceReady_ = false;
|
|
227
245
|
const source = this.getSource();
|
|
228
246
|
if (source) {
|
|
229
247
|
this.sourceChangeKey_ = listen(
|
|
@@ -232,6 +250,12 @@ class Layer extends BaseLayer {
|
|
|
232
250
|
this.handleSourceChange_,
|
|
233
251
|
this
|
|
234
252
|
);
|
|
253
|
+
if (source.getState() === 'ready') {
|
|
254
|
+
this.sourceReady_ = true;
|
|
255
|
+
setTimeout(() => {
|
|
256
|
+
this.dispatchEvent('sourceready');
|
|
257
|
+
}, 0);
|
|
258
|
+
}
|
|
235
259
|
}
|
|
236
260
|
this.changed();
|
|
237
261
|
}
|
package/layer/VectorTile.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export default VectorTileLayer;
|
|
|
2
2
|
/**
|
|
3
3
|
* *
|
|
4
4
|
*/
|
|
5
|
-
export type VectorTileLayerOnSignature<Return> = import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> & import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes |
|
|
5
|
+
export type VectorTileLayerOnSignature<Return> = import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> & import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes | import("./Layer.js").LayerEventType | 'change:preload' | 'change:useInterimTilesOnError', import("../Object").ObjectEvent, Return> & import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> & import("../Observable").CombinedOnSignature<import("../Observable").EventTypes | import("./Base").BaseLayerObjectEventTypes | import("./Layer.js").LayerEventType | 'change:preload' | 'change:useInterimTilesOnError' | import("../render/EventType").LayerRenderEventTypes, Return>;
|
|
6
6
|
export type VectorTileRenderType = 'hybrid' | 'vector';
|
|
7
7
|
export type Options = {
|
|
8
8
|
/**
|
|
@@ -140,10 +140,10 @@ export type Options = {
|
|
|
140
140
|
* @template Return
|
|
141
141
|
* @typedef {import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> &
|
|
142
142
|
* import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes|
|
|
143
|
-
*
|
|
143
|
+
* import("./Layer.js").LayerEventType|'change:preload'|'change:useInterimTilesOnError', import("../Object").ObjectEvent, Return> &
|
|
144
144
|
* import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> &
|
|
145
145
|
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("./Base").BaseLayerObjectEventTypes|
|
|
146
|
-
*
|
|
146
|
+
* import("./Layer.js").LayerEventType|'change:preload'|'change:useInterimTilesOnError'|import("../render/EventType").LayerRenderEventTypes, Return>} VectorTileLayerOnSignature
|
|
147
147
|
*/
|
|
148
148
|
/**
|
|
149
149
|
* @typedef {'hybrid' | 'vector'} VectorTileRenderType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorTile.d.ts","sourceRoot":"","sources":["VectorTile.js"],"names":[],"mappings":";;;;iDAUa,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,GACjI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,QAAQ,EAAE,yBAAyB,GAClF,
|
|
1
|
+
{"version":3,"file":"VectorTile.d.ts","sourceRoot":"","sources":["VectorTile.js"],"names":[],"mappings":";;;;iDAUa,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,GACjI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,QAAQ,EAAE,yBAAyB,GAClF,OAAa,YAAY,EAAE,cAAc,GAAC,gBAAgB,GAAC,+BAA+B,EAAE,OAAO,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,GACpI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,qBAAqB,EAAE,qBAAqB,EAAE,OAAO,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,GACvI,OAAW,eAAe,EAAE,mBAAmB,CAAC,OAAO,eAAe,EAAE,UAAU,GAAC,OAAO,QAAQ,EAAE,yBAAyB,GAC7H,OAAa,YAAY,EAAE,cAAc,GAAC,gBAAgB,GAAC,+BAA+B,GAAC,OAAO,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,CAAC;mCAI3I,QAAQ,GAAG,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAXhC;;;;;;;;GAQG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH;;;;;;;;;;GAUG;AACH;IACE;;OAEG;IACH,2CA0DC;IA7CC;;OAEG;IACH,IAFU,2BAA2B,OAAO,WAAW,EAAE,SAAS,CAAC,CAE5D;IAEP;;OAEG;IACH,MAFU,2BAA2B,OAAO,WAAW,EAAE,SAAS,CAAC,CAE1D;IAET;;OAEG;IACH,IAFU,2BAA2B,IAAI,CAAC,CAEnC;IAMP;;;OAGG;IACH,oBAA6B;IA8C/B;;OAEG;IACH,iBAFY,oBAAoB,CAI/B;IAED;;;;;OAKG;IACH,cAJY,MAAM,CAMjB;IAED;;;;;OAKG;IACH,6BAJY,OAAO,CAQlB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,QAMhB;IAED;;;;;OAKG;IACH,kDAJW,OAAO,QAMjB;CACF"}
|
package/layer/VectorTile.js
CHANGED
|
@@ -10,10 +10,10 @@ import {assert} from '../asserts.js';
|
|
|
10
10
|
* @template Return
|
|
11
11
|
* @typedef {import("../Observable").OnSignature<import("../Observable").EventTypes, import("../events/Event.js").default, Return> &
|
|
12
12
|
* import("../Observable").OnSignature<import("./Base").BaseLayerObjectEventTypes|
|
|
13
|
-
*
|
|
13
|
+
* import("./Layer.js").LayerEventType|'change:preload'|'change:useInterimTilesOnError', import("../Object").ObjectEvent, Return> &
|
|
14
14
|
* import("../Observable").OnSignature<import("../render/EventType").LayerRenderEventTypes, import("../render/Event").default, Return> &
|
|
15
15
|
* import("../Observable").CombinedOnSignature<import("../Observable").EventTypes|import("./Base").BaseLayerObjectEventTypes|
|
|
16
|
-
*
|
|
16
|
+
* import("./Layer.js").LayerEventType|'change:preload'|'change:useInterimTilesOnError'|import("../render/EventType").LayerRenderEventTypes, Return>} VectorTileLayerOnSignature
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
package/package.json
CHANGED
package/proj/proj4.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @return {boolean} Proj4 has been registered.
|
|
3
|
+
*/
|
|
4
|
+
export function isRegistered(): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Unsets the shared proj4 previsouly set with register.
|
|
7
|
+
*/
|
|
8
|
+
export function unregister(): void;
|
|
1
9
|
/**
|
|
2
10
|
* Make projections defined in proj4 (with `proj4.defs()`) available in
|
|
3
11
|
* OpenLayers. Requires proj4 >= 2.8.0.
|
|
@@ -6,8 +14,40 @@
|
|
|
6
14
|
* registry, e.g. after calling `proj4.defs()`. Existing transforms will not be
|
|
7
15
|
* modified by this function.
|
|
8
16
|
*
|
|
9
|
-
* @param {
|
|
17
|
+
* @param {import("proj4")} proj4 Proj4.
|
|
18
|
+
* @api
|
|
19
|
+
*/
|
|
20
|
+
export function register(proj4: typeof import("proj4")): void;
|
|
21
|
+
/**
|
|
22
|
+
* Set the lookup function for getting proj4 definitions given an EPSG code.
|
|
23
|
+
* By default, the {@link module:ol/proj/proj4.fromEPSGCode} function uses the
|
|
24
|
+
* epsg.io website for proj4 definitions. This can be changed by providing a
|
|
25
|
+
* different lookup function.
|
|
26
|
+
*
|
|
27
|
+
* @param {function(number):Promise<string>} func The lookup function.
|
|
28
|
+
* @api
|
|
29
|
+
*/
|
|
30
|
+
export function setEPSGLookup(func: (arg0: number) => Promise<string>): void;
|
|
31
|
+
/**
|
|
32
|
+
* Get the current EPSG lookup function.
|
|
33
|
+
*
|
|
34
|
+
* @return {function(number):Promise<string>} The EPSG lookup function.
|
|
35
|
+
*/
|
|
36
|
+
export function getEPSGLookup(): (arg0: number) => Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a projection from an EPSG code. This function fetches the projection
|
|
39
|
+
* definition from the epsg.io website, registers this definition for use with
|
|
40
|
+
* proj4, and returns a configured projection. You must call import proj4 and
|
|
41
|
+
* call {@link module:ol/proj/proj4.register} before using this function.
|
|
42
|
+
*
|
|
43
|
+
* If the projection definition is already registered with proj4, it will not
|
|
44
|
+
* be fetched again (so it is ok to call this function multiple times with the
|
|
45
|
+
* same code).
|
|
46
|
+
*
|
|
47
|
+
* @param {number|string} code The EPSG code (e.g. 4326 or 'EPSG:4326').
|
|
48
|
+
* @return {Promise<Projection>} The projection.
|
|
10
49
|
* @api
|
|
11
50
|
*/
|
|
12
|
-
export function
|
|
51
|
+
export function fromEPSGCode(code: number | string): Promise<Projection>;
|
|
52
|
+
import Projection from "./Projection.js";
|
|
13
53
|
//# sourceMappingURL=proj4.d.ts.map
|
package/proj/proj4.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proj4.d.ts","sourceRoot":"","sources":["proj4.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proj4.d.ts","sourceRoot":"","sources":["proj4.js"],"names":[],"mappings":"AAkBA;;GAEG;AACH,gCAFY,OAAO,CAIlB;AAED;;GAEG;AACH,mCAEC;AAED;;;;;;;;;;GAUG;AACH,8DA6CC;AAcD;;;;;;;;GAQG;AACH,2CAHoB,MAAM,KAAE,QAAQ,MAAM,CAAC,QAK1C;AAED;;;;GAIG;AACH,wCAFqB,MAAM,KAAE,QAAQ,MAAM,CAAC,CAI3C;AAED;;;;;;;;;;;;;GAaG;AACH,mCAJW,MAAM,GAAC,MAAM,GACZ,QAAQ,UAAU,CAAC,CAsB9B"}
|
package/proj/proj4.js
CHANGED
|
@@ -11,6 +11,25 @@ import {
|
|
|
11
11
|
} from '../proj.js';
|
|
12
12
|
import {get as getTransform} from './transforms.js';
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @type {import("proj4")|null}
|
|
16
|
+
*/
|
|
17
|
+
let registered = null;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @return {boolean} Proj4 has been registered.
|
|
21
|
+
*/
|
|
22
|
+
export function isRegistered() {
|
|
23
|
+
return !!registered;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Unsets the shared proj4 previsouly set with register.
|
|
28
|
+
*/
|
|
29
|
+
export function unregister() {
|
|
30
|
+
registered = null;
|
|
31
|
+
}
|
|
32
|
+
|
|
14
33
|
/**
|
|
15
34
|
* Make projections defined in proj4 (with `proj4.defs()`) available in
|
|
16
35
|
* OpenLayers. Requires proj4 >= 2.8.0.
|
|
@@ -19,10 +38,12 @@ import {get as getTransform} from './transforms.js';
|
|
|
19
38
|
* registry, e.g. after calling `proj4.defs()`. Existing transforms will not be
|
|
20
39
|
* modified by this function.
|
|
21
40
|
*
|
|
22
|
-
* @param {
|
|
41
|
+
* @param {import("proj4")} proj4 Proj4.
|
|
23
42
|
* @api
|
|
24
43
|
*/
|
|
25
44
|
export function register(proj4) {
|
|
45
|
+
registered = proj4;
|
|
46
|
+
|
|
26
47
|
const projCodes = Object.keys(proj4.defs);
|
|
27
48
|
const len = projCodes.length;
|
|
28
49
|
let i, j;
|
|
@@ -30,7 +51,7 @@ export function register(proj4) {
|
|
|
30
51
|
const code = projCodes[i];
|
|
31
52
|
if (!get(code)) {
|
|
32
53
|
const def = proj4.defs(code);
|
|
33
|
-
let units = def.units;
|
|
54
|
+
let units = /** @type {import("./Units.js").Units} */ (def.units);
|
|
34
55
|
if (!units && def.projName === 'longlat') {
|
|
35
56
|
units = 'degrees';
|
|
36
57
|
}
|
|
@@ -66,3 +87,72 @@ export function register(proj4) {
|
|
|
66
87
|
}
|
|
67
88
|
}
|
|
68
89
|
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param {number} code The EPSG code.
|
|
93
|
+
* @return {Promise<string>} The proj4 definition.
|
|
94
|
+
*/
|
|
95
|
+
let epsgLookup = async function (code) {
|
|
96
|
+
const response = await fetch(`https://epsg.io/${code}.proj4`);
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
throw new Error(`Unexpected response from epsg.io: ${response.status}`);
|
|
99
|
+
}
|
|
100
|
+
return response.text();
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Set the lookup function for getting proj4 definitions given an EPSG code.
|
|
105
|
+
* By default, the {@link module:ol/proj/proj4.fromEPSGCode} function uses the
|
|
106
|
+
* epsg.io website for proj4 definitions. This can be changed by providing a
|
|
107
|
+
* different lookup function.
|
|
108
|
+
*
|
|
109
|
+
* @param {function(number):Promise<string>} func The lookup function.
|
|
110
|
+
* @api
|
|
111
|
+
*/
|
|
112
|
+
export function setEPSGLookup(func) {
|
|
113
|
+
epsgLookup = func;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Get the current EPSG lookup function.
|
|
118
|
+
*
|
|
119
|
+
* @return {function(number):Promise<string>} The EPSG lookup function.
|
|
120
|
+
*/
|
|
121
|
+
export function getEPSGLookup() {
|
|
122
|
+
return epsgLookup;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Get a projection from an EPSG code. This function fetches the projection
|
|
127
|
+
* definition from the epsg.io website, registers this definition for use with
|
|
128
|
+
* proj4, and returns a configured projection. You must call import proj4 and
|
|
129
|
+
* call {@link module:ol/proj/proj4.register} before using this function.
|
|
130
|
+
*
|
|
131
|
+
* If the projection definition is already registered with proj4, it will not
|
|
132
|
+
* be fetched again (so it is ok to call this function multiple times with the
|
|
133
|
+
* same code).
|
|
134
|
+
*
|
|
135
|
+
* @param {number|string} code The EPSG code (e.g. 4326 or 'EPSG:4326').
|
|
136
|
+
* @return {Promise<Projection>} The projection.
|
|
137
|
+
* @api
|
|
138
|
+
*/
|
|
139
|
+
export async function fromEPSGCode(code) {
|
|
140
|
+
if (typeof code === 'string') {
|
|
141
|
+
code = parseInt(code.split(':').pop(), 10);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const proj4 = registered;
|
|
145
|
+
if (!proj4) {
|
|
146
|
+
throw new Error('Proj4 must be registered first with register(proj4)');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const epsgCode = 'EPSG:' + code;
|
|
150
|
+
if (proj4.defs(epsgCode)) {
|
|
151
|
+
return get(epsgCode);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
proj4.defs(epsgCode, await epsgLookup(code));
|
|
155
|
+
register(proj4);
|
|
156
|
+
|
|
157
|
+
return get(epsgCode);
|
|
158
|
+
}
|
package/util.js
CHANGED