@geospatial-sdk/core 0.0.5-dev.16 → 0.0.5-dev.17

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.
@@ -0,0 +1,16 @@
1
+ import { Feature } from "geojson";
2
+ export declare const FeaturesClickEventType = "features-click";
3
+ export interface FeaturesClickEvent {
4
+ features: Feature[];
5
+ }
6
+ export declare const FeaturesHoverEventType = "features-hover";
7
+ export interface FeaturesHoverEvent {
8
+ features: Feature[];
9
+ }
10
+ export declare const MapClickEventType = "map-click";
11
+ export interface MapClickEvent {
12
+ coordinate: [number, number];
13
+ }
14
+ export type MapEvent = FeaturesClickEvent | FeaturesHoverEvent | MapClickEvent;
15
+ export type MapEventType = typeof FeaturesClickEventType | typeof FeaturesHoverEventType | typeof MapClickEventType;
16
+ //# 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,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,MAAM,MAAM,QAAQ,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAE/E,MAAM,MAAM,YAAY,GACpB,OAAO,sBAAsB,GAC7B,OAAO,sBAAsB,GAC7B,OAAO,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const FeaturesClickEventType = "features-click";
2
+ export const FeaturesHoverEventType = "features-hover";
3
+ export const MapClickEventType = "map-click";
@@ -1,3 +1,4 @@
1
1
  export * from "./map-context";
2
2
  export * from "./map-context-diff";
3
+ export * from "./events";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from "./map-context";
2
2
  export * from "./map-context-diff";
3
+ export * from "./events";
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../lib/utils/view.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,eAAe,EAGf,cAAc,EAEf,MAAM,UAAU,CAAC;AAKlB,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAYhC"}
1
+ {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../lib/utils/view.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,eAAe,EAIf,cAAc,EAEf,MAAM,UAAU,CAAC;AAKlB,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAYhC"}
@@ -0,0 +1,23 @@
1
+ import { Feature } from "geojson";
2
+
3
+ export const FeaturesClickEventType = "features-click";
4
+ export interface FeaturesClickEvent {
5
+ features: Feature[];
6
+ }
7
+
8
+ export const FeaturesHoverEventType = "features-hover";
9
+ export interface FeaturesHoverEvent {
10
+ features: Feature[];
11
+ }
12
+
13
+ export const MapClickEventType = "map-click";
14
+ export interface MapClickEvent {
15
+ coordinate: [number, number]; // expressed in lon/lat
16
+ }
17
+
18
+ export type MapEvent = FeaturesClickEvent | FeaturesHoverEvent | MapClickEvent;
19
+
20
+ export type MapEventType =
21
+ | typeof FeaturesClickEventType
22
+ | typeof FeaturesHoverEventType
23
+ | typeof MapClickEventType;
@@ -1,2 +1,3 @@
1
1
  export * from "./map-context";
2
2
  export * from "./map-context-diff";
3
+ export * from "./events";
package/lib/utils/view.ts CHANGED
@@ -9,6 +9,7 @@ import proj4 from "proj4";
9
9
  import {
10
10
  Extent,
11
11
  MapContextLayer,
12
+ MapContextLayerWfs,
12
13
  MapContextLayerWms,
13
14
  MapContextLayerWmts,
14
15
  MapContextView,
@@ -94,7 +95,9 @@ async function getWmtsLayerExtent(
94
95
  : null;
95
96
  }
96
97
 
97
- async function getWfsLayerExtent(layer: any): Promise<ViewByExtent | null> {
98
+ async function getWfsLayerExtent(
99
+ layer: MapContextLayerWfs,
100
+ ): Promise<ViewByExtent | null> {
98
101
  const endpoint = await new WfsEndpoint(layer.url).isReady();
99
102
  const featureTypeSummary = endpoint.getFeatureTypeSummary(layer.featureType);
100
103
  const boundingBox = featureTypeSummary?.boundingBox;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geospatial-sdk/core",
3
- "version": "0.0.5-dev.16+4001375",
3
+ "version": "0.0.5-dev.17+e758ce3",
4
4
  "description": "Core functions and models for the SDK",
5
5
  "author": "Olivia <olivia.guyot@camptocamp.com>",
6
6
  "homepage": "",
@@ -22,7 +22,7 @@
22
22
  "test": "vitest",
23
23
  "build": "tsc"
24
24
  },
25
- "gitHead": "400137529b7bf0df095702ce7b899e0d51634c91",
25
+ "gitHead": "e758ce3d88f26443f0680907277ae4fde3c748f9",
26
26
  "dependencies": {
27
27
  "@camptocamp/ogc-client": "1.1.1-dev.9671ef4",
28
28
  "proj4": "^2.9.2"