@geospatial-sdk/core 0.0.5-alpha.9 → 0.0.5-dev.0.sha-bfaf14b
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/README.md +38 -5
- package/dist/constant/projections.d.ts +2 -0
- package/dist/constant/projections.d.ts.map +1 -0
- package/dist/constant/projections.js +1 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/model/events.d.ts +86 -0
- package/dist/model/events.d.ts.map +1 -0
- package/dist/model/events.js +37 -0
- package/dist/model/index.d.ts +9 -2
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +9 -2
- package/dist/model/map-context-diff.d.ts +11 -3
- package/dist/model/map-context-diff.d.ts.map +1 -1
- package/dist/model/map-context.d.ts +174 -22
- package/dist/model/map-context.d.ts.map +1 -1
- package/dist/model/resolved-map-state.d.ts +49 -0
- package/dist/model/resolved-map-state.d.ts.map +1 -0
- package/dist/model/resolved-map-state.js +1 -0
- package/dist/model/style.d.ts +3 -0
- package/dist/model/style.d.ts.map +1 -0
- package/dist/model/style.js +1 -0
- package/dist/utils/hash.d.ts +2 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +28 -0
- package/dist/utils/index.d.ts +12 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +12 -4
- package/dist/utils/map-context-diff.d.ts +1 -1
- package/dist/utils/map-context-diff.d.ts.map +1 -1
- package/dist/utils/map-context-diff.js +19 -11
- package/dist/utils/map-context-layer.d.ts +13 -0
- package/dist/utils/map-context-layer.d.ts.map +1 -0
- package/dist/utils/map-context-layer.js +44 -0
- package/dist/utils/map-context.d.ts +48 -4
- package/dist/utils/map-context.d.ts.map +1 -1
- package/dist/utils/map-context.js +80 -29
- package/dist/utils/style.d.ts +4 -0
- package/dist/utils/style.d.ts.map +1 -0
- package/dist/utils/style.js +68 -0
- package/dist/utils/view.d.ts +25 -0
- package/dist/utils/view.d.ts.map +1 -0
- package/dist/utils/view.js +126 -0
- package/lib/constant/projections.ts +1 -0
- package/lib/index.ts +8 -3
- package/lib/model/events.ts +113 -0
- package/lib/model/index.ts +10 -2
- package/lib/model/map-context-diff.ts +12 -3
- package/lib/model/map-context.ts +219 -26
- package/lib/model/resolved-map-state.ts +67 -0
- package/lib/model/style.ts +3 -0
- package/lib/utils/freeze.test.ts +1 -1
- package/lib/utils/hash.test.ts +180 -0
- package/lib/utils/hash.ts +28 -0
- package/lib/utils/index.ts +20 -4
- package/lib/utils/map-context-diff.test.ts +240 -10
- package/lib/utils/map-context-diff.ts +23 -14
- package/lib/utils/map-context-layer.test.ts +357 -0
- package/lib/utils/map-context-layer.ts +66 -0
- package/lib/utils/map-context.test.ts +136 -272
- package/lib/utils/map-context.ts +108 -39
- package/lib/utils/style.ts +71 -0
- package/lib/utils/url.test.ts +1 -1
- package/lib/utils/view.test.ts +146 -0
- package/lib/utils/view.ts +163 -0
- package/package.json +20 -3
package/README.md
CHANGED
|
@@ -1,11 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@geospatial-sdk/core`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- #region body -->
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package provides the foundation for the Geospatial SDK.
|
|
6
|
+
|
|
7
|
+
It includes:
|
|
8
|
+
|
|
9
|
+
- **Map Context model**: TypeScript types and interfaces for declaratively defining maps, layers, and views
|
|
10
|
+
- **Diff algorithms**: Utilities to compute differences between Map Context objects (`computeMapContextDiff`)
|
|
11
|
+
- **Validation utilities**: Tools for working with and validating geospatial data
|
|
12
|
+
- **Shared constants**: Common definitions used across all packages
|
|
13
|
+
|
|
14
|
+
The `@geospatial-sdk/core` package is framework-agnostic and does not depend on any specific mapping library. It's required by all other packages in the SDK.
|
|
6
15
|
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install @geospatial-sdk/core
|
|
7
20
|
```
|
|
8
|
-
const core = require('core');
|
|
9
21
|
|
|
10
|
-
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { computeMapContextDiff, type MapContext } from "@geospatial-sdk/core";
|
|
26
|
+
|
|
27
|
+
const oldContext: MapContext = {
|
|
28
|
+
layers: [{ type: "xyz", url: "https://example.com/{z}/{x}/{y}.png" }],
|
|
29
|
+
view: { center: [0, 0], zoom: 2 },
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const newContext: MapContext = {
|
|
33
|
+
layers: [{ type: "xyz", url: "https://example.com/{z}/{x}/{y}.png" }],
|
|
34
|
+
view: { center: [5, 45], zoom: 5 },
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const diff = computeMapContextDiff(newContext, oldContext);
|
|
11
38
|
```
|
|
39
|
+
|
|
40
|
+
<!-- #endregion body -->
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
For more detailed API documentation, see the [documentation website](https://camptocamp.github.io/geospatial-sdk/docs/).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projections.d.ts","sourceRoot":"","sources":["../../lib/constant/projections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,UAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const LONLAT_CRS_CODES = ["EPSG:4326", "CRS:84"];
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { EndpointError } from "@camptocamp/ogc-client";
|
|
2
|
+
import { Feature } from "geojson";
|
|
3
|
+
import BaseEvent from "ol/events/Event.js";
|
|
4
|
+
import type { Extent } from "ol/extent.js";
|
|
5
|
+
import { ResolvedMapLayerState, ResolvedMapState, ResolvedMapViewState } from "./resolved-map-state.js";
|
|
6
|
+
export type FeaturesByLayerIndex = Map<number, Feature[]>;
|
|
7
|
+
export declare const FeaturesClickEventType = "features-click";
|
|
8
|
+
export interface FeaturesClickEvent {
|
|
9
|
+
type: typeof FeaturesClickEventType;
|
|
10
|
+
features: Feature[];
|
|
11
|
+
featuresByLayer: FeaturesByLayerIndex;
|
|
12
|
+
}
|
|
13
|
+
export declare const FeaturesHoverEventType = "features-hover";
|
|
14
|
+
export interface FeaturesHoverEvent {
|
|
15
|
+
type: typeof FeaturesHoverEventType;
|
|
16
|
+
features: Feature[];
|
|
17
|
+
featuresByLayer: FeaturesByLayerIndex;
|
|
18
|
+
}
|
|
19
|
+
export declare const MapClickEventType = "map-click";
|
|
20
|
+
export interface MapClickEvent {
|
|
21
|
+
type: typeof MapClickEventType;
|
|
22
|
+
coordinate: [number, number];
|
|
23
|
+
}
|
|
24
|
+
export declare const MapViewStateChangeEventType = "map-view-state-change";
|
|
25
|
+
export interface MapViewStateChangeEvent {
|
|
26
|
+
type: typeof MapViewStateChangeEventType;
|
|
27
|
+
viewState: ResolvedMapViewState;
|
|
28
|
+
}
|
|
29
|
+
export declare const MapLayerStateChangeEventType = "map-layer-state-change";
|
|
30
|
+
export interface MapLayerStateChangeEvent {
|
|
31
|
+
type: typeof MapLayerStateChangeEventType;
|
|
32
|
+
layerState: ResolvedMapLayerState;
|
|
33
|
+
layerIndex: number;
|
|
34
|
+
layerId?: string | number;
|
|
35
|
+
}
|
|
36
|
+
export declare const MapStateChangeEventType = "map-state-change";
|
|
37
|
+
export interface MapStateChangeEvent {
|
|
38
|
+
type: typeof MapStateChangeEventType;
|
|
39
|
+
mapState: ResolvedMapState;
|
|
40
|
+
}
|
|
41
|
+
export declare const LayerCreationErrorEventType = "layer-creation-error";
|
|
42
|
+
export interface LayerCreationErrorEvent {
|
|
43
|
+
type: typeof LayerCreationErrorEventType;
|
|
44
|
+
error: Error;
|
|
45
|
+
}
|
|
46
|
+
export declare const LayerLoadingErrorEventType = "layer-loading-error";
|
|
47
|
+
export interface LayerLoadingErrorEvent {
|
|
48
|
+
type: typeof LayerLoadingErrorEventType;
|
|
49
|
+
error: Error;
|
|
50
|
+
httpStatus?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* DEPRECATED
|
|
54
|
+
* Use the MapViewStateChangeEvent instead
|
|
55
|
+
*/
|
|
56
|
+
export declare const MapExtentChangeEventType = "map-extent-change";
|
|
57
|
+
export interface MapExtentChangeEvent {
|
|
58
|
+
type: typeof MapExtentChangeEventType;
|
|
59
|
+
extent: Extent;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* DEPRECATED
|
|
63
|
+
* Use the MapLayerStateChangeEvent and LayerLoadingErrorEvent instead
|
|
64
|
+
*/
|
|
65
|
+
export declare const SourceLoadErrorType = "source-load-error";
|
|
66
|
+
export declare class SourceLoadErrorEvent extends BaseEvent {
|
|
67
|
+
message: string;
|
|
68
|
+
httpStatus?: number;
|
|
69
|
+
constructor(error: EndpointError | Error | Response);
|
|
70
|
+
}
|
|
71
|
+
export interface MapEventsByType {
|
|
72
|
+
[FeaturesClickEventType]: FeaturesClickEvent;
|
|
73
|
+
[FeaturesHoverEventType]: FeaturesHoverEvent;
|
|
74
|
+
[MapClickEventType]: MapClickEvent;
|
|
75
|
+
[MapViewStateChangeEventType]: MapViewStateChangeEvent;
|
|
76
|
+
[MapLayerStateChangeEventType]: MapLayerStateChangeEvent;
|
|
77
|
+
[MapStateChangeEventType]: MapStateChangeEvent;
|
|
78
|
+
[LayerCreationErrorEventType]: LayerCreationErrorEvent;
|
|
79
|
+
[LayerLoadingErrorEventType]: LayerLoadingErrorEvent;
|
|
80
|
+
/**
|
|
81
|
+
* DEPRECATED
|
|
82
|
+
*/
|
|
83
|
+
[MapExtentChangeEventType]: MapExtentChangeEvent;
|
|
84
|
+
[SourceLoadErrorType]: SourceLoadErrorEvent;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +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,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAE1D,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,sBAAsB,CAAC;IACpC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,eAAe,EAAE,oBAAoB,CAAC;CACvC;AAED,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,sBAAsB,CAAC;IACpC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,eAAe,EAAE,oBAAoB,CAAC;CACvC;AAED,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AACnE,MAAM,WA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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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EndpointError } from "@camptocamp/ogc-client";
|
|
2
|
+
import BaseEvent from "ol/events/Event.js";
|
|
3
|
+
export const FeaturesClickEventType = "features-click";
|
|
4
|
+
export const FeaturesHoverEventType = "features-hover";
|
|
5
|
+
export const MapClickEventType = "map-click";
|
|
6
|
+
export const MapViewStateChangeEventType = "map-view-state-change";
|
|
7
|
+
export const MapLayerStateChangeEventType = "map-layer-state-change";
|
|
8
|
+
export const MapStateChangeEventType = "map-state-change";
|
|
9
|
+
export const LayerCreationErrorEventType = "layer-creation-error";
|
|
10
|
+
export const LayerLoadingErrorEventType = "layer-loading-error";
|
|
11
|
+
/**
|
|
12
|
+
* DEPRECATED
|
|
13
|
+
* Use the MapViewStateChangeEvent instead
|
|
14
|
+
*/
|
|
15
|
+
export const MapExtentChangeEventType = "map-extent-change";
|
|
16
|
+
/**
|
|
17
|
+
* DEPRECATED
|
|
18
|
+
* Use the MapLayerStateChangeEvent and LayerLoadingErrorEvent instead
|
|
19
|
+
*/
|
|
20
|
+
export const SourceLoadErrorType = "source-load-error";
|
|
21
|
+
export class SourceLoadErrorEvent extends BaseEvent {
|
|
22
|
+
constructor(error) {
|
|
23
|
+
super(SourceLoadErrorType);
|
|
24
|
+
if (error instanceof Response) {
|
|
25
|
+
this.message = error.statusText;
|
|
26
|
+
this.httpStatus = error.status;
|
|
27
|
+
}
|
|
28
|
+
else if (error instanceof EndpointError) {
|
|
29
|
+
const e = error;
|
|
30
|
+
this.message = e.message;
|
|
31
|
+
this.httpStatus = e.httpStatus;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.message = error.message;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @group Types
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export * from "./map-context.js";
|
|
6
|
+
export * from "./map-context-diff.js";
|
|
7
|
+
export * from "./events.js";
|
|
8
|
+
export * from "./resolved-map-state.js";
|
|
9
|
+
export * from "./style.js";
|
|
3
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/model/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
|
package/dist/model/index.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @group Types
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export * from "./map-context.js";
|
|
6
|
+
export * from "./map-context-diff.js";
|
|
7
|
+
export * from "./events.js";
|
|
8
|
+
export * from "./resolved-map-state.js";
|
|
9
|
+
export * from "./style.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MapContextLayer, MapContextView } from "./map-context";
|
|
1
|
+
import { MapContextLayer, MapContextView } from "./map-context.js";
|
|
2
2
|
/**
|
|
3
3
|
* Associates a position to a layer; the position is the index of
|
|
4
4
|
* the layer in the layers array
|
|
@@ -15,6 +15,14 @@ export interface MapContextLayerReordered {
|
|
|
15
15
|
newPosition: number;
|
|
16
16
|
previousPosition: number;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Describes a layer that was changed: both states before and after change are included
|
|
20
|
+
*/
|
|
21
|
+
export interface MapContextLayerChanged {
|
|
22
|
+
layer: MapContextLayer;
|
|
23
|
+
previousLayer: MapContextLayer;
|
|
24
|
+
position: number;
|
|
25
|
+
}
|
|
18
26
|
/**
|
|
19
27
|
* Describes a delta between two contexts, in order to be
|
|
20
28
|
* applied to an existing map.
|
|
@@ -26,10 +34,10 @@ export interface MapContextLayerReordered {
|
|
|
26
34
|
* 4. change layers
|
|
27
35
|
*/
|
|
28
36
|
export interface MapContextDiff {
|
|
29
|
-
layersChanged:
|
|
37
|
+
layersChanged: MapContextLayerChanged[];
|
|
30
38
|
layersReordered: MapContextLayerReordered[];
|
|
31
39
|
layersRemoved: MapContextLayerPositioned[];
|
|
32
40
|
layersAdded: MapContextLayerPositioned[];
|
|
33
|
-
viewChanges
|
|
41
|
+
viewChanges?: MapContextView | null;
|
|
34
42
|
}
|
|
35
43
|
//# 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,
|
|
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;AACH,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,eAAe,CAAC;IACvB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,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,cAAc,GAAG,IAAI,CAAC;CACrC"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { FeatureCollection, Geometry } from "geojson";
|
|
2
|
-
|
|
2
|
+
import { VectorStyle } from "./style.js";
|
|
3
|
+
import { WmsLayerDimensionValue } from "@camptocamp/ogc-client";
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
* @inline
|
|
7
|
+
*/
|
|
3
8
|
export type LayerExtras = Record<string, unknown>;
|
|
4
9
|
export interface MapContextBaseLayer {
|
|
10
|
+
/**
|
|
11
|
+
* An optional identifier for the layer; if provided, will improve performance when the layers is updated through a context diff.
|
|
12
|
+
*/
|
|
5
13
|
id?: string | number;
|
|
14
|
+
/**
|
|
15
|
+
* Optional version indicator; if provided, must be increased by the application for the change detection to trigger, otherwise the SDK will consider that the layer is unchanged.
|
|
16
|
+
*/
|
|
6
17
|
version?: number;
|
|
7
18
|
/**
|
|
8
19
|
* This property can be used to store anything application-specific on layers; as its content may occasionally
|
|
@@ -10,73 +21,214 @@ export interface MapContextBaseLayer {
|
|
|
10
21
|
* non-serializable entities
|
|
11
22
|
*/
|
|
12
23
|
extras?: LayerExtras;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the layer is visible or not on the map. A non-visible layer will still have its data queried and kept in memory, so switching this on/off shows immediately on the map.
|
|
26
|
+
*
|
|
27
|
+
* Default value is `true` (visible).
|
|
28
|
+
*/
|
|
13
29
|
visibility?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Opacity level; between 0 and 1.
|
|
32
|
+
*
|
|
33
|
+
* Default value is 1 (fully opaque).
|
|
34
|
+
*/
|
|
14
35
|
opacity?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Optional label for the layer, typically used to represent the layer in a layer list or when showing a popup above a feature.
|
|
38
|
+
*/
|
|
15
39
|
label?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Attributions for the layer. Optional but strongly recommended: remember to attribute your map!
|
|
42
|
+
*/
|
|
16
43
|
attributions?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Whether data on the layer can be picked up using the `feature-click` event.
|
|
46
|
+
*
|
|
47
|
+
* Default value is `true`. Set to `false` to save performance.
|
|
48
|
+
*/
|
|
49
|
+
clickable?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether features on the layer can be picked up using the `feature-hover` event. Mostly has an effect only for vector layers.
|
|
52
|
+
*
|
|
53
|
+
* Default value is `false`.
|
|
54
|
+
*/
|
|
55
|
+
hoverable?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Controls the `Referer` header sent with tile/image requests.
|
|
58
|
+
* See the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/referrerPolicy) for possible values.
|
|
59
|
+
*
|
|
60
|
+
* Support depends on the layer type and the map library used.
|
|
61
|
+
*/
|
|
62
|
+
referrerPolicy?: ReferrerPolicy;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Dates are expressed as ISO8601 strings, e.g. "2023-01-01T00:00:00Z" or "2023-01-01"
|
|
66
|
+
*/
|
|
67
|
+
export type DateString = string;
|
|
68
|
+
export interface TimeInterval {
|
|
69
|
+
begin: DateString;
|
|
70
|
+
end: DateString;
|
|
71
|
+
}
|
|
72
|
+
export interface ValueInterval {
|
|
73
|
+
begin: WmsLayerDimensionValue;
|
|
74
|
+
end: WmsLayerDimensionValue;
|
|
17
75
|
}
|
|
76
|
+
export type LayerDimensionValue = WmsLayerDimensionValue | WmsLayerDimensionValue[] | ValueInterval;
|
|
77
|
+
export type LayerTimeDimensionValue = DateString | DateString[] | TimeInterval | "current";
|
|
18
78
|
export interface MapContextLayerWms extends MapContextBaseLayer {
|
|
19
79
|
type: "wms";
|
|
20
80
|
url: string;
|
|
21
81
|
name: string;
|
|
22
|
-
|
|
82
|
+
/**
|
|
83
|
+
* value of the built-in TIME dimension to request; can be a single date, a list of dates, a temporal interval, or a list of intervals
|
|
84
|
+
*/
|
|
85
|
+
timeValue?: LayerTimeDimensionValue;
|
|
86
|
+
/**
|
|
87
|
+
* value of the built-in ELEVATION dimension to request; can be a single value, a list of discrete values, an interval, or a list of intervals
|
|
88
|
+
*/
|
|
89
|
+
elevationValue?: LayerDimensionValue;
|
|
90
|
+
/**
|
|
91
|
+
* value of any other dimension to request (either scalar or temporal); key is the dimension name, it will be prefixed by DIM_ in the request
|
|
92
|
+
*/
|
|
93
|
+
otherDimensionValues?: Record<string, LayerDimensionValue | LayerTimeDimensionValue>;
|
|
94
|
+
/**
|
|
95
|
+
* If unspecified, will use the default one
|
|
96
|
+
*/
|
|
23
97
|
style?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Vendor-specific WMS parameters that are appended as-is to every GetMap request.
|
|
100
|
+
* Use this for non-standard server extensions such as NcWMS (`COLORSCALERANGE`, `LOGSCALE`).
|
|
101
|
+
* Keys are case-sensitive; they are passed without transformation.
|
|
102
|
+
*/
|
|
103
|
+
customParams?: Record<string, string>;
|
|
104
|
+
/**
|
|
105
|
+
* Whether to use tiled WMS requests. Tiled requests include a `TILED=true` parameter as per https://wiki.osgeo.org/wiki/WMS_Tiling_Client_Recommendation
|
|
106
|
+
*
|
|
107
|
+
* Using tiled requests allow tiles to be cached and thus the server load to potentially be reduced; on the other hand,
|
|
108
|
+
* it can increase the time to show the layer and degrade the quality of the rendering (e.g. with labels).
|
|
109
|
+
*
|
|
110
|
+
* Note: untiled requests are not supported by MapLibre-GL-JS
|
|
111
|
+
*
|
|
112
|
+
* Default value: `true` (use tiled requests)
|
|
113
|
+
*/
|
|
114
|
+
useTiles?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* The image format MIME type to use for WMS requests, e.g. `"image/png"` or `"image/jpeg"`.
|
|
117
|
+
*
|
|
118
|
+
* If not specified, the WMS server's default format will be used.
|
|
119
|
+
*/
|
|
120
|
+
format?: string;
|
|
121
|
+
/**
|
|
122
|
+
* An OGC encoded filter (e.g. an OGC `<Filter>` document) applied verbatim to the WMS
|
|
123
|
+
* GetMap `FILTER` parameter. Use it to restrict the features rendered by the layer.
|
|
124
|
+
*
|
|
125
|
+
* The value is passed through as-is; the SDK does not validate or transform it.
|
|
126
|
+
*/
|
|
127
|
+
filter?: string;
|
|
24
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* @private
|
|
131
|
+
* @inline
|
|
132
|
+
*/
|
|
133
|
+
export type LayerDimensionSimpleValue = string | number | DateString | "current";
|
|
25
134
|
export interface MapContextLayerWmts extends MapContextBaseLayer {
|
|
26
135
|
type: "wmts";
|
|
27
136
|
url: string;
|
|
28
137
|
name: string;
|
|
29
|
-
|
|
138
|
+
dimensionValues?: Record<string, LayerDimensionSimpleValue>;
|
|
30
139
|
style?: string;
|
|
31
140
|
}
|
|
32
|
-
export interface
|
|
141
|
+
export interface MapContextLayerVector {
|
|
142
|
+
style?: VectorStyle;
|
|
143
|
+
hoverStyle?: VectorStyle;
|
|
144
|
+
}
|
|
145
|
+
export type MapContextLayerWfs = MapContextBaseLayer & MapContextLayerVector & {
|
|
33
146
|
type: "wfs";
|
|
34
147
|
url: string;
|
|
35
148
|
featureType: string;
|
|
149
|
+
};
|
|
150
|
+
export type MapContextLayerOgcApi = MapContextBaseLayer & MapContextLayerVector & {
|
|
151
|
+
type: "ogcapi";
|
|
152
|
+
url: string;
|
|
153
|
+
collection: string;
|
|
154
|
+
useTiles?: "vector" | "map";
|
|
155
|
+
tileMatrixSet?: string;
|
|
156
|
+
options?: Record<string, string>;
|
|
157
|
+
};
|
|
158
|
+
export interface MapContextLayerMapLibreStyle extends MapContextBaseLayer {
|
|
159
|
+
type: "maplibre-style";
|
|
160
|
+
styleUrl: string;
|
|
161
|
+
accessToken?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface MapContextLayerGeotiff extends MapContextBaseLayer {
|
|
164
|
+
type: "geotiff";
|
|
165
|
+
url: string;
|
|
36
166
|
}
|
|
37
167
|
export interface MapContextLayerXyz extends MapContextBaseLayer {
|
|
38
168
|
type: "xyz";
|
|
39
169
|
url: string;
|
|
170
|
+
tileFormat?: "application/vnd.mapbox-vector-tile";
|
|
40
171
|
}
|
|
41
|
-
|
|
172
|
+
export type LayerGeojson = MapContextBaseLayer & MapContextLayerVector & {
|
|
42
173
|
type: "geojson";
|
|
43
|
-
}
|
|
44
|
-
interface LayerGeojsonWithUrl extends LayerGeojson {
|
|
174
|
+
};
|
|
175
|
+
export interface LayerGeojsonWithUrl extends LayerGeojson {
|
|
45
176
|
url: string;
|
|
46
177
|
data?: never;
|
|
47
178
|
}
|
|
48
|
-
interface LayerGeojsonWithData extends LayerGeojson {
|
|
179
|
+
export interface LayerGeojsonWithData extends LayerGeojson {
|
|
49
180
|
data: FeatureCollection<Geometry | null> | string;
|
|
50
181
|
url?: never;
|
|
51
182
|
}
|
|
52
|
-
/**
|
|
53
|
-
* @interface
|
|
54
|
-
*/
|
|
55
183
|
export type MapContextLayerGeojson = LayerGeojsonWithUrl | LayerGeojsonWithData;
|
|
56
184
|
/**
|
|
57
|
-
*
|
|
185
|
+
* A layer that can be used in a map context.
|
|
58
186
|
*/
|
|
59
|
-
export type MapContextLayer = MapContextLayerWms | MapContextLayerWmts | MapContextLayerWfs | MapContextLayerXyz | MapContextLayerGeojson;
|
|
187
|
+
export type MapContextLayer = MapContextLayerWms | MapContextLayerWmts | MapContextLayerWfs | MapContextLayerXyz | MapContextLayerGeojson | MapContextLayerOgcApi | MapContextLayerMapLibreStyle | MapContextLayerGeotiff;
|
|
60
188
|
export type Coordinate = [number, number];
|
|
61
189
|
/**
|
|
62
|
-
*
|
|
190
|
+
* Array components are respectively: minX, minY, maxX, maxY
|
|
63
191
|
*/
|
|
64
192
|
export type Extent = [number, number, number, number];
|
|
65
193
|
/**
|
|
66
194
|
* @property center Expressed in longitude/latitude
|
|
195
|
+
* @property zoom
|
|
196
|
+
*/
|
|
197
|
+
export interface ViewByZoomAndCenter {
|
|
198
|
+
center: Coordinate;
|
|
199
|
+
zoom: number;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
67
202
|
* @property extent Expressed in longitude/latitude
|
|
68
|
-
* @property maxExtent Expressed in longitude/latitude
|
|
69
203
|
*/
|
|
70
|
-
export interface
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
204
|
+
export interface ViewByExtent {
|
|
205
|
+
extent: Extent;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @property geometry Expressed in GeoJSON
|
|
209
|
+
*/
|
|
210
|
+
export interface ViewByGeometry {
|
|
211
|
+
geometry: Geometry;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* A description of a map viewport in one of three ways:
|
|
215
|
+
* * by center and zoom level,
|
|
216
|
+
* * by extent,
|
|
217
|
+
* * by geometry (in GeoJSON)
|
|
218
|
+
*
|
|
219
|
+
* Also allows specifying constraints for zoom and extent.
|
|
220
|
+
*/
|
|
221
|
+
export type MapContextView = (ViewByZoomAndCenter | ViewByExtent | ViewByGeometry) & {
|
|
74
222
|
maxZoom?: number;
|
|
75
223
|
maxExtent?: Extent;
|
|
76
|
-
}
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* A map context, containing layers and a view.
|
|
227
|
+
*
|
|
228
|
+
* Note: setting the `view` property to `null` indicates that the map should use a default global view.
|
|
229
|
+
*/
|
|
77
230
|
export interface MapContext {
|
|
78
231
|
layers: MapContextLayer[];
|
|
79
|
-
view: MapContextView;
|
|
232
|
+
view: MapContextView | null;
|
|
80
233
|
}
|
|
81
|
-
export {};
|
|
82
234
|
//# sourceMappingURL=map-context.d.ts.map
|
|
@@ -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;
|
|
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,CAAC;IAEpB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W,UAAU;IACzB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;CAC7B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Coordinate, Extent } from "./map-context.js";
|
|
2
|
+
export type MapLayerCreationStatus = {
|
|
3
|
+
created: true;
|
|
4
|
+
} | {
|
|
5
|
+
creationError: true;
|
|
6
|
+
creationErrorMessage: string;
|
|
7
|
+
};
|
|
8
|
+
export type MapLayerLoadingStatus = {
|
|
9
|
+
loaded: true;
|
|
10
|
+
} | {
|
|
11
|
+
loadingError: true;
|
|
12
|
+
loadingErrorMessage: string;
|
|
13
|
+
loadingErrorHttpStatus?: number;
|
|
14
|
+
} | {
|
|
15
|
+
loading: true;
|
|
16
|
+
};
|
|
17
|
+
export interface MapLayerDataInfo {
|
|
18
|
+
featuresCount?: number;
|
|
19
|
+
geometryTypes?: Array<"Point" | "LineString" | "Polygon">;
|
|
20
|
+
}
|
|
21
|
+
export interface ResolvedMapLayerIdentity {
|
|
22
|
+
id?: string | number;
|
|
23
|
+
}
|
|
24
|
+
export type ResolvedMapLayerState = MapLayerCreationStatus & MapLayerLoadingStatus & MapLayerDataInfo & ResolvedMapLayerIdentity;
|
|
25
|
+
/**
|
|
26
|
+
* Describes the actual view state of a map
|
|
27
|
+
*/
|
|
28
|
+
export interface ResolvedMapViewState {
|
|
29
|
+
/** View center in longitude/latitude */
|
|
30
|
+
center: Coordinate;
|
|
31
|
+
/** Actual view extent in longitude/latitude */
|
|
32
|
+
extent: Extent;
|
|
33
|
+
/** Map units per pixel */
|
|
34
|
+
resolution: number;
|
|
35
|
+
/** Scale denominator (takes into account an estimated DPI) */
|
|
36
|
+
scaleDenominator: number;
|
|
37
|
+
/** Bearing in degrees; 90 is North (up) */
|
|
38
|
+
bearing: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Describes the actual state of a map after a context or context diff was applied to it.
|
|
42
|
+
* A `view` of null means the view state hasn't been changed yet.
|
|
43
|
+
* A `layer` item of null means the layer state hasn't been changed yet.
|
|
44
|
+
*/
|
|
45
|
+
export interface ResolvedMapState {
|
|
46
|
+
layers: Array<ResolvedMapLayerState | null>;
|
|
47
|
+
view: ResolvedMapViewState | null;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=resolved-map-state.d.ts.map
|
|
@@ -0,0 +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,+CAA+C;IAC/C,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../lib/model/style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../lib/utils/hash.ts"],"names":[],"mappings":"AAOA,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,GAAE,MAAM,EAAO,GAAG,MAAM,CAoBzE"}
|