@twinmatrix/spatialverse-sdk-web 0.0.2 → 0.0.4
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/lib/cjs/index.js +9 -9
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +213 -294
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +40 -41
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js +170 -196
- package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +167 -215
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js +28 -30
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +861 -1170
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +166 -159
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/interfaces.js +6 -6
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/interfaces.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js +6 -6
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routeLayers.js +3 -3
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routeLayers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +523 -610
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +149 -154
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customStyles.js +2 -2
- package/lib/cjs/meta-atlas-sdk/customStyles.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customerLayer.js +15 -29
- package/lib/cjs/meta-atlas-sdk/customerLayer.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customerLayerVariant.js +5 -5
- package/lib/cjs/meta-atlas-sdk/customerLayerVariant.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js +809 -1033
- package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/helpers.js +32 -49
- package/lib/cjs/meta-atlas-sdk/utils/helpers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/local-storage.js +21 -34
- package/lib/cjs/meta-atlas-sdk/utils/local-storage.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/mapobjects-store.js +6 -6
- package/lib/cjs/meta-atlas-sdk/utils/mapobjects-store.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/routing-store.js +6 -6
- package/lib/cjs/meta-atlas-sdk/utils/routing-store.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js +363 -491
- package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
- package/lib/cjs/react/MetaAtlasMap.js +127 -0
- package/lib/cjs/react/MetaAtlasMap.js.map +1 -0
- package/lib/cjs/react/hooks/useDrawing/index.js +17 -18
- package/lib/cjs/react/hooks/useDrawing/index.js.map +1 -1
- package/lib/cjs/react/hooks/useFocus/index.js +48 -55
- package/lib/cjs/react/hooks/useFocus/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMapEvents/index.js +40 -47
- package/lib/cjs/react/hooks/useMapEvents/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMapOverlays/index.js +20 -21
- package/lib/cjs/react/hooks/useMapOverlays/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMetaAtlas/index.js +77 -95
- package/lib/cjs/react/hooks/useMetaAtlas/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMetaAtlas.js +78 -96
- package/lib/cjs/react/hooks/useMetaAtlas.js.map +1 -1
- package/lib/cjs/react/hooks/useRouting/index.js +21 -20
- package/lib/cjs/react/hooks/useRouting/index.js.map +1 -1
- package/lib/cjs/react/hooks/useSearch/index.js +35 -34
- package/lib/cjs/react/hooks/useSearch/index.js.map +1 -1
- package/lib/cjs/react/hooks/useStampRally/index.js +26 -23
- package/lib/cjs/react/hooks/useStampRally/index.js.map +1 -1
- package/lib/cjs/react/hooks/useStampRally/utils.js +2 -2
- package/lib/cjs/react/hooks/useStampRally/utils.js.map +1 -1
- package/lib/cjs/react/index.js +31 -31
- package/lib/cjs/react/index.js.map +1 -1
- package/lib/cjs/react/stores/useMapDataStore.js +47 -62
- package/lib/cjs/react/stores/useMapDataStore.js.map +1 -1
- package/lib/cjs/react/stores/useMetaAtlasStore.js +27 -40
- package/lib/cjs/react/stores/useMetaAtlasStore.js.map +1 -1
- package/lib/esm/index.js +3 -7
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +4 -3
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +14 -12
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js +204 -200
- package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +6 -6
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js +4 -3
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +53 -42
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +18 -16
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js +3 -3
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +73 -79
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +16 -15
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/customerLayer.js +4 -1
- package/lib/esm/meta-atlas-sdk/customerLayer.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js +148 -124
- package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/helpers.js +4 -2
- package/lib/esm/meta-atlas-sdk/utils/helpers.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/local-storage.js +6 -1
- package/lib/esm/meta-atlas-sdk/utils/local-storage.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js +115 -109
- package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
- package/lib/esm/react/MetaAtlasMap.js +120 -0
- package/lib/esm/react/MetaAtlasMap.js.map +1 -0
- package/lib/esm/react/hooks/useDrawing/index.js +2 -2
- package/lib/esm/react/hooks/useDrawing/index.js.map +1 -1
- package/lib/esm/react/hooks/useFocus/index.js +4 -3
- package/lib/esm/react/hooks/useFocus/index.js.map +1 -1
- package/lib/esm/react/hooks/useMapEvents/index.js +9 -6
- package/lib/esm/react/hooks/useMapEvents/index.js.map +1 -1
- package/lib/esm/react/hooks/useMapOverlays/index.js +2 -2
- package/lib/esm/react/hooks/useMapOverlays/index.js.map +1 -1
- package/lib/esm/react/hooks/useMetaAtlas/index.js +162 -60
- package/lib/esm/react/hooks/useMetaAtlas/index.js.map +1 -1
- package/lib/esm/react/hooks/useMetaAtlas.js +162 -60
- package/lib/esm/react/hooks/useMetaAtlas.js.map +1 -1
- package/lib/esm/react/hooks/useRouting/index.js +2 -2
- package/lib/esm/react/hooks/useRouting/index.js.map +1 -1
- package/lib/esm/react/hooks/useSearch/index.js +2 -2
- package/lib/esm/react/hooks/useSearch/index.js.map +1 -1
- package/lib/esm/react/hooks/useStampRally/index.js +15 -12
- package/lib/esm/react/hooks/useStampRally/index.js.map +1 -1
- package/lib/esm/react/hooks/useStampRally/utils.js +1 -1
- package/lib/esm/react/hooks/useStampRally/utils.js.map +1 -1
- package/lib/esm/react/index.js +11 -15
- package/lib/esm/react/index.js.map +1 -1
- package/lib/esm/react/stores/useMapDataStore.js +17 -21
- package/lib/esm/react/stores/useMapDataStore.js.map +1 -1
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts +30 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts +5 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts +21 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts +27 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts +18 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts +37 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts.map +1 -0
- package/package.json +10 -7
|
@@ -4,13 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useStampRally = useStampRally;
|
|
7
|
-
var
|
|
8
|
-
var _useMetaAtlasStore = require("../../stores/useMetaAtlasStore");
|
|
9
|
-
var _utils = require("./utils");
|
|
7
|
+
var _index = require("../useMetaAtlas/index.js");
|
|
8
|
+
var _useMetaAtlasStore = require("../../stores/useMetaAtlasStore.js");
|
|
9
|
+
var _utils = require("./utils.js");
|
|
10
10
|
function useStampRally() {
|
|
11
|
-
|
|
12
|
-
map
|
|
13
|
-
|
|
11
|
+
const {
|
|
12
|
+
map
|
|
13
|
+
} = (0, _index.useMetaAtlas)();
|
|
14
|
+
const servicesReady = (0, _useMetaAtlasStore.useServicesReady)();
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Set up stamp rally source, layer and load the logo images and add them to the map.
|
|
@@ -19,16 +20,16 @@ function useStampRally() {
|
|
|
19
20
|
* @param logos - Array of image names and url-s to be added.
|
|
20
21
|
* @returns Promise that resolves to a boolean indicating success or error.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
-
return new Promise(
|
|
23
|
+
const setUpStampRally = logos => {
|
|
24
|
+
return new Promise(resolve => {
|
|
24
25
|
if (!map) {
|
|
25
26
|
console.error('Map instance not available for loading stamp rally logos');
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
return new Promise(
|
|
29
|
+
const loadImageAsync = (map, id, url) => {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
30
31
|
if (map.hasImage(id)) return resolve();
|
|
31
|
-
map.loadImage(url,
|
|
32
|
+
map.loadImage(url, (error, image) => {
|
|
32
33
|
if (error || !image) {
|
|
33
34
|
console.error("Error loading image '".concat(id, "' from ").concat(url, ":"), error);
|
|
34
35
|
reject(error);
|
|
@@ -40,12 +41,14 @@ function useStampRally() {
|
|
|
40
41
|
});
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
|
-
Promise.all(logos.map(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
Promise.all(logos.map(_ref => {
|
|
45
|
+
let {
|
|
46
|
+
name,
|
|
47
|
+
url
|
|
48
|
+
} = _ref;
|
|
49
|
+
const imgName = name == 'stamp_locked' ? name : "stamp-".concat(name);
|
|
47
50
|
return loadImageAsync(map, imgName, url);
|
|
48
|
-
})).then(
|
|
51
|
+
})).then(() => {
|
|
49
52
|
if (map.getSource('Stamp Rally')) return;
|
|
50
53
|
map.addSource('Stamp Rally', {
|
|
51
54
|
type: 'geojson',
|
|
@@ -65,7 +68,7 @@ function useStampRally() {
|
|
|
65
68
|
}
|
|
66
69
|
}, undefined);
|
|
67
70
|
resolve(true);
|
|
68
|
-
})
|
|
71
|
+
}).catch(() => {
|
|
69
72
|
resolve(false);
|
|
70
73
|
});
|
|
71
74
|
});
|
|
@@ -75,13 +78,13 @@ function useStampRally() {
|
|
|
75
78
|
* Show stamp rally stamps on the map, locked and unlocked respectively.
|
|
76
79
|
* @param stamps - Array of stamps.
|
|
77
80
|
*/
|
|
78
|
-
|
|
81
|
+
const showStamps = stamps => {
|
|
79
82
|
var _map$getSource;
|
|
80
83
|
if (!map) {
|
|
81
84
|
console.error('Map instance not available for displaying stamps');
|
|
82
85
|
return;
|
|
83
86
|
}
|
|
84
|
-
|
|
87
|
+
const pointFeatures = (0, _utils.getStampFeatures)(stamps);
|
|
85
88
|
(_map$getSource = map.getSource('Stamp Rally')) === null || _map$getSource === void 0 || _map$getSource.setData({
|
|
86
89
|
type: 'FeatureCollection',
|
|
87
90
|
features: pointFeatures
|
|
@@ -91,7 +94,7 @@ function useStampRally() {
|
|
|
91
94
|
/**
|
|
92
95
|
* Hide stamp rally from the map.
|
|
93
96
|
*/
|
|
94
|
-
|
|
97
|
+
const hideStamps = () => {
|
|
95
98
|
var _map$getSource2;
|
|
96
99
|
if (!map) {
|
|
97
100
|
console.error('Map instance not available for displaying stamps');
|
|
@@ -104,9 +107,9 @@ function useStampRally() {
|
|
|
104
107
|
};
|
|
105
108
|
return {
|
|
106
109
|
isReady: servicesReady,
|
|
107
|
-
setUpStampRally
|
|
108
|
-
showStamps
|
|
109
|
-
hideStamps
|
|
110
|
+
setUpStampRally,
|
|
111
|
+
showStamps,
|
|
112
|
+
hideStamps
|
|
110
113
|
};
|
|
111
114
|
}
|
|
112
115
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["useStampRally","map","useMetaAtlas","servicesReady","useServicesReady","setUpStampRally","logos","Promise","resolve","console","error","loadImageAsync","id","url","reject","hasImage","loadImage","image","concat","addImage","log","all","_ref","name","imgName","then","getSource","addSource","type","data","features","addLayer","source","layout","undefined","catch","showStamps","stamps","_map$getSource","pointFeatures","getStampFeatures","setData","hideStamps","_map$getSource2","isReady"],"sources":["../../../../../src/react/hooks/useStampRally/index.ts"],"sourcesContent":["import { useMetaAtlas } from '../useMetaAtlas';\nimport { useServicesReady } from '../../stores/useMetaAtlasStore';\nimport { Stamp, UseStampRallyReturn } from './types';\nimport { getStampFeatures } from './utils';\n\nexport function useStampRally(): UseStampRallyReturn {\n const { map } = useMetaAtlas()\n \n const servicesReady = useServicesReady();\n\n /**\n * Set up stamp rally source, layer and load the logo images and add them to the map.\n * Remember to also load an image with name stamp_locked which is used to show the icon when stamp has not been unlocked yet.\n * Other images name should correspond with the stamp's exhibitorName.\n * @param logos - Array of image names and url-s to be added.\n * @returns Promise that resolves to a boolean indicating success or error.\n */\n const setUpStampRally = (logos: {name: string, url: string}[]): Promise<boolean> => {\n return new Promise((resolve) => {\n if (!map) {\n console.error(\n 'Map instance not available for loading stamp rally logos'\n );\n return;\n }\n\n const loadImageAsync = (\n map: maplibregl.Map,\n id: string,\n url: string\n ) => {\n return new Promise<void>((resolve, reject) => {\n if (map.hasImage(id)) return resolve();\n\n map.loadImage(url, (error, image) => {\n if (error || !image) {\n console.error(\n `Error loading image '${id}' from ${url}:`,\n error\n );\n reject(error);\n return;\n }\n\n map.addImage(id, image);\n console.log(`Loaded image: ${id}`);\n resolve();\n });\n });\n };\n\n Promise.all(\n logos.map(({ name, url }) => {\n const imgName = name == 'stamp_locked' ? name : `stamp-${name}`;\n return loadImageAsync(map, imgName, url);\n })\n ).then(() => {\n if (map.getSource('Stamp Rally')) return;\n\n map.addSource('Stamp Rally', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: [],\n },\n });\n\n map.addLayer(\n {\n id: 'stamps-layer',\n type: 'symbol',\n source: 'Stamp Rally',\n layout: {\n 'icon-image': ['get', 'icon'],\n 'icon-size': 0.05,\n 'icon-allow-overlap': true,\n },\n },\n undefined\n );\n resolve(true);\n }).catch(() => { resolve(false); });\n });\n };\n\n /**\n * Show stamp rally stamps on the map, locked and unlocked respectively.\n * @param stamps - Array of stamps.\n */\n const showStamps = (stamps: Stamp[]) => {\n if (!map) {\n console.error('Map instance not available for displaying stamps');\n return;\n }\n\n const pointFeatures = getStampFeatures(stamps);\n\n (map.getSource('Stamp Rally') as any)?.setData({\n type: 'FeatureCollection',\n features: pointFeatures as any,\n });\n };\n\n /**\n * Hide stamp rally from the map.\n */\n const hideStamps = () => {\n if (!map) {\n console.error('Map instance not available for displaying stamps');\n return;\n }\n \n (map.getSource('Stamp Rally') as any)?.setData({\n type: 'FeatureCollection',\n features: []\n });\n };\n\n return {\n isReady: servicesReady,\n setUpStampRally,\n showStamps,\n hideStamps\n };\n}\n\n"],"mappings":";;;;;;;;;AAKO,SAASA,aAAaA,CAAA,EAAwB;EACnD,MAAM;IAAEC;EAAI,CAAC,GAAG,IAAAC,mBAAY,EAAC,CAAC;EAE9B,MAAMC,aAAa,GAAG,IAAAC,mCAAgB,EAAC,CAAC;;EAExC;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,eAAe,GAAIC,KAAoC,IAAuB;IAClF,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;MAC9B,IAAI,CAACP,GAAG,EAAE;QACRQ,OAAO,CAACC,KAAK,CACX,0DACF,CAAC;QACD;MACF;MAEA,MAAMC,cAAc,GAAGA,CACrBV,GAAmB,EACnBW,EAAU,EACVC,GAAW,KACR;QACH,OAAO,IAAIN,OAAO,CAAO,CAACC,OAAO,EAAEM,MAAM,KAAK;UAC5C,IAAIb,GAAG,CAACc,QAAQ,CAACH,EAAE,CAAC,EAAE,OAAOJ,OAAO,CAAC,CAAC;UAEtCP,GAAG,CAACe,SAAS,CAACH,GAAG,EAAE,CAACH,KAAK,EAAEO,KAAK,KAAK;YACnC,IAAIP,KAAK,IAAI,CAACO,KAAK,EAAE;cACnBR,OAAO,CAACC,KAAK,yBAAAQ,MAAA,CACaN,EA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,CAAC;EACJ,CAAC;;EAED;AACF;AACA;AACA;EACE,MAAM4B,UAAU,GAAIC,MAAe,IAAK;IAAA,IAAAC,cAAA;IACtC,IAAI,CAACrC,GAAG,EAAE;MACRQ,OAAO,CAACC,KAAK,CAAC,kDAAkD,CAAC;MACjE;IACF;IAEA,MAAM6B,aAAa,GAAG,IAAAC,uBAAgB,EAACH,MAAM,CAAC;IAE9C,CAAAC,cAAA,GAACrC,GAAG,CAACyB,SAAS,CAAC,aAAa,CAAC,cAAAY,cAAA,eAA7BA,cAAA,CAAuCG,OAAO,CAAC;MAC7Cb,IAAI,EAAE,mBAAmB;MACzBE,QAAQ,EAAES;IACZ,CAAC,CAAC;EACJ,CAAC;;EAED;AACF;AACA;EACI,MAAMG,UAAU,GAAGA,CAAA,KAAM;IAAA,IAAAC,eAAA;IACvB,IAAI,CAAC1C,GAAG,EAAE;MACRQ,OAAO,CAACC,KAAK,CAAC,kDAAkD,CAAC;MACjE;IACF;IAEA,CAAAiC,eAAA,GAAC1C,GAAG,CAACyB,SAAS,CAAC,aAAa,CAAC,cAAAiB,eAAA,eAA7BA,eAAA,CAAuCF,OAAO,CAAC;MAC7Cb,IAAI,EAAE,mBAAmB;MACzBE,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ,CAAC;EAEH,OAAO;IACLc,OAAO,EAAEzC,aAAa;IACtBE,eAAe;IACf+B,UAAU;IACVM;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getStampFeatures = getStampFeatures;
|
|
7
7
|
function getStampFeatures(stamps) {
|
|
8
|
-
return stamps.map(
|
|
8
|
+
return stamps.map(stamp => {
|
|
9
9
|
if (stamp.geojson) {
|
|
10
|
-
|
|
10
|
+
const imageName = "stamp-".concat(stamp.exhibitorName);
|
|
11
11
|
if (stamp.isCollected()) stamp.geojson.properties.icon = imageName;else stamp.geojson.properties.icon = 'stamp_locked';
|
|
12
12
|
}
|
|
13
13
|
return stamp.geojson;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["getStampFeatures","stamps","map","stamp","geojson","imageName","concat","exhibitorName","isCollected","properties","icon"],"sources":["../../../../../src/react/hooks/useStampRally/utils.ts"],"sourcesContent":["import { Stamp } from \"./types\";\n\nexport function getStampFeatures(stamps: Stamp[]) {\n return stamps.map((stamp: Stamp) => {\n if (stamp.geojson) {\n const imageName = `stamp-${stamp.exhibitorName}`;\n if (stamp.isCollected()) stamp.geojson.properties.icon = imageName;\n else stamp.geojson.properties.icon = 'stamp_locked';\n }\n return stamp.geojson;\n });\n}"],"mappings":";;;;;;AAEO,SAASA,gBAAgBA,CAACC,MAAe,EAAE;EAChD,OAAOA,MAAM,CAACC,GAAG,
|
|
1
|
+
{"version":3,"file":"utils.js","names":["getStampFeatures","stamps","map","stamp","geojson","imageName","concat","exhibitorName","isCollected","properties","icon"],"sources":["../../../../../src/react/hooks/useStampRally/utils.ts"],"sourcesContent":["import { Stamp } from \"./types\";\n\nexport function getStampFeatures(stamps: Stamp[]) {\n return stamps.map((stamp: Stamp) => {\n if (stamp.geojson) {\n const imageName = `stamp-${stamp.exhibitorName}`;\n if (stamp.isCollected()) stamp.geojson.properties.icon = imageName;\n else stamp.geojson.properties.icon = 'stamp_locked';\n }\n return stamp.geojson;\n });\n}"],"mappings":";;;;;;AAEO,SAASA,gBAAgBA,CAACC,MAAe,EAAE;EAChD,OAAOA,MAAM,CAACC,GAAG,CAAEC,KAAY,IAAK;IAClC,IAAIA,KAAK,CAACC,OAAO,EAAE;MACjB,MAAMC,SAAS,YAAAC,MAAA,CAAYH,KAAK,CAACI,aAAa,CAAE;MAChD,IAAIJ,KAAK,CAACK,WAAW,CAAC,CAAC,EAAEL,KAAK,CAACC,OAAO,CAACK,UAAU,CAACC,IAAI,GAAGL,SAAS,CAAC,KAC9DF,KAAK,CAACC,OAAO,CAACK,UAAU,CAACC,IAAI,GAAG,cAAc;IACrD;IACA,OAAOP,KAAK,CAACC,OAAO;EACtB,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/lib/cjs/react/index.js
CHANGED
|
@@ -5,85 +5,85 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "MetaAtlasMap", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _MetaAtlasMap.MetaAtlasMap;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "useDrawing", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
15
|
-
return
|
|
14
|
+
get: function () {
|
|
15
|
+
return _index5.useDrawing;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "useFocus", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
21
|
-
return
|
|
20
|
+
get: function () {
|
|
21
|
+
return _index2.useFocus;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "useMapDataStore", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
26
|
+
get: function () {
|
|
27
27
|
return _useMapDataStore.useMapDataStore;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "useMapEvents", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function
|
|
33
|
-
return
|
|
32
|
+
get: function () {
|
|
33
|
+
return _index6.useMapEvents;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "useMapOverlays", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function
|
|
39
|
-
return
|
|
38
|
+
get: function () {
|
|
39
|
+
return _index7.useMapOverlays;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "useMetaAtlas", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function
|
|
45
|
-
return
|
|
44
|
+
get: function () {
|
|
45
|
+
return _index.useMetaAtlas;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "useMetaAtlasStore", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function
|
|
50
|
+
get: function () {
|
|
51
51
|
return _useMetaAtlasStore.useMetaAtlasStore;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "useRouting", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function
|
|
57
|
-
return
|
|
56
|
+
get: function () {
|
|
57
|
+
return _index3.useRouting;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "useSearch", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function
|
|
63
|
-
return
|
|
62
|
+
get: function () {
|
|
63
|
+
return _index4.useSearch;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "useServicesReady", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function
|
|
68
|
+
get: function () {
|
|
69
69
|
return _useMetaAtlasStore.useServicesReady;
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "useStampRally", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function
|
|
75
|
-
return
|
|
74
|
+
get: function () {
|
|
75
|
+
return _index8.useStampRally;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
var _MetaAtlasMap = require("./MetaAtlasMap");
|
|
79
|
-
var _useMetaAtlasStore = require("./stores/useMetaAtlasStore");
|
|
80
|
-
var _useMapDataStore = require("./stores/useMapDataStore");
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
88
|
-
var
|
|
78
|
+
var _MetaAtlasMap = require("./MetaAtlasMap.js");
|
|
79
|
+
var _useMetaAtlasStore = require("./stores/useMetaAtlasStore.js");
|
|
80
|
+
var _useMapDataStore = require("./stores/useMapDataStore.js");
|
|
81
|
+
var _index = require("./hooks/useMetaAtlas/index.js");
|
|
82
|
+
var _index2 = require("./hooks/useFocus/index.js");
|
|
83
|
+
var _index3 = require("./hooks/useRouting/index.js");
|
|
84
|
+
var _index4 = require("./hooks/useSearch/index.js");
|
|
85
|
+
var _index5 = require("./hooks/useDrawing/index.js");
|
|
86
|
+
var _index6 = require("./hooks/useMapEvents/index.js");
|
|
87
|
+
var _index7 = require("./hooks/useMapOverlays/index.js");
|
|
88
|
+
var _index8 = require("./hooks/useStampRally/index.js");
|
|
89
89
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/react/index.ts"],"sourcesContent":["// Main React component\nexport { MetaAtlasMap } from './MetaAtlasMap';\nexport type { MetaAtlasMapProps } from './types';\n\n// Stores\nexport { useMetaAtlasStore, useServicesReady } from './stores/useMetaAtlasStore';\nexport { useMapDataStore } from './stores/useMapDataStore';\n\n// Hooks\nexport { useMetaAtlas } from './hooks/useMetaAtlas';\nexport { useFocus } from './hooks/useFocus';\nexport { useRouting } from './hooks/useRouting';\nexport { useSearch } from './hooks/useSearch';\nexport { useDrawing } from './hooks/useDrawing';\nexport { useMapEvents } from './hooks/useMapEvents';\nexport { useMapOverlays } from './hooks/useMapOverlays';\nexport { useStampRally } from './hooks/useStampRally';\n\n// Types\nexport type { UseMetaAtlasReturn } from './types';\nexport type { UseFocusReturn, BuildingInfo, LevelInfo, CameraProps } from './hooks/useFocus/types';\nexport type { UseRoutingReturn } from './hooks/useRouting/types';\nexport type { UseSearchReturn } from './hooks/useSearch/types';\nexport type { UseDrawingReturn } from './hooks/useDrawing/types';\nexport type { UseMapEventsReturn } from './hooks/useMapEvents/types';\nexport type { UseMapOverlaysReturn } from './hooks/useMapOverlays/types';\nexport type { UseStampRallyReturn, Stamp } from './hooks/useStampRally/types';\n\n"],"mappings":"","ignoreList":[]}
|
|
@@ -5,12 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useMapDataStore = void 0;
|
|
7
7
|
var _zustand = require("zustand");
|
|
8
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
9
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
10
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
13
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
13
|
// can add others like assets, events, etc.
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -20,63 +19,49 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
20
19
|
* Used to access all cached data that need to be used among the components.
|
|
21
20
|
*/
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
marker: m
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
popup: null,
|
|
73
|
-
setPopup: function setPopup(p) {
|
|
74
|
-
set(function (state) {
|
|
75
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
76
|
-
popup: p
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
});
|
|
22
|
+
const useMapDataStore = exports.useMapDataStore = (0, _zustand.create)(set => ({
|
|
23
|
+
booths: {
|
|
24
|
+
data: null,
|
|
25
|
+
loading: false,
|
|
26
|
+
error: null
|
|
27
|
+
},
|
|
28
|
+
allMetaFeatures: {
|
|
29
|
+
data: null,
|
|
30
|
+
loading: false,
|
|
31
|
+
error: null
|
|
32
|
+
},
|
|
33
|
+
setData: (key, data) => set(state => _objectSpread(_objectSpread({}, state), {}, {
|
|
34
|
+
[key]: _objectSpread(_objectSpread({}, state[key]), {}, {
|
|
35
|
+
data
|
|
36
|
+
})
|
|
37
|
+
})),
|
|
38
|
+
setLoading: (key, loading) => set(state => _objectSpread(_objectSpread({}, state), {}, {
|
|
39
|
+
[key]: _objectSpread(_objectSpread({}, state[key]), {}, {
|
|
40
|
+
loading
|
|
41
|
+
})
|
|
42
|
+
})),
|
|
43
|
+
setError: (key, error) => set(state => _objectSpread(_objectSpread({}, state), {}, {
|
|
44
|
+
[key]: _objectSpread(_objectSpread({}, state[key]), {}, {
|
|
45
|
+
error
|
|
46
|
+
})
|
|
47
|
+
})),
|
|
48
|
+
activeObject: null,
|
|
49
|
+
setActiveObject: f => {
|
|
50
|
+
set(state => _objectSpread(_objectSpread({}, state), {}, {
|
|
51
|
+
activeObject: f
|
|
52
|
+
}));
|
|
53
|
+
},
|
|
54
|
+
marker: null,
|
|
55
|
+
setMarker: m => {
|
|
56
|
+
set(state => _objectSpread(_objectSpread({}, state), {}, {
|
|
57
|
+
marker: m
|
|
58
|
+
}));
|
|
59
|
+
},
|
|
60
|
+
popup: null,
|
|
61
|
+
setPopup: p => {
|
|
62
|
+
set(state => _objectSpread(_objectSpread({}, state), {}, {
|
|
63
|
+
popup: p
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
82
67
|
//# sourceMappingURL=useMapDataStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMapDataStore.js","names":["_zustand","require","
|
|
1
|
+
{"version":3,"file":"useMapDataStore.js","names":["_zustand","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","useMapDataStore","exports","create","set","booths","data","loading","error","allMetaFeatures","setData","key","state","setLoading","setError","activeObject","setActiveObject","f","marker","setMarker","m","popup","setPopup","p"],"sources":["../../../../src/react/stores/useMapDataStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { metaFeature } from '../../meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core';\nimport { Marker, Popup } from 'maplibre-gl';\n\ntype Slices = 'booths' | 'allMetaFeatures'; // can add others like assets, events, etc.\n\n\nexport interface DataSlice<T> {\n data: T | null;\n loading: boolean;\n error: string | null;\n}\n\ninterface MapDataStore {\n booths: DataSlice<metaFeature[]>;\n allMetaFeatures: DataSlice<metaFeature[]>;\n // Add other slices as needed\n\n setData: <S extends Slices>(key: S, data: MapDataStore[S]['data']) => void;\n setLoading: (key: Slices, loading: boolean) => void;\n setError: (key: Slices, error: string | null) => void;\n\n /**\n * The currently active object on the map.\n * Note: activeObject can differ from SDK's lastClickedFeature as activeObject can be updated programmatically\n * (e.g., from search results, navigation, etc.) and may not always reflect the last map click.\n */\n activeObject: metaFeature | null;\n setActiveObject: (f: metaFeature | null) => void;\n\n marker: Marker | null;\n setMarker: (m: Marker | null) => void;\n\n popup: Popup | null;\n setPopup: (m: Popup | null) => void;\n}\n\n\n/**\n * MapData Store - Map Data State Management\n * \n * Zustand store as a global singleton for Map state.\n * Used to access all cached data that need to be used among the components.\n */\n\nexport const useMapDataStore = create<MapDataStore>((set) => ({\n booths: { data: null, loading: false, error: null },\n allMetaFeatures: { data: null, loading: false, error: null },\n\n setData: (key, data) => set((state) => ({ ...state, [key]: { ...state[key], data } })),\n setLoading: (key, loading) => set((state) => ({ ...state, [key]: { ...state[key], loading } })),\n setError: (key, error) => set((state) => ({ ...state, [key]: { ...state[key], error } })),\n\n activeObject: null,\n setActiveObject: (f) => {\n set((state) => ({...state, activeObject: f}))\n },\n\n marker: null,\n setMarker: (m) => {\n set((state) => ({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AG,CAAEQ,KAAK,IAAA/B,aAAA,CAAAA,aAAA,KAAW+B,KAAK;IAAE,CAACD,GAAG,GAAA9B,aAAA,CAAAA,aAAA,KAAQ+B,KAAK,CAACD,GAAG,CAAC;MAAEJ;IAAO;EAAE,EAAG,CAAC;EAC/FO,QAAQ,EAAEA,CAACH,GAAG,EAAEH,KAAK,KAAKJ,GAAG,CAAEQ,KAAK,IAAA/B,aAAA,CAAAA,aAAA,KAAW+B,KAAK;IAAE,CAACD,GAAG,GAAA9B,aAAA,CAAAA,aAAA,KAAQ+B,KAAK,CAACD,GAAG,CAAC;MAAEH;IAAK;EAAE,EAAG,CAAC;EAEzFO,YAAY,EAAE,IAAI;EAClBC,eAAe,EAAGC,CAAC,IAAK;IACtBb,GAAG,CAAEQ,KAAK,IAAA/B,aAAA,CAAAA,aAAA,KAAU+B,KAAK;MAAEG,YAAY,EAAEE;IAAC,EAAE,CAAC;EAC/C,CAAC;EAEDC,MAAM,EAAE,IAAI;EACZC,SAAS,EAAGC,CAAC,IAAK;IAChBhB,GAAG,CAAEQ,KAAK,IAAA/B,aAAA,CAAAA,aAAA,KAAU+B,KAAK;MAAEM,MAAM,EAAEE;IAAC,EAAE,CAAC;EACzC,CAAC;EAEDC,KAAK,EAAE,IAAI;EACXC,QAAQ,EAAGC,CAAC,IAAK;IACfnB,GAAG,CAAEQ,KAAK,IAAA/B,aAAA,CAAAA,aAAA,KAAU+B,KAAK;MAAES,KAAK,EAAEE;IAAC,EAAE,CAAC;EACxC;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -12,47 +12,34 @@ var _zustand = require("zustand");
|
|
|
12
12
|
* Components access this via hooks, not props or context providers.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
setSearchReady: function setSearchReady(ready) {
|
|
40
|
-
return set({
|
|
41
|
-
searchReady: ready
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
setError: function setError(error) {
|
|
45
|
-
return set({
|
|
46
|
-
error: error
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
});
|
|
15
|
+
const useMetaAtlasStore = exports.useMetaAtlasStore = (0, _zustand.create)()((set, get) => ({
|
|
16
|
+
// Initial state
|
|
17
|
+
sdk: null,
|
|
18
|
+
mapCoreReady: false,
|
|
19
|
+
routingReady: false,
|
|
20
|
+
searchReady: false,
|
|
21
|
+
error: null,
|
|
22
|
+
// Actions
|
|
23
|
+
setSdk: sdk => set({
|
|
24
|
+
sdk
|
|
25
|
+
}),
|
|
26
|
+
setMapCoreReady: ready => set({
|
|
27
|
+
mapCoreReady: ready
|
|
28
|
+
}),
|
|
29
|
+
setRoutingReady: ready => set({
|
|
30
|
+
routingReady: ready
|
|
31
|
+
}),
|
|
32
|
+
setSearchReady: ready => set({
|
|
33
|
+
searchReady: ready
|
|
34
|
+
}),
|
|
35
|
+
setError: error => set({
|
|
36
|
+
error
|
|
37
|
+
})
|
|
38
|
+
}));
|
|
51
39
|
|
|
52
40
|
// Selector hook for computed servicesReady value
|
|
53
|
-
|
|
54
|
-
return useMetaAtlasStore(
|
|
55
|
-
return state.mapCoreReady && state.routingReady && state.searchReady;
|
|
56
|
-
});
|
|
41
|
+
const useServicesReady = () => {
|
|
42
|
+
return useMetaAtlasStore(state => state.mapCoreReady && state.routingReady && state.searchReady);
|
|
57
43
|
};
|
|
44
|
+
exports.useServicesReady = useServicesReady;
|
|
58
45
|
//# sourceMappingURL=useMetaAtlasStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMetaAtlasStore.js","names":["_zustand","require","useMetaAtlasStore","exports","create","set","get","sdk","mapCoreReady","routingReady","searchReady","error","setSdk","setMapCoreReady","ready","setRoutingReady","setSearchReady","setError","useServicesReady","state"],"sources":["../../../../src/react/stores/useMetaAtlasStore.ts"],"sourcesContent":["/**\n * MetaAtlas Store - SDK State Management\n * \n * Zustand store as a global singleton for MetaAtlas SDK state.\n * Components access this via hooks, not props or context providers.\n */\n\nimport { create } from 'zustand';\nimport { MetaAtlasSdk } from '../../meta-atlas-sdk/meta-atlas-sdk';\n\ninterface MetaAtlasState {\n sdk: MetaAtlasSdk | null;\n mapCoreReady: boolean;\n routingReady: boolean;\n searchReady: boolean;\n error: string | null;\n}\n\ninterface MetaAtlasActions {\n setSdk: (sdk: MetaAtlasSdk | null) => void;\n setMapCoreReady: (ready: boolean) => void;\n setRoutingReady: (ready: boolean) => void;\n setSearchReady: (ready: boolean) => void;\n setError: (error: string | null) => void;\n}\n\nexport const useMetaAtlasStore = create<MetaAtlasState & MetaAtlasActions>()((set, get) => ({\n // Initial state\n sdk: null,\n mapCoreReady: false,\n routingReady: false,\n searchReady: false,\n error: null,\n\n // Actions\n setSdk: (sdk) => set({ sdk }),\n setMapCoreReady: (ready) => set({ mapCoreReady: ready }),\n setRoutingReady: (ready) => set({ routingReady: ready }),\n setSearchReady: (ready) => set({ searchReady: ready }),\n setError: (error) => set({ error }),\n}));\n\n// Selector hook for computed servicesReady value\nexport const useServicesReady = () => {\n return useMetaAtlasStore((state) => \n state.mapCoreReady && state.routingReady && state.searchReady\n );\n};\n\n"],"mappings":";;;;;;AAOA,IAAAA,QAAA,GAAAC,OAAA;AAPA;AACA;AACA;AACA;AACA;AACA;;AAqBO,
|
|
1
|
+
{"version":3,"file":"useMetaAtlasStore.js","names":["_zustand","require","useMetaAtlasStore","exports","create","set","get","sdk","mapCoreReady","routingReady","searchReady","error","setSdk","setMapCoreReady","ready","setRoutingReady","setSearchReady","setError","useServicesReady","state"],"sources":["../../../../src/react/stores/useMetaAtlasStore.ts"],"sourcesContent":["/**\n * MetaAtlas Store - SDK State Management\n * \n * Zustand store as a global singleton for MetaAtlas SDK state.\n * Components access this via hooks, not props or context providers.\n */\n\nimport { create } from 'zustand';\nimport { MetaAtlasSdk } from '../../meta-atlas-sdk/meta-atlas-sdk';\n\ninterface MetaAtlasState {\n sdk: MetaAtlasSdk | null;\n mapCoreReady: boolean;\n routingReady: boolean;\n searchReady: boolean;\n error: string | null;\n}\n\ninterface MetaAtlasActions {\n setSdk: (sdk: MetaAtlasSdk | null) => void;\n setMapCoreReady: (ready: boolean) => void;\n setRoutingReady: (ready: boolean) => void;\n setSearchReady: (ready: boolean) => void;\n setError: (error: string | null) => void;\n}\n\nexport const useMetaAtlasStore = create<MetaAtlasState & MetaAtlasActions>()((set, get) => ({\n // Initial state\n sdk: null,\n mapCoreReady: false,\n routingReady: false,\n searchReady: false,\n error: null,\n\n // Actions\n setSdk: (sdk) => set({ sdk }),\n setMapCoreReady: (ready) => set({ mapCoreReady: ready }),\n setRoutingReady: (ready) => set({ routingReady: ready }),\n setSearchReady: (ready) => set({ searchReady: ready }),\n setError: (error) => set({ error }),\n}));\n\n// Selector hook for computed servicesReady value\nexport const useServicesReady = () => {\n return useMetaAtlasStore((state) => \n state.mapCoreReady && state.routingReady && state.searchReady\n );\n};\n\n"],"mappings":";;;;;;AAOA,IAAAA,QAAA,GAAAC,OAAA;AAPA;AACA;AACA;AACA;AACA;AACA;;AAqBO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,eAAM,EAAoC,CAAC,CAAC,CAACC,GAAG,EAAEC,GAAG,MAAM;EAC1F;EACAC,GAAG,EAAE,IAAI;EACTC,YAAY,EAAE,KAAK;EACnBC,YAAY,EAAE,KAAK;EACnBC,WAAW,EAAE,KAAK;EAClBC,KAAK,EAAE,IAAI;EAEX;EACAC,MAAM,EAAGL,GAAG,IAAKF,GAAG,CAAC;IAAEE;EAAI,CAAC,CAAC;EAC7BM,eAAe,EAAGC,KAAK,IAAKT,GAAG,CAAC;IAAEG,YAAY,EAAEM;EAAM,CAAC,CAAC;EACxDC,eAAe,EAAGD,KAAK,IAAKT,GAAG,CAAC;IAAEI,YAAY,EAAEK;EAAM,CAAC,CAAC;EACxDE,cAAc,EAAGF,KAAK,IAAKT,GAAG,CAAC;IAAEK,WAAW,EAAEI;EAAM,CAAC,CAAC;EACtDG,QAAQ,EAAGN,KAAK,IAAKN,GAAG,CAAC;IAAEM;EAAM,CAAC;AACpC,CAAC,CAAC,CAAC;;AAEH;AACO,MAAMO,gBAAgB,GAAGA,CAAA,KAAM;EACpC,OAAOhB,iBAAiB,CAAEiB,KAAK,IAC7BA,KAAK,CAACX,YAAY,IAAIW,KAAK,CAACV,YAAY,IAAIU,KAAK,CAACT,WACpD,CAAC;AACH,CAAC;AAACP,OAAA,CAAAe,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/lib/esm/index.js
CHANGED
|
@@ -9,14 +9,10 @@
|
|
|
9
9
|
* https://www.mixmax.com/engineering/rollup-externals
|
|
10
10
|
* https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
12
|
// Vanilla exports (existing)
|
|
14
|
-
export * from
|
|
15
|
-
|
|
16
|
-
// Core types that need to be re-exported
|
|
17
|
-
|
|
13
|
+
export * from "./meta-atlas-sdk/meta-atlas-sdk.js"; // Core types that need to be re-exported
|
|
18
14
|
// Routing types
|
|
19
|
-
export { ManeuverType } from
|
|
15
|
+
export { ManeuverType } from "./meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js";
|
|
20
16
|
// React exports (new)
|
|
21
|
-
export * from
|
|
17
|
+
export * from "./react/index.js";
|
|
22
18
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ManeuverType"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * `js` appendix has been added as the typesciript compilation does add it\n * when transpilling to JavaScript\n *\n * See https://stackoverflow.com/questions/44979976/typescript-compiler-is-forgetting-to-add-file-extensions-to-es6-module-imports\n * and https://github.com/microsoft/TypeScript/issues/40878\n *\n * Rollup\n * https://www.mixmax.com/engineering/rollup-externals\n * https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module\n */\n\n// Vanilla exports (existing)\nexport * from './meta-atlas-sdk/meta-atlas-sdk';\n\n// Core types that need to be re-exported\nexport type { metaFeature, clickedMetaFeature, MetaFeatureProperties } from './meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core';\n\n// Routing types\nexport { ManeuverType } from './meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers';\nexport type { Route, RouteSegment } from './meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers';\n\n// React exports (new)\nexport * from './react';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"index.js","names":["ManeuverType"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * `js` appendix has been added as the typesciript compilation does add it\n * when transpilling to JavaScript\n *\n * See https://stackoverflow.com/questions/44979976/typescript-compiler-is-forgetting-to-add-file-extensions-to-es6-module-imports\n * and https://github.com/microsoft/TypeScript/issues/40878\n *\n * Rollup\n * https://www.mixmax.com/engineering/rollup-externals\n * https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module\n */\n\n// Vanilla exports (existing)\nexport * from './meta-atlas-sdk/meta-atlas-sdk';\n\n// Core types that need to be re-exported\nexport type { metaFeature, clickedMetaFeature, MetaFeatureProperties } from './meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core';\n\n// Routing types\nexport { ManeuverType } from './meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers';\nexport type { Route, RouteSegment } from './meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers';\n\n// React exports (new)\nexport * from './react';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA,oDAGA;AAGA;AAAA,SACSA,YAAY;AAGrB;AAAA","ignoreList":[]}
|
|
@@ -6,8 +6,8 @@ class CustomThreeJSWrapper {
|
|
|
6
6
|
constructor(map) {
|
|
7
7
|
this.scene = new Scene();
|
|
8
8
|
this.map = map;
|
|
9
|
-
const c = map
|
|
10
|
-
const gl = c
|
|
9
|
+
const c = map === null || map === void 0 ? void 0 : map.getCanvas();
|
|
10
|
+
const gl = (c === null || c === void 0 ? void 0 : c.getContext('webgl')) || (c === null || c === void 0 ? void 0 : c.getContext('webgl2'));
|
|
11
11
|
if (!gl && !this.isWebglSupported()) {
|
|
12
12
|
console.error(map.getCanvas(), 'WebGL 2 is not supported in this environment');
|
|
13
13
|
return;
|
|
@@ -62,7 +62,8 @@ class CustomThreeJSWrapper {
|
|
|
62
62
|
repaint() {
|
|
63
63
|
this.map.repaint = true;
|
|
64
64
|
}
|
|
65
|
-
async clear(
|
|
65
|
+
async clear() {
|
|
66
|
+
let layerId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
66
67
|
return new Promise((resolve, reject) => {
|
|
67
68
|
const objects = [];
|
|
68
69
|
this.scene.children.forEach(function (object) {
|