@emuanalytics/flow-rdf-core 4.0.11 → 4.0.12
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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/lib/map/flow-core-map.mjs +36 -12
- package/dist/lib/map/plugins/annotations/annotation.events.mjs +9 -0
- package/dist/lib/map/plugins/annotations/annotation.plugin.mjs +134 -2
- package/dist/lib/map/plugins/data-join.plugin.mjs +42 -1
- package/dist/lib/map/plugins/export/export.plugin.mjs +14 -0
- package/dist/lib/map/plugins/hover-effect.plugin.mjs +9 -0
- package/dist/lib/map/plugins/index.d.mts +738 -33
- package/dist/lib/map/plugins/index.d.ts +738 -33
- package/dist/lib/map/plugins/index.mjs +0 -1
- package/dist/lib/map/plugins/keyboard-shortcut-manager.mjs +6 -0
- package/dist/lib/map/plugins/map-plugin-base.mjs +5 -0
- package/dist/lib/map/plugins/plugin-manager.mjs +97 -0
- package/dist/lib/map/plugins/popup.plugin.mjs +12 -0
- package/dist/lib/map/plugins/selection/selection.events.mjs +3 -0
- package/dist/lib/map/plugins/selection/selection.plugin.mjs +75 -4
- package/dist/lib/map/plugins/selection/source-selection.mjs +50 -2
- package/dist/lib/map/support/map-events.mjs +19 -0
- package/dist/lib/map/support/map-popup.mjs +30 -5
- package/dist/lib/utils/index.d.mts +1 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/package.json.mjs +1 -1
- package/dist/shared/{flow-rdf-core.08156446.d.mts → flow-rdf-core.3da5bd49.d.mts} +448 -17
- package/dist/shared/{flow-rdf-core.08156446.d.ts → flow-rdf-core.3da5bd49.d.ts} +448 -17
- package/package.json +2 -1
- package/dist/lib/map/plugins/url-sync.plugin.mjs +0 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emuanalytics/flow-rdf-core",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"@turf/bbox": "^6.5.0",
|
|
80
80
|
"@turf/boolean-equal": "^6.5.0",
|
|
81
81
|
"@turf/buffer": "^6.5.0",
|
|
82
|
+
"@turf/centroid": "^7.2.0",
|
|
82
83
|
"@turf/circle": "^6.5.0",
|
|
83
84
|
"@turf/distance": "^6.5.0",
|
|
84
85
|
"@turf/helpers": "^6.5.0",
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { MapPluginBase } from './map-plugin-base.mjs';
|
|
2
|
-
import Debug from 'debug';
|
|
3
|
-
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __publicField = (obj, key, value) => {
|
|
7
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
-
return value;
|
|
9
|
-
};
|
|
10
|
-
const debug = Debug("flow:url-sync-plugin");
|
|
11
|
-
class UrlSyncPlugin extends MapPluginBase {
|
|
12
|
-
constructor(pluginManager) {
|
|
13
|
-
super(pluginManager);
|
|
14
|
-
__publicField(this, "name", "UrlSyncPlugin");
|
|
15
|
-
}
|
|
16
|
-
initialize() {
|
|
17
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
18
|
-
const hash = searchParams.get(this.map.id);
|
|
19
|
-
if (hash) {
|
|
20
|
-
const center = this.hashToMapState(hash);
|
|
21
|
-
debug("Setting map position from URL", center);
|
|
22
|
-
this.map.setCenter(center);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
handleMoveEnd(event) {
|
|
26
|
-
const center = this.mapStateToHash(this.map.getCenter());
|
|
27
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
28
|
-
searchParams.set(this.map.id, center);
|
|
29
|
-
const newUrl = `${location.pathname}?${searchParams.toString()}`;
|
|
30
|
-
debug("Updating URL with map position", center);
|
|
31
|
-
window.history.replaceState({}, "", newUrl);
|
|
32
|
-
}
|
|
33
|
-
mapStateToHash(mapCenter) {
|
|
34
|
-
const state = {
|
|
35
|
-
z: mapCenter.zoom.toFixed(3),
|
|
36
|
-
x: mapCenter.lng.toFixed(3),
|
|
37
|
-
y: mapCenter.lat.toFixed(3),
|
|
38
|
-
pitch: mapCenter.pitch.toFixed(1),
|
|
39
|
-
bearing: mapCenter.bearing.toFixed(1)
|
|
40
|
-
};
|
|
41
|
-
return `${state.z}_${state.x}_${state.y}_${state.pitch}_${state.bearing}`;
|
|
42
|
-
}
|
|
43
|
-
hashToMapState(hash) {
|
|
44
|
-
const [zoom, x, y, pitch, bearing] = hash.split("_");
|
|
45
|
-
return {
|
|
46
|
-
lng: +x,
|
|
47
|
-
lat: +y,
|
|
48
|
-
zoom: +zoom,
|
|
49
|
-
pitch: +pitch,
|
|
50
|
-
bearing: +bearing
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { UrlSyncPlugin };
|