@geospatial-sdk/core 0.0.5-dev.0.sha-7ea9c6a → 0.0.5-dev.0.sha-9c03c7f
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/constant/projections.d.ts +8 -0
- package/dist/constant/projections.d.ts.map +1 -1
- package/dist/constant/projections.js +8 -0
- package/dist/model/events.d.ts +3 -3
- package/dist/model/events.d.ts.map +1 -1
- package/dist/model/events.js +2 -3
- package/dist/model/map-context-diff.d.ts +7 -1
- package/dist/model/map-context-diff.d.ts.map +1 -1
- package/dist/model/map-context.d.ts +15 -5
- package/dist/model/map-context.d.ts.map +1 -1
- package/dist/model/resolved-map-state.d.ts +1 -1
- package/dist/model/resolved-map-state.d.ts.map +1 -1
- package/dist/utils/coordinates.d.ts +52 -0
- package/dist/utils/coordinates.d.ts.map +1 -0
- package/dist/utils/coordinates.js +91 -0
- package/dist/utils/crs.d.ts +30 -0
- package/dist/utils/crs.d.ts.map +1 -0
- package/dist/utils/crs.js +83 -0
- package/dist/utils/geojson.d.ts +16 -0
- package/dist/utils/geojson.d.ts.map +1 -0
- package/dist/utils/geojson.js +118 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -0
- package/dist/utils/map-context-diff.d.ts.map +1 -1
- package/dist/utils/map-context-diff.js +10 -0
- package/dist/utils/view.d.ts +2 -2
- package/dist/utils/view.d.ts.map +1 -1
- package/dist/utils/view.js +16 -29
- package/lib/constant/projections.ts +10 -0
- package/lib/model/events.ts +4 -4
- package/lib/model/map-context-diff.ts +8 -1
- package/lib/model/map-context.ts +19 -5
- package/lib/model/resolved-map-state.ts +1 -1
- package/lib/utils/coordinates.test.ts +172 -0
- package/lib/utils/coordinates.ts +157 -0
- package/lib/utils/crs.test.ts +128 -0
- package/lib/utils/crs.ts +102 -0
- package/lib/utils/geojson.test.ts +208 -0
- package/lib/utils/geojson.ts +133 -0
- package/lib/utils/index.ts +14 -0
- package/lib/utils/map-context-diff.test.ts +68 -1
- package/lib/utils/map-context-diff.ts +11 -0
- package/lib/utils/view.test.ts +23 -0
- package/lib/utils/view.ts +19 -44
- package/package.json +2 -2
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export declare const LONLAT_CRS_CODES: string[];
|
|
2
|
+
/**
|
|
3
|
+
* This CRS is considered if no CRS is specified in a coordinate or extent
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_CRS = "EPSG:4326";
|
|
6
|
+
/**
|
|
7
|
+
* This CRS is considered if no CRS is specified in a map view context
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_MAP_VIEW_CRS = "EPSG:3857";
|
|
2
10
|
//# sourceMappingURL=projections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projections.d.ts","sourceRoot":"","sources":["../../lib/constant/projections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,UAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"projections.d.ts","sourceRoot":"","sources":["../../lib/constant/projections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,UAA0B,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,oBAAoB,cAAc,CAAC"}
|
|
@@ -1 +1,9 @@
|
|
|
1
1
|
export const LONLAT_CRS_CODES = ["EPSG:4326", "CRS:84"];
|
|
2
|
+
/**
|
|
3
|
+
* This CRS is considered if no CRS is specified in a coordinate or extent
|
|
4
|
+
*/
|
|
5
|
+
export const DEFAULT_CRS = "EPSG:4326";
|
|
6
|
+
/**
|
|
7
|
+
* This CRS is considered if no CRS is specified in a map view context
|
|
8
|
+
*/
|
|
9
|
+
export const DEFAULT_MAP_VIEW_CRS = "EPSG:3857";
|
package/dist/model/events.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { EndpointError } from "@camptocamp/ogc-client";
|
|
2
2
|
import { Feature } from "geojson";
|
|
3
|
-
import BaseEvent from "ol/events/Event.js";
|
|
4
|
-
import type { Extent } from "ol/extent.js";
|
|
5
3
|
import { ResolvedMapLayerState, ResolvedMapState, ResolvedMapViewState } from "./resolved-map-state.js";
|
|
4
|
+
import { Extent } from "./map-context.js";
|
|
6
5
|
export type FeaturesByLayerIndex = Map<number, Feature[]>;
|
|
7
6
|
export declare const FeaturesClickEventType = "features-click";
|
|
8
7
|
export interface FeaturesClickEvent {
|
|
@@ -63,7 +62,8 @@ export interface MapExtentChangeEvent {
|
|
|
63
62
|
* Use the MapLayerStateChangeEvent and LayerLoadingErrorEvent instead
|
|
64
63
|
*/
|
|
65
64
|
export declare const SourceLoadErrorType = "source-load-error";
|
|
66
|
-
export declare class SourceLoadErrorEvent
|
|
65
|
+
export declare class SourceLoadErrorEvent {
|
|
66
|
+
type: typeof SourceLoadErrorType;
|
|
67
67
|
message: string;
|
|
68
68
|
httpStatus?: number;
|
|
69
69
|
constructor(error: EndpointError | Error | Response);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../lib/model/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../lib/model/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,oBAAoB,GAAG,GAAG,CAAC,MAAM,EAAE,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BAAwB,CAAC;AAChE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,0BAA0B,CAAC;IACxC,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAC5D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,wBAAwB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AACvD,qBAAa,oBAAoB;IAC/B,IAAI,EAAE,OAAO,mBAAmB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;gBACR,KAAK,EAAE,aAAa,GAAG,KAAK,GAAG,QAAQ;CAapD;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;IAC7C,CAAC,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;IAC7C,CAAC,iBAAiB,CAAC,EAAE,aAAa,CAAC;IACnC,CAAC,2BAA2B,CAAC,EAAE,uBAAuB,CAAC;IACvD,CAAC,4BAA4B,CAAC,EAAE,wBAAwB,CAAC;IACzD,CAAC,uBAAuB,CAAC,EAAE,mBAAmB,CAAC;IAC/C,CAAC,2BAA2B,CAAC,EAAE,uBAAuB,CAAC;IACvD,CAAC,0BAA0B,CAAC,EAAE,sBAAsB,CAAC;IACrD;;OAEG;IACH,CAAC,wBAAwB,CAAC,EAAE,oBAAoB,CAAC;IACjD,CAAC,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;CAC7C"}
|
package/dist/model/events.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EndpointError } from "@camptocamp/ogc-client";
|
|
2
|
-
import BaseEvent from "ol/events/Event.js";
|
|
3
2
|
export const FeaturesClickEventType = "features-click";
|
|
4
3
|
export const FeaturesHoverEventType = "features-hover";
|
|
5
4
|
export const MapClickEventType = "map-click";
|
|
@@ -18,9 +17,9 @@ export const MapExtentChangeEventType = "map-extent-change";
|
|
|
18
17
|
* Use the MapLayerStateChangeEvent and LayerLoadingErrorEvent instead
|
|
19
18
|
*/
|
|
20
19
|
export const SourceLoadErrorType = "source-load-error";
|
|
21
|
-
export class SourceLoadErrorEvent
|
|
20
|
+
export class SourceLoadErrorEvent {
|
|
22
21
|
constructor(error) {
|
|
23
|
-
|
|
22
|
+
this.type = SourceLoadErrorType;
|
|
24
23
|
if (error instanceof Response) {
|
|
25
24
|
this.message = error.statusText;
|
|
26
25
|
this.httpStatus = error.status;
|
|
@@ -23,6 +23,12 @@ export interface MapContextLayerChanged {
|
|
|
23
23
|
previousLayer: MapContextLayer;
|
|
24
24
|
position: number;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* If the `projection` field is omitted, it means that the view projection should not be changed.
|
|
28
|
+
* A return to the default map view projection should be explicitly stated in the `projection` property.
|
|
29
|
+
* `null` means reset to the default view.
|
|
30
|
+
*/
|
|
31
|
+
export type MapContextViewDiff = MapContextView | null;
|
|
26
32
|
/**
|
|
27
33
|
* Describes a delta between two contexts, in order to be
|
|
28
34
|
* applied to an existing map.
|
|
@@ -38,6 +44,6 @@ export interface MapContextDiff {
|
|
|
38
44
|
layersReordered: MapContextLayerReordered[];
|
|
39
45
|
layersRemoved: MapContextLayerPositioned[];
|
|
40
46
|
layersAdded: MapContextLayerPositioned[];
|
|
41
|
-
viewChanges?:
|
|
47
|
+
viewChanges?: MapContextViewDiff;
|
|
42
48
|
}
|
|
43
49
|
//# sourceMappingURL=map-context-diff.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-context-diff.d.ts","sourceRoot":"","sources":["../../lib/model/map-context-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEnE;;;GAGG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,cAAc;IAC7B,aAAa,EAAE,sBAAsB,EAAE,CAAC;IACxC,eAAe,EAAE,wBAAwB,EAAE,CAAC;IAC5C,aAAa,EAAE,yBAAyB,EAAE,CAAC;IAC3C,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACzC,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC"}
|
|
@@ -185,13 +185,19 @@ export type MapContextLayerGeojson = LayerGeojsonWithUrl | LayerGeojsonWithData;
|
|
|
185
185
|
* A layer that can be used in a map context.
|
|
186
186
|
*/
|
|
187
187
|
export type MapContextLayer = MapContextLayerWms | MapContextLayerWmts | MapContextLayerWfs | MapContextLayerXyz | MapContextLayerGeojson | MapContextLayerOgcApi | MapContextLayerMapLibreStyle | MapContextLayerGeotiff;
|
|
188
|
-
export type
|
|
188
|
+
export type CrsIdentifier = string;
|
|
189
189
|
/**
|
|
190
|
-
* Array components are respectively:
|
|
190
|
+
* Array components are respectively: x, y and optionally a CRS identifier
|
|
191
|
+
* (e.g. `"EPSG:2154"`). Without a CRS, coordinates are expressed in longitude/latitude.
|
|
191
192
|
*/
|
|
192
|
-
export type
|
|
193
|
+
export type Coordinate = [number, number] | [number, number, CrsIdentifier];
|
|
193
194
|
/**
|
|
194
|
-
*
|
|
195
|
+
* Array components are respectively: minX, minY, maxX, maxY and optionally a CRS identifier
|
|
196
|
+
* (e.g. `"EPSG:2154"`). Without a CRS, the extent is expressed in longitude/latitude.
|
|
197
|
+
*/
|
|
198
|
+
export type Extent = [number, number, number, number] | [number, number, number, number, CrsIdentifier];
|
|
199
|
+
/**
|
|
200
|
+
* @property center Expressed in longitude/latitude unless a CRS identifier is given as third element
|
|
195
201
|
* @property zoom
|
|
196
202
|
*/
|
|
197
203
|
export interface ViewByZoomAndCenter {
|
|
@@ -199,7 +205,7 @@ export interface ViewByZoomAndCenter {
|
|
|
199
205
|
zoom: number;
|
|
200
206
|
}
|
|
201
207
|
/**
|
|
202
|
-
* @property extent Expressed in longitude/latitude
|
|
208
|
+
* @property extent Expressed in longitude/latitude unless a CRS identifier is given as fifth element
|
|
203
209
|
*/
|
|
204
210
|
export interface ViewByExtent {
|
|
205
211
|
extent: Extent;
|
|
@@ -221,6 +227,10 @@ export interface ViewByGeometry {
|
|
|
221
227
|
export type MapContextView = (ViewByZoomAndCenter | ViewByExtent | ViewByGeometry) & {
|
|
222
228
|
maxZoom?: number;
|
|
223
229
|
maxExtent?: Extent;
|
|
230
|
+
/**
|
|
231
|
+
* CRS in which the map is displayed (e.g. `"EPSG:2154"`); defaults to `"EPSG:3857"`.
|
|
232
|
+
*/
|
|
233
|
+
projection?: CrsIdentifier;
|
|
224
234
|
};
|
|
225
235
|
/**
|
|
226
236
|
* A map context, containing layers and a view.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-context.d.ts","sourceRoot":"","sources":["../../lib/model/map-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO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CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,mBAAmB,GAAG,YAAY,GAAG,cAAc,CACpD,GAAG;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;CAC7B"}
|
|
@@ -28,7 +28,7 @@ export type ResolvedMapLayerState = MapLayerCreationStatus & MapLayerLoadingStat
|
|
|
28
28
|
export interface ResolvedMapViewState {
|
|
29
29
|
/** View center in longitude/latitude */
|
|
30
30
|
center: Coordinate;
|
|
31
|
-
/** Actual view extent in
|
|
31
|
+
/** Actual view extent in the current view projection */
|
|
32
32
|
extent: Extent;
|
|
33
33
|
/** Map units per pixel */
|
|
34
34
|
resolution: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-map-state.d.ts","sourceRoot":"","sources":["../../lib/model/resolved-map-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,MAAM,sBAAsB,GAC9B;IACE,OAAO,EAAE,IAAI,CAAC;CACf,GACD;IACE,aAAa,EAAE,IAAI,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEN,MAAM,MAAM,qBAAqB,GAC7B;IACE,MAAM,EAAE,IAAI,CAAC;CACd,GACD;IACE,YAAY,EAAE,IAAI,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,GACD;IACE,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEN,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,wBAAwB;IACvC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GACxD,qBAAqB,GACrB,gBAAgB,GAChB,wBAAwB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,MAAM,EAAE,UAAU,CAAC;IAEnB
|
|
1
|
+
{"version":3,"file":"resolved-map-state.d.ts","sourceRoot":"","sources":["../../lib/model/resolved-map-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,MAAM,sBAAsB,GAC9B;IACE,OAAO,EAAE,IAAI,CAAC;CACf,GACD;IACE,aAAa,EAAE,IAAI,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEN,MAAM,MAAM,qBAAqB,GAC7B;IACE,MAAM,EAAE,IAAI,CAAC;CACd,GACD;IACE,YAAY,EAAE,IAAI,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,GACD;IACE,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEN,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,wBAAwB;IACvC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GACxD,qBAAqB,GACrB,gBAAgB,GAChB,wBAAwB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,MAAM,EAAE,UAAU,CAAC;IAEnB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IAEf,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,8DAA8D;IAC9D,gBAAgB,EAAE,MAAM,CAAC;IAEzB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,KAAK,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;IAC5C,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Coordinate, CrsIdentifier, Extent } from "../model/map-context.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the CRS of a coordinate or extent; defaults to EPSG:4326 (longitude/latitude)
|
|
4
|
+
*/
|
|
5
|
+
export declare function getCrs(value: Coordinate | Extent): string;
|
|
6
|
+
/**
|
|
7
|
+
* Apply a CRS identifier to a coordinate; THIS DOES NOT TRANSFORM COORDINATES
|
|
8
|
+
* @param value
|
|
9
|
+
* @param crs
|
|
10
|
+
*/
|
|
11
|
+
export declare function setCrs(value: Coordinate, crs: CrsIdentifier): Coordinate;
|
|
12
|
+
/**
|
|
13
|
+
* Apply a CRS identifier to an extent; THIS DOES NOT TRANSFORM COORDINATES
|
|
14
|
+
* @param value
|
|
15
|
+
* @param crs
|
|
16
|
+
*/
|
|
17
|
+
export declare function setCrs(value: Extent, crs: CrsIdentifier): Extent;
|
|
18
|
+
export declare function equals(value1: Coordinate, value2: Coordinate): boolean;
|
|
19
|
+
export declare function equals(value1: Extent, value2: Extent): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* first extent will be modified
|
|
22
|
+
* @param extent1
|
|
23
|
+
* @param extent2
|
|
24
|
+
*/
|
|
25
|
+
export declare function extend(extent1: Extent, extent2: Extent): Extent;
|
|
26
|
+
/**
|
|
27
|
+
* Project an extent into another CRS
|
|
28
|
+
* @param value
|
|
29
|
+
* @param toCrs
|
|
30
|
+
*/
|
|
31
|
+
export declare function transform(value: Extent, toCrs: CrsIdentifier): Extent;
|
|
32
|
+
/**
|
|
33
|
+
* Project a coordinate into another CRS
|
|
34
|
+
* @param value
|
|
35
|
+
* @param toCrs
|
|
36
|
+
*/
|
|
37
|
+
export declare function transform(value: Coordinate, toCrs: CrsIdentifier): Coordinate;
|
|
38
|
+
/**
|
|
39
|
+
* Returns another extent which is in geographic coordinates (EPSG:4326)
|
|
40
|
+
* @param value
|
|
41
|
+
*/
|
|
42
|
+
export declare function toGeographic(value: Extent): Extract<Extent, {
|
|
43
|
+
length: 4;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Returns another coordinate which is in geographic coordinates (EPSG:4326)
|
|
47
|
+
* @param value
|
|
48
|
+
*/
|
|
49
|
+
export declare function toGeographic(value: Coordinate): Extract<Coordinate, {
|
|
50
|
+
length: 2;
|
|
51
|
+
}>;
|
|
52
|
+
//# sourceMappingURL=coordinates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../../lib/utils/coordinates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAO5E;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAGzD;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,UAAU,CAAC;AAC1E;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC;AAelE,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;AACxE,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;AAoBhE;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAqB/D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC;AACvE;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC;AAiC/E;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAC5E;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,UAAU,EAAE;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { DEFAULT_CRS } from "../constant/projections.js";
|
|
2
|
+
import proj4 from "proj4";
|
|
3
|
+
function isCoordinate(value) {
|
|
4
|
+
return value.length < 4;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Returns the CRS of a coordinate or extent; defaults to EPSG:4326 (longitude/latitude)
|
|
8
|
+
*/
|
|
9
|
+
export function getCrs(value) {
|
|
10
|
+
const last = value[value.length - 1];
|
|
11
|
+
return typeof last === "string" ? last : DEFAULT_CRS;
|
|
12
|
+
}
|
|
13
|
+
export function setCrs(value, crs) {
|
|
14
|
+
const currentCrs = getCrs(value);
|
|
15
|
+
if (currentCrs === crs) {
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
if (isCoordinate(value)) {
|
|
19
|
+
return [...value.slice(0, 2), crs];
|
|
20
|
+
}
|
|
21
|
+
return [...value.slice(0, 4), crs];
|
|
22
|
+
}
|
|
23
|
+
export function equals(value1, value2) {
|
|
24
|
+
const crs1 = getCrs(value1);
|
|
25
|
+
const crs2 = getCrs(value2);
|
|
26
|
+
const isCoordinate = value1.length < 4;
|
|
27
|
+
if (isCoordinate) {
|
|
28
|
+
return crs1 === crs2 && value1[0] === value2[0] && value1[1] === value2[1];
|
|
29
|
+
}
|
|
30
|
+
return (crs1 === crs2 &&
|
|
31
|
+
value1[0] === value2[0] &&
|
|
32
|
+
value1[2] === value2[2] &&
|
|
33
|
+
value1[1] === value2[1] &&
|
|
34
|
+
value1[3] === value2[3]);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* first extent will be modified
|
|
38
|
+
* @param extent1
|
|
39
|
+
* @param extent2
|
|
40
|
+
*/
|
|
41
|
+
export function extend(extent1, extent2) {
|
|
42
|
+
const crs1 = getCrs(extent1);
|
|
43
|
+
const crs2 = getCrs(extent2);
|
|
44
|
+
if (crs1 !== crs2) {
|
|
45
|
+
throw new Error(`Cannot combine extents with different CRS: ${crs1} and ${crs2}`);
|
|
46
|
+
}
|
|
47
|
+
if (extent2[0] < extent1[0]) {
|
|
48
|
+
extent1[0] = extent2[0];
|
|
49
|
+
}
|
|
50
|
+
if (extent2[2] > extent1[2]) {
|
|
51
|
+
extent1[2] = extent2[2];
|
|
52
|
+
}
|
|
53
|
+
if (extent2[1] < extent1[1]) {
|
|
54
|
+
extent1[1] = extent2[1];
|
|
55
|
+
}
|
|
56
|
+
if (extent2[3] > extent1[3]) {
|
|
57
|
+
extent1[3] = extent2[3];
|
|
58
|
+
}
|
|
59
|
+
return extent1;
|
|
60
|
+
}
|
|
61
|
+
export function transform(value, toCrs) {
|
|
62
|
+
const crs = getCrs(value);
|
|
63
|
+
if (crs === toCrs) {
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
// convert using proj4
|
|
67
|
+
try {
|
|
68
|
+
if (isCoordinate(value)) {
|
|
69
|
+
const coordinate = value.slice(0, 2);
|
|
70
|
+
return setCrs(proj4(crs, toCrs, coordinate), toCrs);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const [minX, minY, maxX, maxY] = value.slice(0, 4);
|
|
74
|
+
// TODO: use finer logic for transforming extents, currently this can lead very often to wrong results
|
|
75
|
+
const [lonMin, latMin] = proj4(crs, toCrs, [minX, minY]);
|
|
76
|
+
const [lonMax, latMax] = proj4(crs, toCrs, [maxX, maxY]);
|
|
77
|
+
return setCrs([lonMin, latMin, lonMax, latMax], toCrs);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
throw new Error(`Cannot convert from ${crs} to ${toCrs}: ${e?.message ?? e}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export function toGeographic(value) {
|
|
85
|
+
if (isCoordinate(value)) {
|
|
86
|
+
const transformed = transform(value, "EPSG:4326");
|
|
87
|
+
return transformed.slice(0, 2);
|
|
88
|
+
}
|
|
89
|
+
const transformed = transform(value, "EPSG:4326");
|
|
90
|
+
return transformed.slice(0, 4);
|
|
91
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CrsIdentifier, MapContext, MapContextView } from "../model/map-context.js";
|
|
2
|
+
import { MapContextDiff } from "../model/map-context-diff.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the CRS codes referenced by a view (display CRS, center, extent, max extent)
|
|
5
|
+
*/
|
|
6
|
+
export declare function getViewCrsCodes(view: MapContextView): Set<CrsIdentifier>;
|
|
7
|
+
/**
|
|
8
|
+
* Returns all the CRS codes used in a map context
|
|
9
|
+
*/
|
|
10
|
+
export declare function getContextCrsCodes(context: MapContext): Set<CrsIdentifier>;
|
|
11
|
+
/**
|
|
12
|
+
* Returns all the CRS codes used in a map context diff
|
|
13
|
+
*/
|
|
14
|
+
export declare function getDiffCrsCodes(diff: MapContextDiff): Set<CrsIdentifier>;
|
|
15
|
+
/**
|
|
16
|
+
* Makes sure all given CRS codes are registered, looking up the missing ones.
|
|
17
|
+
* @throws Error if the definition of a CRS cannot be fetched
|
|
18
|
+
*/
|
|
19
|
+
export declare function ensureCrsRegistered(codes: Set<CrsIdentifier>): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Makes sure all CRS used in a map context are registered
|
|
22
|
+
* @throws Error if the definition of a CRS cannot be fetched
|
|
23
|
+
*/
|
|
24
|
+
export declare function ensureContextCrsReady(context: MapContext): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Makes sure all CRS used in a map context diff are registered
|
|
27
|
+
* @throws Error if the definition of a CRS cannot be fetched
|
|
28
|
+
*/
|
|
29
|
+
export declare function ensureDiffCrsReady(diff: MapContextDiff): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=crs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crs.d.ts","sourceRoot":"","sources":["../../lib/utils/crs.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,UAAU,EACV,cAAc,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,GAAG,CAAC,aAAa,CAAC,CAQxE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,GAAG,CAAC,aAAa,CAAC,CAK1E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,GAAG,CAAC,aAAa,CAAC,CAKxE;AAyBD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,GAAG,CAAC,aAAa,CAAC,GACxB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAExE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import proj4 from "proj4";
|
|
2
|
+
import { DEFAULT_MAP_VIEW_CRS } from "../constant/projections.js";
|
|
3
|
+
import { getCrs } from "./coordinates.js";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the CRS codes referenced by a view (display CRS, center, extent, max extent)
|
|
6
|
+
*/
|
|
7
|
+
export function getViewCrsCodes(view) {
|
|
8
|
+
const codes = new Set([
|
|
9
|
+
view.projection ?? DEFAULT_MAP_VIEW_CRS,
|
|
10
|
+
]);
|
|
11
|
+
if ("center" in view && view.center)
|
|
12
|
+
codes.add(getCrs(view.center));
|
|
13
|
+
if ("extent" in view && view.extent)
|
|
14
|
+
codes.add(getCrs(view.extent));
|
|
15
|
+
if (view.maxExtent)
|
|
16
|
+
codes.add(getCrs(view.maxExtent));
|
|
17
|
+
return codes;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns all the CRS codes used in a map context
|
|
21
|
+
*/
|
|
22
|
+
export function getContextCrsCodes(context) {
|
|
23
|
+
// TODO: check for geometries (e.g. GeoJSON)
|
|
24
|
+
if (!context.view)
|
|
25
|
+
return new Set();
|
|
26
|
+
return getViewCrsCodes(context.view);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns all the CRS codes used in a map context diff
|
|
30
|
+
*/
|
|
31
|
+
export function getDiffCrsCodes(diff) {
|
|
32
|
+
// TODO: check for geometries (e.g. GeoJSON)
|
|
33
|
+
if (!diff.viewChanges)
|
|
34
|
+
return new Set();
|
|
35
|
+
return getViewCrsCodes(diff.viewChanges);
|
|
36
|
+
}
|
|
37
|
+
function isRegistered(code) {
|
|
38
|
+
// consider Web Mercator and Geographic as known
|
|
39
|
+
if (code === "EPSG:3857" || code === "EPSG:4326")
|
|
40
|
+
return true;
|
|
41
|
+
return !!proj4.defs(code);
|
|
42
|
+
}
|
|
43
|
+
async function registerCrs(code) {
|
|
44
|
+
if (typeof code !== "string" || !code.includes(":")) {
|
|
45
|
+
throw new Error(`Invalid code`);
|
|
46
|
+
}
|
|
47
|
+
const [authority, num] = code.toLowerCase().split(":", 2);
|
|
48
|
+
const response = await fetch(`https://spatialreference.org/ref/${authority}/${num}/ogcwkt/`);
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
throw new Error(`Unexpected response from spatialreference.org: ${response.status}`);
|
|
51
|
+
}
|
|
52
|
+
const def = await response.text();
|
|
53
|
+
proj4.defs(code, def);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Makes sure all given CRS codes are registered, looking up the missing ones.
|
|
57
|
+
* @throws Error if the definition of a CRS cannot be fetched
|
|
58
|
+
*/
|
|
59
|
+
export async function ensureCrsRegistered(codes) {
|
|
60
|
+
const missing = Array.from(codes).filter((code) => !isRegistered(code));
|
|
61
|
+
await Promise.all(missing.map(async (code) => {
|
|
62
|
+
try {
|
|
63
|
+
await registerCrs(code);
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
throw new Error(`Could not find a definition for CRS "${code}": ${e?.message ?? e}`);
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Makes sure all CRS used in a map context are registered
|
|
72
|
+
* @throws Error if the definition of a CRS cannot be fetched
|
|
73
|
+
*/
|
|
74
|
+
export function ensureContextCrsReady(context) {
|
|
75
|
+
return ensureCrsRegistered(getContextCrsCodes(context));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Makes sure all CRS used in a map context diff are registered
|
|
79
|
+
* @throws Error if the definition of a CRS cannot be fetched
|
|
80
|
+
*/
|
|
81
|
+
export function ensureDiffCrsReady(diff) {
|
|
82
|
+
return ensureCrsRegistered(getDiffCrsCodes(diff));
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Feature, FeatureCollection, Geometry } from "geojson";
|
|
2
|
+
import { Extent } from "../model/index.js";
|
|
3
|
+
export declare function ensureGeojson(value: FeatureCollection<Geometry | null> | string): FeatureCollection<Geometry | null>;
|
|
4
|
+
/**
|
|
5
|
+
* This assumes the geometry is in EPSG:4326
|
|
6
|
+
* TODO: support other CRSs
|
|
7
|
+
* @param geometry
|
|
8
|
+
*/
|
|
9
|
+
export declare function getExtentFromGeometry(geometry: Geometry): Extent;
|
|
10
|
+
/**
|
|
11
|
+
* This assumes the geometry is in EPSG:4326
|
|
12
|
+
* TODO: support other CRSs
|
|
13
|
+
* @param geojson
|
|
14
|
+
*/
|
|
15
|
+
export declare function getExtentFromGeojson(geojson: FeatureCollection<Geometry | null> | Feature<Geometry | null> | Geometry): Extent;
|
|
16
|
+
//# sourceMappingURL=geojson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../../lib/utils/geojson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,wBAAgB,aAAa,CAC3B,KAAK,EAAE,iBAAiB,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,MAAM,GACjD,iBAAiB,CAAC,QAAQ,GAAG,IAAI,CAAC,CASpC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CA8EhE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EACL,iBAAiB,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,QAAQ,GACzE,MAAM,CAsBR"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { extend } from "./coordinates.js";
|
|
2
|
+
export function ensureGeojson(value) {
|
|
3
|
+
if (typeof value === "string") {
|
|
4
|
+
try {
|
|
5
|
+
return JSON.parse(value);
|
|
6
|
+
}
|
|
7
|
+
catch (e) {
|
|
8
|
+
throw new Error(`Invalid GeoJSON string: ${e}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* This assumes the geometry is in EPSG:4326
|
|
15
|
+
* TODO: support other CRSs
|
|
16
|
+
* @param geometry
|
|
17
|
+
*/
|
|
18
|
+
export function getExtentFromGeometry(geometry) {
|
|
19
|
+
// use the bounding box if specified in the GeoJSON object
|
|
20
|
+
if (geometry.bbox) {
|
|
21
|
+
return geometry.bbox.length > 5
|
|
22
|
+
? [
|
|
23
|
+
geometry.bbox[0],
|
|
24
|
+
geometry.bbox[1],
|
|
25
|
+
geometry.bbox[3],
|
|
26
|
+
geometry.bbox[4],
|
|
27
|
+
]
|
|
28
|
+
: geometry.bbox;
|
|
29
|
+
}
|
|
30
|
+
const coordinatesReducer = (prev, coords) => {
|
|
31
|
+
if (coords[0] < prev[0]) {
|
|
32
|
+
prev[0] = coords[0];
|
|
33
|
+
}
|
|
34
|
+
if (coords[1] < prev[1]) {
|
|
35
|
+
prev[1] = coords[1];
|
|
36
|
+
}
|
|
37
|
+
if (coords[0] > prev[2]) {
|
|
38
|
+
prev[2] = coords[0];
|
|
39
|
+
}
|
|
40
|
+
if (coords[1] > prev[3]) {
|
|
41
|
+
prev[3] = coords[1];
|
|
42
|
+
}
|
|
43
|
+
return prev;
|
|
44
|
+
};
|
|
45
|
+
const coordinatesArrayReducer = (prev, coordsArray) => {
|
|
46
|
+
const bbox = coordsArray.reduce(coordinatesReducer, [
|
|
47
|
+
Infinity,
|
|
48
|
+
Infinity,
|
|
49
|
+
-Infinity,
|
|
50
|
+
-Infinity,
|
|
51
|
+
]);
|
|
52
|
+
return extend(prev, bbox);
|
|
53
|
+
};
|
|
54
|
+
const initialExtent = [Infinity, Infinity, -Infinity, -Infinity];
|
|
55
|
+
switch (geometry.type) {
|
|
56
|
+
case "MultiPolygon":
|
|
57
|
+
return geometry.coordinates.reduce((prev, polygonCoords) => {
|
|
58
|
+
const bbox = polygonCoords.reduce(coordinatesArrayReducer, [
|
|
59
|
+
Infinity,
|
|
60
|
+
Infinity,
|
|
61
|
+
-Infinity,
|
|
62
|
+
-Infinity,
|
|
63
|
+
]);
|
|
64
|
+
return extend(prev, bbox);
|
|
65
|
+
}, initialExtent);
|
|
66
|
+
case "GeometryCollection":
|
|
67
|
+
return geometry.geometries.reduce((prev, geom) => {
|
|
68
|
+
const bbox = getExtentFromGeometry(geom);
|
|
69
|
+
return extend(prev, bbox);
|
|
70
|
+
}, initialExtent);
|
|
71
|
+
case "Polygon":
|
|
72
|
+
case "MultiLineString":
|
|
73
|
+
return geometry.coordinates.reduce(coordinatesArrayReducer, [
|
|
74
|
+
Infinity,
|
|
75
|
+
Infinity,
|
|
76
|
+
-Infinity,
|
|
77
|
+
-Infinity,
|
|
78
|
+
]);
|
|
79
|
+
case "LineString":
|
|
80
|
+
case "MultiPoint":
|
|
81
|
+
return geometry.coordinates.reduce(coordinatesReducer, [
|
|
82
|
+
Infinity,
|
|
83
|
+
Infinity,
|
|
84
|
+
-Infinity,
|
|
85
|
+
-Infinity,
|
|
86
|
+
]);
|
|
87
|
+
case "Point":
|
|
88
|
+
return coordinatesReducer([Infinity, Infinity, -Infinity, -Infinity], geometry.coordinates);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* This assumes the geometry is in EPSG:4326
|
|
93
|
+
* TODO: support other CRSs
|
|
94
|
+
* @param geojson
|
|
95
|
+
*/
|
|
96
|
+
export function getExtentFromGeojson(geojson) {
|
|
97
|
+
const empty = [Infinity, Infinity, -Infinity, -Infinity];
|
|
98
|
+
if ("type" in geojson) {
|
|
99
|
+
switch (geojson.type) {
|
|
100
|
+
case "FeatureCollection":
|
|
101
|
+
return geojson.features.reduce((prev, feature) => {
|
|
102
|
+
if (feature.geometry) {
|
|
103
|
+
const bbox = getExtentFromGeometry(feature.geometry);
|
|
104
|
+
return extend(prev, bbox);
|
|
105
|
+
}
|
|
106
|
+
return prev;
|
|
107
|
+
}, empty);
|
|
108
|
+
case "Feature":
|
|
109
|
+
if (geojson.geometry) {
|
|
110
|
+
return getExtentFromGeometry(geojson.geometry);
|
|
111
|
+
}
|
|
112
|
+
return empty;
|
|
113
|
+
default:
|
|
114
|
+
return getExtentFromGeometry(geojson);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return empty;
|
|
118
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
export * from "./url.js";
|
|
6
6
|
export * from "./freeze.js";
|
|
7
7
|
export * from "./hash.js";
|
|
8
|
+
export { getCrs, setCrs, transform, toGeographic, equals, extend, } from "./coordinates.js";
|
|
8
9
|
export { computeMapContextDiff } from "./map-context-diff.js";
|
|
9
10
|
export { getLayerPosition, addLayerToContext, removeLayerFromContext, replaceLayerInContext, changeLayerPositionInContext, updateLayerInContext, } from "./map-context.js";
|
|
10
11
|
export { updateLayer } from "./map-context-layer.js";
|
|
11
12
|
export { createViewFromLayer } from "./view.js";
|
|
12
13
|
export * from "./style.js";
|
|
14
|
+
export { ensureGeojson, getExtentFromGeojson, getExtentFromGeometry, } from "./geojson.js";
|
|
15
|
+
export { ensureContextCrsReady, ensureDiffCrsReady } from "./crs.js";
|
|
13
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,MAAM,EACN,MAAM,EACN,SAAS,EACT,YAAY,EACZ,MAAM,EACN,MAAM,GACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
export * from "./url.js";
|
|
6
6
|
export * from "./freeze.js";
|
|
7
7
|
export * from "./hash.js";
|
|
8
|
+
export { getCrs, setCrs, transform, toGeographic, equals, extend, } from "./coordinates.js";
|
|
8
9
|
export { computeMapContextDiff } from "./map-context-diff.js";
|
|
9
10
|
export { getLayerPosition, addLayerToContext, removeLayerFromContext, replaceLayerInContext, changeLayerPositionInContext, updateLayerInContext, } from "./map-context.js";
|
|
10
11
|
export { updateLayer } from "./map-context-layer.js";
|
|
11
12
|
export { createViewFromLayer } from "./view.js";
|
|
12
13
|
export * from "./style.js";
|
|
14
|
+
export { ensureGeojson, getExtentFromGeojson, getExtentFromGeometry, } from "./geojson.js";
|
|
15
|
+
export { ensureContextCrsReady, ensureDiffCrsReady } from "./crs.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-context-diff.d.ts","sourceRoot":"","sources":["../../lib/utils/map-context-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EAKf,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"map-context-diff.d.ts","sourceRoot":"","sources":["../../lib/utils/map-context-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EAKf,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,UAAU,EACvB,eAAe,EAAE,UAAU,GAC1B,cAAc,CAwFhB"}
|