@twinmatrix/spatialverse-sdk-web 0.0.2 → 0.0.3
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 +43 -45
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js +241 -271
- 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 +876 -1188
- 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 +173 -163
- 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 +546 -620
- 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 +155 -160
- 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 +832 -1060
- package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/helpers.js +33 -50
- package/lib/cjs/meta-atlas-sdk/utils/helpers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/local-storage.js +18 -36
- 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 +428 -556
- 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 -50
- 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 +30 -29
- 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 +53 -64
- 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 +2 -1
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +10 -9
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js +2 -2
- package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +3 -3
- 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 +22 -14
- 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 +8 -8
- 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 +18 -11
- 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 +4 -3
- 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 +80 -61
- package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/helpers.js +3 -1
- package/lib/esm/meta-atlas-sdk/utils/helpers.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js +19 -15
- 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 +3 -3
- 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 +8 -7
- package/lib/esm/react/hooks/useStampRally/index.js.map +1 -1
- package/lib/esm/react/index.js +11 -15
- package/lib/esm/react/index.js.map +1 -1
- package/package.json +9 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useMetaAtlasStore, useServicesReady } from
|
|
2
|
+
import { useMetaAtlasStore, useServicesReady } from "../stores/useMetaAtlasStore.js";
|
|
3
3
|
export function useMetaAtlas() {
|
|
4
4
|
const sdk = useMetaAtlasStore(state => state.sdk);
|
|
5
5
|
const mapCoreReady = useMetaAtlasStore(state => state.mapCoreReady);
|
|
@@ -76,43 +76,43 @@ export function useMetaAtlas() {
|
|
|
76
76
|
// Helper to guard search functions with servicesReady
|
|
77
77
|
// Preserves the original return type (Promise or void)
|
|
78
78
|
const guardSearch = fn => {
|
|
79
|
-
return (
|
|
79
|
+
return function () {
|
|
80
80
|
if (!servicesReady) {
|
|
81
81
|
const error = new Error('Search services are not ready. Please wait for initialization.');
|
|
82
82
|
// Return rejected promise - TypeScript will handle type compatibility
|
|
83
83
|
return Promise.reject(error);
|
|
84
84
|
}
|
|
85
|
-
return fn(...
|
|
85
|
+
return fn(...arguments);
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
// Helper to guard routing functions with servicesReady
|
|
90
90
|
const guardRouting = fn => {
|
|
91
|
-
return (
|
|
91
|
+
return function () {
|
|
92
92
|
if (!servicesReady) {
|
|
93
93
|
throw new Error('Routing services are not ready. Please wait for initialization.');
|
|
94
94
|
}
|
|
95
|
-
return fn(...
|
|
95
|
+
return fn(...arguments);
|
|
96
96
|
};
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
// Helper to guard other functions with mapCoreReady
|
|
100
100
|
const guardMapCore = fn => {
|
|
101
|
-
return (
|
|
101
|
+
return function () {
|
|
102
102
|
if (!mapCoreReady) {
|
|
103
103
|
throw new Error('Map core is not ready. Please wait for initialization.');
|
|
104
104
|
}
|
|
105
|
-
return fn(...
|
|
105
|
+
return fn(...arguments);
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
// Helper for async functions that need mapCoreReady
|
|
110
110
|
const guardMapCoreAsync = fn => {
|
|
111
|
-
return (
|
|
111
|
+
return function () {
|
|
112
112
|
if (!mapCoreReady) {
|
|
113
113
|
return Promise.reject(new Error('Map core is not ready. Please wait for initialization.'));
|
|
114
114
|
}
|
|
115
|
-
return fn(...
|
|
115
|
+
return fn(...arguments);
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
118
|
return {
|
|
@@ -120,68 +120,170 @@ export function useMetaAtlas() {
|
|
|
120
120
|
error,
|
|
121
121
|
map: sdk.map,
|
|
122
122
|
// Focus methods - require mapCoreReady
|
|
123
|
-
focusTo: guardMapCore((
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
focusTo: guardMapCore(function () {
|
|
124
|
+
return sdk.focusTo(...arguments);
|
|
125
|
+
}),
|
|
126
|
+
getCurrentFocus: guardMapCore(function () {
|
|
127
|
+
return sdk.getCurrentFocus(...arguments);
|
|
128
|
+
}),
|
|
129
|
+
getCurrentFocusBuilding: guardMapCore(function () {
|
|
130
|
+
return sdk.getCurrentFocusBuilding(...arguments);
|
|
131
|
+
}),
|
|
132
|
+
getCurrentFocusFloor: guardMapCore(function () {
|
|
133
|
+
return sdk.getCurrentFocusFloor(...arguments);
|
|
134
|
+
}),
|
|
135
|
+
getFocusTree: function () {
|
|
136
|
+
return sdk.getFocusTree(...arguments);
|
|
137
|
+
},
|
|
128
138
|
// Search methods - require servicesReady
|
|
129
|
-
getMapObjectsByName: guardSearch((
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
getMapObjectsByName: guardSearch(function () {
|
|
140
|
+
return sdk.getMapObjectsByName(...arguments);
|
|
141
|
+
}),
|
|
142
|
+
getMapObjectById: guardSearch(function () {
|
|
143
|
+
return sdk.getMapObjectById(...arguments);
|
|
144
|
+
}),
|
|
145
|
+
getMapObjectByLocalRef: guardSearch(function () {
|
|
146
|
+
return sdk.getMapObjectByLocalRef(...arguments);
|
|
147
|
+
}),
|
|
148
|
+
getMapObjectsByWhatTaxonomy: guardSearch(function () {
|
|
149
|
+
return sdk.getMapObjectsByWhatTaxonomy(...arguments);
|
|
150
|
+
}),
|
|
151
|
+
getMapObjectsByWhereTaxonomy: guardSearch(function () {
|
|
152
|
+
return sdk.getMapObjectsByWhereTaxonomy(...arguments);
|
|
153
|
+
}),
|
|
154
|
+
getMapObjectsByWhatAndWhereTaxonomy: guardSearch(function () {
|
|
155
|
+
return sdk.getMapObjectsByWhatAndWhereTaxonomy(...arguments);
|
|
156
|
+
}),
|
|
157
|
+
getMapObjectsInWhatTaxonomy: guardSearch(function () {
|
|
158
|
+
return sdk.getMapObjectsInWhatTaxonomy(...arguments);
|
|
159
|
+
}),
|
|
160
|
+
getMapObjectsInWhereTaxonomy: guardSearch(function () {
|
|
161
|
+
return sdk.getMapObjectsInWhereTaxonomy(...arguments);
|
|
162
|
+
}),
|
|
163
|
+
getMapObjectsByFilteredLocalRef: guardSearch(function () {
|
|
164
|
+
return sdk.getMapObjectsByFilteredLocalRef(...arguments);
|
|
165
|
+
}),
|
|
166
|
+
getMapObjectMatchingLocalRef: guardSearch(function () {
|
|
167
|
+
return sdk.getMapObjectMatchingLocalRef(...arguments);
|
|
168
|
+
}),
|
|
169
|
+
getMapObjectsMatchingLocalRefs: guardSearch(function () {
|
|
170
|
+
return sdk.getMapObjectsMatchingLocalRefs(...arguments);
|
|
171
|
+
}),
|
|
172
|
+
getMapObjectsByWhatTaxonomyAPI: guardSearch(function () {
|
|
173
|
+
return sdk.getMapObjectsByWhatTaxonomyAPI(...arguments);
|
|
174
|
+
}),
|
|
141
175
|
getWhatTaxonomies: guardMapCore(() => sdk.metaAtlasCore.getWhatTaxonomies()),
|
|
142
176
|
// Filtering methods - require mapCoreReady
|
|
143
|
-
filterWhereDimension: guardMapCore((
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
177
|
+
filterWhereDimension: guardMapCore(function () {
|
|
178
|
+
return sdk.filterWhereDimension(...arguments);
|
|
179
|
+
}),
|
|
180
|
+
filterLayersByType: guardMapCore(function () {
|
|
181
|
+
return sdk.filterLayersByType(...arguments);
|
|
182
|
+
}),
|
|
183
|
+
filterLayersByCategories: guardMapCore(function () {
|
|
184
|
+
return sdk.filterLayersByCategories(...arguments);
|
|
185
|
+
}),
|
|
186
|
+
styleLayersByType: guardMapCore(function () {
|
|
187
|
+
return sdk.styleLayersByType(...arguments);
|
|
188
|
+
}),
|
|
189
|
+
clearStyleLayersByType: guardMapCore(function () {
|
|
190
|
+
return sdk.clearStyleLayersByType(...arguments);
|
|
191
|
+
}),
|
|
148
192
|
// Click handlers - require mapCoreReady
|
|
149
|
-
getLastClickedFeature: guardMapCore((
|
|
150
|
-
|
|
193
|
+
getLastClickedFeature: guardMapCore(function () {
|
|
194
|
+
return sdk.getLastClickedFeature(...arguments);
|
|
195
|
+
}),
|
|
196
|
+
getLastClickedDrawing: guardMapCore(function () {
|
|
197
|
+
return sdk.getLastClickedDrawing(...arguments);
|
|
198
|
+
}),
|
|
151
199
|
// Drawing methods - require mapCoreReady
|
|
152
|
-
drawGeometryOnMap: guardMapCore((
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
200
|
+
drawGeometryOnMap: guardMapCore(function () {
|
|
201
|
+
return sdk.drawGeometryOnMap(...arguments);
|
|
202
|
+
}),
|
|
203
|
+
addDrawingsToBaseMap: guardMapCore(function () {
|
|
204
|
+
return sdk.addDrawingsToBaseMap(...arguments);
|
|
205
|
+
}),
|
|
206
|
+
editDrawing: guardMapCore(function () {
|
|
207
|
+
return sdk.editDrawing(...arguments);
|
|
208
|
+
}),
|
|
209
|
+
removeDrawing: guardMapCore(function () {
|
|
210
|
+
return sdk.removeDrawing(...arguments);
|
|
211
|
+
}),
|
|
212
|
+
getDrawingById: guardMapCore(function () {
|
|
213
|
+
return sdk.getDrawingById(...arguments);
|
|
214
|
+
}),
|
|
215
|
+
isInDrawMode: guardMapCore(function () {
|
|
216
|
+
return sdk.isInDrawMode(...arguments);
|
|
217
|
+
}),
|
|
158
218
|
// Routing methods - require servicesReady
|
|
159
|
-
computeRoute: guardRouting((
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
219
|
+
computeRoute: guardRouting(function () {
|
|
220
|
+
return sdk.computeRoute(...arguments);
|
|
221
|
+
}),
|
|
222
|
+
computeRoutes: guardRouting(function () {
|
|
223
|
+
return sdk.computeRoutes(...arguments);
|
|
224
|
+
}),
|
|
225
|
+
setActiveRoute: guardRouting(function () {
|
|
226
|
+
return sdk.setActiveRoute(...arguments);
|
|
227
|
+
}),
|
|
228
|
+
getActiveRoute: guardRouting(function () {
|
|
229
|
+
return sdk.getActiveRoute(...arguments);
|
|
230
|
+
}),
|
|
231
|
+
highlightRouteSegment: guardRouting(function () {
|
|
232
|
+
return sdk.highlightRouteSegment(...arguments);
|
|
233
|
+
}),
|
|
234
|
+
clearRoute: guardRouting(function () {
|
|
235
|
+
return sdk.clearRoute(...arguments);
|
|
236
|
+
}),
|
|
165
237
|
// Pin/Marker methods - require mapCoreReady
|
|
166
|
-
dropPin: guardMapCore((
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
238
|
+
dropPin: guardMapCore(function () {
|
|
239
|
+
return sdk.dropPin(...arguments);
|
|
240
|
+
}),
|
|
241
|
+
dropMarkerForRouting: guardRouting(function () {
|
|
242
|
+
return sdk.dropMarkerForRouting(...arguments);
|
|
243
|
+
}),
|
|
244
|
+
clearMarker: guardMapCore(function () {
|
|
245
|
+
return sdk.clearMarker(...arguments);
|
|
246
|
+
}),
|
|
247
|
+
hidePin: guardMapCore(function () {
|
|
248
|
+
return sdk.hidePin(...arguments);
|
|
249
|
+
}),
|
|
250
|
+
showPin: guardMapCore(function () {
|
|
251
|
+
return sdk.showPin(...arguments);
|
|
252
|
+
}),
|
|
253
|
+
clearPin: guardMapCore(function () {
|
|
254
|
+
return sdk.clearPin(...arguments);
|
|
255
|
+
}),
|
|
256
|
+
clearPins: guardMapCore(function () {
|
|
257
|
+
return sdk.clearPins(...arguments);
|
|
258
|
+
}),
|
|
173
259
|
// Layer methods - require mapCoreReady
|
|
174
|
-
addUserLayer: guardMapCore((
|
|
260
|
+
addUserLayer: guardMapCore(function () {
|
|
261
|
+
return sdk.addUserLayer(...arguments);
|
|
262
|
+
}),
|
|
175
263
|
// Utility methods - require mapCoreReady
|
|
176
|
-
getCoordinates: guardMapCore((
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
264
|
+
getCoordinates: guardMapCore(function () {
|
|
265
|
+
return sdk.getCoordinates(...arguments);
|
|
266
|
+
}),
|
|
267
|
+
getLength: guardMapCore(function () {
|
|
268
|
+
return sdk.getLength(...arguments);
|
|
269
|
+
}),
|
|
270
|
+
getArea: guardMapCore(function () {
|
|
271
|
+
return sdk.getArea(...arguments);
|
|
272
|
+
}),
|
|
273
|
+
changeTerminalInFocusToUserViewpoint: guardMapCore(function () {
|
|
274
|
+
return sdk.changeTerminalInFocusToUserViewpoint(...arguments);
|
|
275
|
+
}),
|
|
276
|
+
isLocationWithinHongKong: guardMapCore(function () {
|
|
277
|
+
return sdk.isLocationWithinHongKong(...arguments);
|
|
278
|
+
}),
|
|
181
279
|
// 3D methods - require mapCoreReady
|
|
182
|
-
getMap3D: guardMapCore((
|
|
280
|
+
getMap3D: guardMapCore(function () {
|
|
281
|
+
return sdk.getMap3D(...arguments);
|
|
282
|
+
}),
|
|
183
283
|
// Analytics methods - require mapCoreReady
|
|
184
|
-
logAnalyticsEvent: guardMapCore((
|
|
284
|
+
logAnalyticsEvent: guardMapCore(function () {
|
|
285
|
+
return sdk.logAnalyticsEvent(...arguments);
|
|
286
|
+
})
|
|
185
287
|
};
|
|
186
288
|
}, [sdk, mapCoreReady, servicesReady, error]);
|
|
187
289
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMetaAtlas.js","names":["useMemo","useMetaAtlasStore","useServicesReady","useMetaAtlas","sdk","state","mapCoreReady","error","servicesReady","noop","noopAsync","Promise","resolve","noopAsyncReject","reject","Error","noopBool","noopString","noopAny","map","focusTo","getCurrentFocus","getCurrentFocusBuilding","getCurrentFocusFloor","getFocusTree","getMapObjectsByName","getMapObjectById","getMapObjectByLocalRef","getMapObjectsByWhatTaxonomy","getMapObjectsByWhereTaxonomy","getMapObjectsByWhatAndWhereTaxonomy","getMapObjectsInWhatTaxonomy","getMapObjectsInWhereTaxonomy","getMapObjectsByFilteredLocalRef","getMapObjectMatchingLocalRef","getMapObjectsMatchingLocalRefs","getMapObjectsByWhatTaxonomyAPI","getWhatTaxonomies","filterWhereDimension","filterLayersByType","filterLayersByCategories","styleLayersByType","clearStyleLayersByType","getLastClickedFeature","getLastClickedDrawing","drawGeometryOnMap","addDrawingsToBaseMap","editDrawing","removeDrawing","getDrawingById","isInDrawMode","computeRoute","computeRoutes","setActiveRoute","getActiveRoute","highlightRouteSegment","clearRoute","dropPin","dropMarkerForRouting","clearMarker","hidePin","showPin","clearPin","clearPins","addUserLayer","getCoordinates","getLength","getArea","changeTerminalInFocusToUserViewpoint","isLocationWithinHongKong","getMap3D","logAnalyticsEvent","guardSearch","fn","args","guardRouting","guardMapCore","guardMapCoreAsync","metaAtlasCore"],"sources":["../../../../src/react/hooks/useMetaAtlas.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useMetaAtlasStore, useServicesReady } from '../stores/useMetaAtlasStore';\nimport { MetaAtlasSdk } from '../../meta-atlas-sdk/meta-atlas-sdk';\nimport { UseMetaAtlasReturn } from '../types';\nimport { EventSource } from '../../meta-atlas-sdk/meta-atlas-sdk';\n\nexport function useMetaAtlas(): UseMetaAtlasReturn {\n const sdk = useMetaAtlasStore((state) => state.sdk);\n const mapCoreReady = useMetaAtlasStore((state) => state.mapCoreReady);\n const error = useMetaAtlasStore((state) => state.error);\n const servicesReady = useServicesReady();\n\n return useMemo(() => {\n if (!sdk) {\n // Return no-op functions when SDK is not ready\n const noop = () => {};\n const noopAsync = () => Promise.resolve([]);\n const noopAsyncReject = () => Promise.reject(new Error('SDK not ready')) as Promise<any>;\n const noopBool = () => false;\n const noopString = () => '';\n const noopAny = () => null;\n \n return {\n sdk: null,\n error,\n map: null,\n focusTo: noop,\n getCurrentFocus: noopString,\n getCurrentFocusBuilding: noopAny,\n getCurrentFocusFloor: noopAny,\n getFocusTree: noopAny,\n getMapObjectsByName: noopAsync,\n getMapObjectById: noopAsync,\n getMapObjectByLocalRef: noopAsync,\n getMapObjectsByWhatTaxonomy: noopAsync,\n getMapObjectsByWhereTaxonomy: noopAsync,\n getMapObjectsByWhatAndWhereTaxonomy: noopAsync,\n getMapObjectsInWhatTaxonomy: noopAsync,\n getMapObjectsInWhereTaxonomy: noopAsync,\n getMapObjectsByFilteredLocalRef: noopAsync,\n getMapObjectMatchingLocalRef: noopAsync,\n getMapObjectsMatchingLocalRefs: noopAsync,\n getMapObjectsByWhatTaxonomyAPI: noopAsync,\n getWhatTaxonomies: noopAny,\n filterWhereDimension: noop,\n filterLayersByType: noop,\n filterLayersByCategories: noop,\n styleLayersByType: noop,\n clearStyleLayersByType: noop,\n getLastClickedFeature: noopAny,\n getLastClickedDrawing: noopAny,\n drawGeometryOnMap: noopBool,\n addDrawingsToBaseMap: noop,\n editDrawing: noopBool,\n removeDrawing: noopBool,\n getDrawingById: noopAny,\n isInDrawMode: noopBool,\n computeRoute: noopAsyncReject,\n computeRoutes: noopAsyncReject, \n setActiveRoute: noop,\n getActiveRoute: noopAny,\n highlightRouteSegment: noop,\n clearRoute: noop,\n dropPin: noopString,\n dropMarkerForRouting: noop,\n clearMarker: noop,\n hidePin: noop,\n showPin: noop,\n clearPin: noop,\n clearPins: noop,\n addUserLayer: noop,\n getCoordinates: noopAny,\n getLength: noopAny,\n getArea: noopAny,\n changeTerminalInFocusToUserViewpoint: noopBool,\n isLocationWithinHongKong: noopBool,\n getMap3D: noopAny,\n logAnalyticsEvent: noop,\n };\n }\n\n // Helper to guard search functions with servicesReady\n // Preserves the original return type (Promise or void)\n const guardSearch = <T extends (...args: any[]) => any>(fn: T): T => {\n return ((...args: Parameters<T>) => {\n if (!servicesReady) {\n const error = new Error('Search services are not ready. Please wait for initialization.');\n // Return rejected promise - TypeScript will handle type compatibility\n return Promise.reject(error) as ReturnType<T>;\n }\n return fn(...args);\n }) as T;\n };\n\n // Helper to guard routing functions with servicesReady\n const guardRouting = <T extends (...args: any[]) => any>(fn: T): T => {\n return ((...args: any[]) => {\n if (!servicesReady) {\n throw new Error('Routing services are not ready. Please wait for initialization.');\n }\n return fn(...args);\n }) as T;\n };\n\n // Helper to guard other functions with mapCoreReady\n const guardMapCore = <T extends (...args: any[]) => any>(fn: T): T => {\n return ((...args: any[]) => {\n if (!mapCoreReady) {\n throw new Error('Map core is not ready. Please wait for initialization.');\n }\n return fn(...args);\n }) as T;\n };\n\n // Helper for async functions that need mapCoreReady\n const guardMapCoreAsync = <T extends (...args: any[]) => Promise<any>>(fn: T): T => {\n return ((...args: any[]) => {\n if (!mapCoreReady) {\n return Promise.reject(new Error('Map core is not ready. Please wait for initialization.'));\n }\n return fn(...args);\n }) as T;\n };\n\n return {\n sdk,\n error,\n map: sdk.map,\n \n // Focus methods - require mapCoreReady\n focusTo: guardMapCore((...args) => sdk.focusTo(...args)),\n getCurrentFocus: guardMapCore((...args) => sdk.getCurrentFocus(...args)),\n getCurrentFocusBuilding: guardMapCore((...args) => sdk.getCurrentFocusBuilding(...args)),\n getCurrentFocusFloor: guardMapCore((...args) => sdk.getCurrentFocusFloor(...args)),\n getFocusTree: ((...args) => sdk.getFocusTree(...args)),\n \n // Search methods - require servicesReady\n getMapObjectsByName: guardSearch((...args) => sdk.getMapObjectsByName(...args)),\n getMapObjectById: guardSearch((...args) => sdk.getMapObjectById(...args)),\n getMapObjectByLocalRef: guardSearch((...args) => sdk.getMapObjectByLocalRef(...args)),\n getMapObjectsByWhatTaxonomy: guardSearch((...args) => sdk.getMapObjectsByWhatTaxonomy(...args)),\n getMapObjectsByWhereTaxonomy: guardSearch((...args) => sdk.getMapObjectsByWhereTaxonomy(...args)),\n getMapObjectsByWhatAndWhereTaxonomy: guardSearch((...args) => sdk.getMapObjectsByWhatAndWhereTaxonomy(...args)),\n getMapObjectsInWhatTaxonomy: guardSearch((...args) => sdk.getMapObjectsInWhatTaxonomy(...args)),\n getMapObjectsInWhereTaxonomy: guardSearch((...args) => sdk.getMapObjectsInWhereTaxonomy(...args)),\n getMapObjectsByFilteredLocalRef: guardSearch((...args) => sdk.getMapObjectsByFilteredLocalRef(...args)),\n getMapObjectMatchingLocalRef: guardSearch((...args) => sdk.getMapObjectMatchingLocalRef(...args)),\n getMapObjectsMatchingLocalRefs: guardSearch((...args) => sdk.getMapObjectsMatchingLocalRefs(...args)),\n getMapObjectsByWhatTaxonomyAPI: guardSearch((...args) => sdk.getMapObjectsByWhatTaxonomyAPI(...args)),\n getWhatTaxonomies: guardMapCore(() => sdk.metaAtlasCore.getWhatTaxonomies()),\n \n // Filtering methods - require mapCoreReady\n filterWhereDimension: guardMapCore((...args) => sdk.filterWhereDimension(...args)),\n filterLayersByType: guardMapCore((...args) => sdk.filterLayersByType(...args)),\n filterLayersByCategories: guardMapCore((...args) => sdk.filterLayersByCategories(...args)),\n styleLayersByType: guardMapCore((...args) => sdk.styleLayersByType(...args)),\n clearStyleLayersByType: guardMapCore((...args) => sdk.clearStyleLayersByType(...args)),\n \n // Click handlers - require mapCoreReady\n getLastClickedFeature: guardMapCore((...args) => sdk.getLastClickedFeature(...args)),\n getLastClickedDrawing: guardMapCore((...args) => sdk.getLastClickedDrawing(...args)),\n \n // Drawing methods - require mapCoreReady\n drawGeometryOnMap: guardMapCore((...args) => sdk.drawGeometryOnMap(...args)),\n addDrawingsToBaseMap: guardMapCore((...args) => sdk.addDrawingsToBaseMap(...args)),\n editDrawing: guardMapCore((...args) => sdk.editDrawing(...args)),\n removeDrawing: guardMapCore((...args) => sdk.removeDrawing(...args)),\n getDrawingById: guardMapCore((...args) => sdk.getDrawingById(...args)),\n isInDrawMode: guardMapCore((...args) => sdk.isInDrawMode(...args)),\n \n // Routing methods - require servicesReady\n computeRoute: guardRouting((...args) => sdk.computeRoute(...args)),\n computeRoutes: guardRouting((...args) => sdk.computeRoutes(...args)),\n setActiveRoute: guardRouting((...args) => sdk.setActiveRoute(...args)),\n getActiveRoute: guardRouting((...args) => sdk.getActiveRoute(...args)),\n highlightRouteSegment: guardRouting((...args) => sdk.highlightRouteSegment(...args)),\n clearRoute: guardRouting((...args) => sdk.clearRoute(...args)),\n \n // Pin/Marker methods - require mapCoreReady\n dropPin: guardMapCore((...args) => sdk.dropPin(...args)),\n dropMarkerForRouting: guardRouting((...args) => sdk.dropMarkerForRouting(...args)),\n clearMarker: guardMapCore((...args) => sdk.clearMarker(...args)),\n hidePin: guardMapCore((...args) => sdk.hidePin(...args)),\n showPin: guardMapCore((...args) => sdk.showPin(...args)),\n clearPin: guardMapCore((...args) => sdk.clearPin(...args)),\n clearPins: guardMapCore((...args) => sdk.clearPins(...args)),\n \n // Layer methods - require mapCoreReady\n addUserLayer: guardMapCore((...args) => sdk.addUserLayer(...args)),\n \n // Utility methods - require mapCoreReady\n getCoordinates: guardMapCore((...args) => sdk.getCoordinates(...args)),\n getLength: guardMapCore((...args) => sdk.getLength(...args)),\n getArea: guardMapCore((...args) => sdk.getArea(...args)),\n changeTerminalInFocusToUserViewpoint: guardMapCore((...args) => sdk.changeTerminalInFocusToUserViewpoint(...args)),\n isLocationWithinHongKong: guardMapCore((...args) => sdk.isLocationWithinHongKong(...args)),\n \n // 3D methods - require mapCoreReady\n getMap3D: guardMapCore((...args) => sdk.getMap3D(...args)),\n \n // Analytics methods - require mapCoreReady\n logAnalyticsEvent: guardMapCore((...args) => sdk.logAnalyticsEvent(...args)),\n };\n }, [sdk, mapCoreReady, servicesReady, error]);\n}\n\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,6BAA6B;AAKjF,OAAO,SAASC,YAAYA,CAAA,EAAuB;EACjD,MAAMC,GAAG,GAAGH,iBAAiB,CAAEI,KAAK,IAAKA,KAAK,CAACD,GAAG,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YAAY,CAAC,CAAC,GAAGF,IAAI,KAAKtE,GAAG,CAAC4D,YAAY,CAAC,GAAGU,IAAI,CAAC,CAAC;MAElE;MACAT,cAAc,EAAEW,YAAY,CAAC,CAAC,GAAGF,IAAI,KAAKtE,GAAG,CAAC6D,cAAc,CAAC,GAAGS,IAAI,CAAC,CAAC;MACtER,SAAS,EAAEU,YAAY,CAAC,CAAC,GAAGF,IAAI,KAAKtE,GAAG,CAAC8D,SAAS,CAAC,GAAGQ,IAAI,CAAC,CAAC;MAC5DP,OAAO,EAAES,YAAY,CAAC,CAAC,GAAGF,IAAI,KAAKtE,GAAG,CAAC+D,OAAO,CAAC,GAAGO,IAAI,CAAC,CAAC;MACxDN,oCAAoC,EAAEQ,YAAY,CAAC,CAAC,GAAGF,IAAI,KAAKtE,GAAG,CAACgE,oCAAoC,CAAC,GAAGM,IAAI,CAAC,CAAC;MAClHL,wBAAwB,EAAEO,YAAY,CAAC,CAAC,GAAGF,IAAI,KAAKtE,GAAG,CAACiE,wBAAwB,CAAC,GAAGK,IAAI,CAAC,CAAC;MAE1F;MACAJ,QAAQ,EAAEM,YAAY,CAAC,CAAC,GAAGF,IAAI,KAAKtE,GAAG,CAACkE,QAAQ,CAAC,GAAGI,IAAI,CAAC,CAAC;MAE1D;MACAH,iBAAiB,EAAEK,YAAY,CAAC,CAAC,GAAGF,IAAI,KAAKtE,GAAG,CAACmE,iBAAiB,CAAC,GAAGG,IAAI,CAAC;IAC7E,CAAC;EACH,CAAC,EAAE,CAACtE,GAAG,EAAEE,YAAY,EAAEE,aAAa,EAAED,KAAK,CAAC,CAAC;AAC/C","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useMetaAtlas.js","names":["useMemo","useMetaAtlasStore","useServicesReady","useMetaAtlas","sdk","state","mapCoreReady","error","servicesReady","noop","noopAsync","Promise","resolve","noopAsyncReject","reject","Error","noopBool","noopString","noopAny","map","focusTo","getCurrentFocus","getCurrentFocusBuilding","getCurrentFocusFloor","getFocusTree","getMapObjectsByName","getMapObjectById","getMapObjectByLocalRef","getMapObjectsByWhatTaxonomy","getMapObjectsByWhereTaxonomy","getMapObjectsByWhatAndWhereTaxonomy","getMapObjectsInWhatTaxonomy","getMapObjectsInWhereTaxonomy","getMapObjectsByFilteredLocalRef","getMapObjectMatchingLocalRef","getMapObjectsMatchingLocalRefs","getMapObjectsByWhatTaxonomyAPI","getWhatTaxonomies","filterWhereDimension","filterLayersByType","filterLayersByCategories","styleLayersByType","clearStyleLayersByType","getLastClickedFeature","getLastClickedDrawing","drawGeometryOnMap","addDrawingsToBaseMap","editDrawing","removeDrawing","getDrawingById","isInDrawMode","computeRoute","computeRoutes","setActiveRoute","getActiveRoute","highlightRouteSegment","clearRoute","dropPin","dropMarkerForRouting","clearMarker","hidePin","showPin","clearPin","clearPins","addUserLayer","getCoordinates","getLength","getArea","changeTerminalInFocusToUserViewpoint","isLocationWithinHongKong","getMap3D","logAnalyticsEvent","guardSearch","fn","arguments","guardRouting","guardMapCore","guardMapCoreAsync","metaAtlasCore"],"sources":["../../../../src/react/hooks/useMetaAtlas.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useMetaAtlasStore, useServicesReady } from '../stores/useMetaAtlasStore';\nimport { MetaAtlasSdk } from '../../meta-atlas-sdk/meta-atlas-sdk';\nimport { UseMetaAtlasReturn } from '../types';\nimport { EventSource } from '../../meta-atlas-sdk/meta-atlas-sdk';\n\nexport function useMetaAtlas(): UseMetaAtlasReturn {\n const sdk = useMetaAtlasStore((state) => state.sdk);\n const mapCoreReady = useMetaAtlasStore((state) => state.mapCoreReady);\n const error = useMetaAtlasStore((state) => state.error);\n const servicesReady = useServicesReady();\n\n return useMemo(() => {\n if (!sdk) {\n // Return no-op functions when SDK is not ready\n const noop = () => {};\n const noopAsync = () => Promise.resolve([]);\n const noopAsyncReject = () => Promise.reject(new Error('SDK not ready')) as Promise<any>;\n const noopBool = () => false;\n const noopString = () => '';\n const noopAny = () => null;\n \n return {\n sdk: null,\n error,\n map: null,\n focusTo: noop,\n getCurrentFocus: noopString,\n getCurrentFocusBuilding: noopAny,\n getCurrentFocusFloor: noopAny,\n getFocusTree: noopAny,\n getMapObjectsByName: noopAsync,\n getMapObjectById: noopAsync,\n getMapObjectByLocalRef: noopAsync,\n getMapObjectsByWhatTaxonomy: noopAsync,\n getMapObjectsByWhereTaxonomy: noopAsync,\n getMapObjectsByWhatAndWhereTaxonomy: noopAsync,\n getMapObjectsInWhatTaxonomy: noopAsync,\n getMapObjectsInWhereTaxonomy: noopAsync,\n getMapObjectsByFilteredLocalRef: noopAsync,\n getMapObjectMatchingLocalRef: noopAsync,\n getMapObjectsMatchingLocalRefs: noopAsync,\n getMapObjectsByWhatTaxonomyAPI: noopAsync,\n getWhatTaxonomies: noopAny,\n filterWhereDimension: noop,\n filterLayersByType: noop,\n filterLayersByCategories: noop,\n styleLayersByType: noop,\n clearStyleLayersByType: noop,\n getLastClickedFeature: noopAny,\n getLastClickedDrawing: noopAny,\n drawGeometryOnMap: noopBool,\n addDrawingsToBaseMap: noop,\n editDrawing: noopBool,\n removeDrawing: noopBool,\n getDrawingById: noopAny,\n isInDrawMode: noopBool,\n computeRoute: noopAsyncReject,\n computeRoutes: noopAsyncReject, \n setActiveRoute: noop,\n getActiveRoute: noopAny,\n highlightRouteSegment: noop,\n clearRoute: noop,\n dropPin: noopString,\n dropMarkerForRouting: noop,\n clearMarker: noop,\n hidePin: noop,\n showPin: noop,\n clearPin: noop,\n clearPins: noop,\n addUserLayer: noop,\n getCoordinates: noopAny,\n getLength: noopAny,\n getArea: noopAny,\n changeTerminalInFocusToUserViewpoint: noopBool,\n isLocationWithinHongKong: noopBool,\n getMap3D: noopAny,\n logAnalyticsEvent: noop,\n };\n }\n\n // Helper to guard search functions with servicesReady\n // Preserves the original return type (Promise or void)\n const guardSearch = <T extends (...args: any[]) => any>(fn: T): T => {\n return ((...args: Parameters<T>) => {\n if (!servicesReady) {\n const error = new Error('Search services are not ready. Please wait for initialization.');\n // Return rejected promise - TypeScript will handle type compatibility\n return Promise.reject(error) as ReturnType<T>;\n }\n return fn(...args);\n }) as T;\n };\n\n // Helper to guard routing functions with servicesReady\n const guardRouting = <T extends (...args: any[]) => any>(fn: T): T => {\n return ((...args: any[]) => {\n if (!servicesReady) {\n throw new Error('Routing services are not ready. Please wait for initialization.');\n }\n return fn(...args);\n }) as T;\n };\n\n // Helper to guard other functions with mapCoreReady\n const guardMapCore = <T extends (...args: any[]) => any>(fn: T): T => {\n return ((...args: any[]) => {\n if (!mapCoreReady) {\n throw new Error('Map core is not ready. Please wait for initialization.');\n }\n return fn(...args);\n }) as T;\n };\n\n // Helper for async functions that need mapCoreReady\n const guardMapCoreAsync = <T extends (...args: any[]) => Promise<any>>(fn: T): T => {\n return ((...args: any[]) => {\n if (!mapCoreReady) {\n return Promise.reject(new Error('Map core is not ready. Please wait for initialization.'));\n }\n return fn(...args);\n }) as T;\n };\n\n return {\n sdk,\n error,\n map: sdk.map,\n \n // Focus methods - require mapCoreReady\n focusTo: guardMapCore((...args) => sdk.focusTo(...args)),\n getCurrentFocus: guardMapCore((...args) => sdk.getCurrentFocus(...args)),\n getCurrentFocusBuilding: guardMapCore((...args) => sdk.getCurrentFocusBuilding(...args)),\n getCurrentFocusFloor: guardMapCore((...args) => sdk.getCurrentFocusFloor(...args)),\n getFocusTree: ((...args) => sdk.getFocusTree(...args)),\n \n // Search methods - require servicesReady\n getMapObjectsByName: guardSearch((...args) => sdk.getMapObjectsByName(...args)),\n getMapObjectById: guardSearch((...args) => sdk.getMapObjectById(...args)),\n getMapObjectByLocalRef: guardSearch((...args) => sdk.getMapObjectByLocalRef(...args)),\n getMapObjectsByWhatTaxonomy: guardSearch((...args) => sdk.getMapObjectsByWhatTaxonomy(...args)),\n getMapObjectsByWhereTaxonomy: guardSearch((...args) => sdk.getMapObjectsByWhereTaxonomy(...args)),\n getMapObjectsByWhatAndWhereTaxonomy: guardSearch((...args) => sdk.getMapObjectsByWhatAndWhereTaxonomy(...args)),\n getMapObjectsInWhatTaxonomy: guardSearch((...args) => sdk.getMapObjectsInWhatTaxonomy(...args)),\n getMapObjectsInWhereTaxonomy: guardSearch((...args) => sdk.getMapObjectsInWhereTaxonomy(...args)),\n getMapObjectsByFilteredLocalRef: guardSearch((...args) => sdk.getMapObjectsByFilteredLocalRef(...args)),\n getMapObjectMatchingLocalRef: guardSearch((...args) => sdk.getMapObjectMatchingLocalRef(...args)),\n getMapObjectsMatchingLocalRefs: guardSearch((...args) => sdk.getMapObjectsMatchingLocalRefs(...args)),\n getMapObjectsByWhatTaxonomyAPI: guardSearch((...args) => sdk.getMapObjectsByWhatTaxonomyAPI(...args)),\n getWhatTaxonomies: guardMapCore(() => sdk.metaAtlasCore.getWhatTaxonomies()),\n \n // Filtering methods - require mapCoreReady\n filterWhereDimension: guardMapCore((...args) => sdk.filterWhereDimension(...args)),\n filterLayersByType: guardMapCore((...args) => sdk.filterLayersByType(...args)),\n filterLayersByCategories: guardMapCore((...args) => sdk.filterLayersByCategories(...args)),\n styleLayersByType: guardMapCore((...args) => sdk.styleLayersByType(...args)),\n clearStyleLayersByType: guardMapCore((...args) => sdk.clearStyleLayersByType(...args)),\n \n // Click handlers - require mapCoreReady\n getLastClickedFeature: guardMapCore((...args) => sdk.getLastClickedFeature(...args)),\n getLastClickedDrawing: guardMapCore((...args) => sdk.getLastClickedDrawing(...args)),\n \n // Drawing methods - require mapCoreReady\n drawGeometryOnMap: guardMapCore((...args) => sdk.drawGeometryOnMap(...args)),\n addDrawingsToBaseMap: guardMapCore((...args) => sdk.addDrawingsToBaseMap(...args)),\n editDrawing: guardMapCore((...args) => sdk.editDrawing(...args)),\n removeDrawing: guardMapCore((...args) => sdk.removeDrawing(...args)),\n getDrawingById: guardMapCore((...args) => sdk.getDrawingById(...args)),\n isInDrawMode: guardMapCore((...args) => sdk.isInDrawMode(...args)),\n \n // Routing methods - require servicesReady\n computeRoute: guardRouting((...args) => sdk.computeRoute(...args)),\n computeRoutes: guardRouting((...args) => sdk.computeRoutes(...args)),\n setActiveRoute: guardRouting((...args) => sdk.setActiveRoute(...args)),\n getActiveRoute: guardRouting((...args) => sdk.getActiveRoute(...args)),\n highlightRouteSegment: guardRouting((...args) => sdk.highlightRouteSegment(...args)),\n clearRoute: guardRouting((...args) => sdk.clearRoute(...args)),\n \n // Pin/Marker methods - require mapCoreReady\n dropPin: guardMapCore((...args) => sdk.dropPin(...args)),\n dropMarkerForRouting: guardRouting((...args) => sdk.dropMarkerForRouting(...args)),\n clearMarker: guardMapCore((...args) => sdk.clearMarker(...args)),\n hidePin: guardMapCore((...args) => sdk.hidePin(...args)),\n showPin: guardMapCore((...args) => sdk.showPin(...args)),\n clearPin: guardMapCore((...args) => sdk.clearPin(...args)),\n clearPins: guardMapCore((...args) => sdk.clearPins(...args)),\n \n // Layer methods - require mapCoreReady\n addUserLayer: guardMapCore((...args) => sdk.addUserLayer(...args)),\n \n // Utility methods - require mapCoreReady\n getCoordinates: guardMapCore((...args) => sdk.getCoordinates(...args)),\n getLength: guardMapCore((...args) => sdk.getLength(...args)),\n getArea: guardMapCore((...args) => sdk.getArea(...args)),\n changeTerminalInFocusToUserViewpoint: guardMapCore((...args) => sdk.changeTerminalInFocusToUserViewpoint(...args)),\n isLocationWithinHongKong: guardMapCore((...args) => sdk.isLocationWithinHongKong(...args)),\n \n // 3D methods - require mapCoreReady\n getMap3D: guardMapCore((...args) => sdk.getMap3D(...args)),\n \n // Analytics methods - require mapCoreReady\n logAnalyticsEvent: guardMapCore((...args) => sdk.logAnalyticsEvent(...args)),\n };\n }, [sdk, mapCoreReady, servicesReady, error]);\n}\n\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAAC,SACvBC,iBAAiB,EAAEC,gBAAgB;AAK5C,OAAO,SAASC,YAAYA,CAAA,EAAuB;EACjD,MAAMC,GAAG,GAAGH,iBAAiB,CAAEI,KAAK,IAAKA,KAAK,CAACD,GAAG,CAAC;EACnD,MAAME,YAAY,GAAGL,iBAAiB,CAAEI,K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QAAA,OAAaxE,GAAG,CAACgE,oCAAoC,CAAC,GAAAM,SAAO,CAAC;MAAA,EAAC;MAClHL,wBAAwB,EAAEO,YAAY,CAAC;QAAA,OAAaxE,GAAG,CAACiE,wBAAwB,CAAC,GAAAK,SAAO,CAAC;MAAA,EAAC;MAE1F;MACAJ,QAAQ,EAAEM,YAAY,CAAC;QAAA,OAAaxE,GAAG,CAACkE,QAAQ,CAAC,GAAAI,SAAO,CAAC;MAAA,EAAC;MAE1D;MACAH,iBAAiB,EAAEK,YAAY,CAAC;QAAA,OAAaxE,GAAG,CAACmE,iBAAiB,CAAC,GAAAG,SAAO,CAAC;MAAA;IAC7E,CAAC;EACH,CAAC,EAAE,CAACtE,GAAG,EAAEE,YAAY,EAAEE,aAAa,EAAED,KAAK,CAAC,CAAC;AAC/C","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useMetaAtlas } from
|
|
2
|
-
import { useServicesReady } from
|
|
1
|
+
import { useMetaAtlas } from "../useMetaAtlas/index.js";
|
|
2
|
+
import { useServicesReady } from "../../stores/useMetaAtlasStore.js";
|
|
3
3
|
export function useRouting() {
|
|
4
4
|
const {
|
|
5
5
|
computeRoute,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useMetaAtlas","useServicesReady","useRouting","computeRoute","computeRoutes","setActiveRoute","getActiveRoute","highlightRouteSegment","clearRoute","clearMarker","dropMarkerForRouting","servicesReady","isReady"],"sources":["../../../../../src/react/hooks/useRouting/index.ts"],"sourcesContent":["import { useMetaAtlas } from '../useMetaAtlas';\nimport { useServicesReady } from '../../stores/useMetaAtlasStore';\nimport { UseRoutingReturn } from './types';\n\nexport function useRouting(): UseRoutingReturn {\n const { \n computeRoute, \n computeRoutes, \n setActiveRoute, \n getActiveRoute, \n highlightRouteSegment, \n clearRoute,\n clearMarker,\n dropMarkerForRouting\n } = useMetaAtlas();\n \n const servicesReady = useServicesReady();\n\n return {\n computeRoute,\n computeRoutes,\n setActiveRoute,\n getActiveRoute,\n highlightRouteSegment,\n clearRoute,\n clearMarker,\n dropMarkerForRouting,\n isReady: servicesReady, // Use servicesReady flag\n };\n}\n\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["useMetaAtlas","useServicesReady","useRouting","computeRoute","computeRoutes","setActiveRoute","getActiveRoute","highlightRouteSegment","clearRoute","clearMarker","dropMarkerForRouting","servicesReady","isReady"],"sources":["../../../../../src/react/hooks/useRouting/index.ts"],"sourcesContent":["import { useMetaAtlas } from '../useMetaAtlas';\nimport { useServicesReady } from '../../stores/useMetaAtlasStore';\nimport { UseRoutingReturn } from './types';\n\nexport function useRouting(): UseRoutingReturn {\n const { \n computeRoute, \n computeRoutes, \n setActiveRoute, \n getActiveRoute, \n highlightRouteSegment, \n clearRoute,\n clearMarker,\n dropMarkerForRouting\n } = useMetaAtlas();\n \n const servicesReady = useServicesReady();\n\n return {\n computeRoute,\n computeRoutes,\n setActiveRoute,\n getActiveRoute,\n highlightRouteSegment,\n clearRoute,\n clearMarker,\n dropMarkerForRouting,\n isReady: servicesReady, // Use servicesReady flag\n };\n}\n\n"],"mappings":"SAASA,YAAY;AAAA,SACZC,gBAAgB;AAGzB,OAAO,SAASC,UAAUA,CAAA,EAAqB;EAC7C,MAAM;IACJC,YAAY;IACZC,aAAa;IACbC,cAAc;IACdC,cAAc;IACdC,qBAAqB;IACrBC,UAAU;IACVC,WAAW;IACXC;EACF,CAAC,GAAGV,YAAY,CAAC,CAAC;EAElB,MAAMW,aAAa,GAAGV,gBAAgB,CAAC,CAAC;EAExC,OAAO;IACLE,YAAY;IACZC,aAAa;IACbC,cAAc;IACdC,cAAc;IACdC,qBAAqB;IACrBC,UAAU;IACVC,WAAW;IACXC,oBAAoB;IACpBE,OAAO,EAAED,aAAa,CAAE;EAC1B,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useMetaAtlas } from
|
|
2
|
-
import { useServicesReady } from
|
|
1
|
+
import { useMetaAtlas } from "../useMetaAtlas/index.js";
|
|
2
|
+
import { useServicesReady } from "../../stores/useMetaAtlasStore.js";
|
|
3
3
|
export function useSearch() {
|
|
4
4
|
const {
|
|
5
5
|
getMapObjectsByName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useMetaAtlas","useServicesReady","useSearch","getMapObjectsByName","getMapObjectById","getMapObjectByLocalRef","getMapObjectsByWhatTaxonomy","getMapObjectsByWhereTaxonomy","getMapObjectsByWhatAndWhereTaxonomy","getMapObjectsInWhatTaxonomy","getMapObjectsInWhereTaxonomy","getMapObjectsByFilteredLocalRef","getMapObjectMatchingLocalRef","getMapObjectsMatchingLocalRefs","getMapObjectsByWhatTaxonomyAPI","getWhatTaxonomies","servicesReady","getAllMetaFeatures","Promise","resolve","result","isReady"],"sources":["../../../../../src/react/hooks/useSearch/index.ts"],"sourcesContent":["import { useMetaAtlas } from '../useMetaAtlas';\nimport { useServicesReady } from '../../stores/useMetaAtlasStore';\nimport { UseSearchReturn } from './types';\nimport { metaFeature } from '../../../meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core';\n\nexport function useSearch(): UseSearchReturn {\n const { \n getMapObjectsByName,\n getMapObjectById,\n getMapObjectByLocalRef,\n getMapObjectsByWhatTaxonomy,\n getMapObjectsByWhereTaxonomy,\n getMapObjectsByWhatAndWhereTaxonomy,\n getMapObjectsInWhatTaxonomy,\n getMapObjectsInWhereTaxonomy,\n getMapObjectsByFilteredLocalRef,\n getMapObjectMatchingLocalRef,\n getMapObjectsMatchingLocalRefs,\n getMapObjectsByWhatTaxonomyAPI,\n getWhatTaxonomies,\n } = useMetaAtlas();\n \n const servicesReady = useServicesReady();\n\n /**\n * Gets all metafeatures by calling getMapObjectsByWhatTaxonomy.\n * @returns Promise that resolves to an array of metaFeatures.\n */\n const getAllMetaFeatures = (): Promise<metaFeature[]> => {\n return new Promise((resolve) => {\n getMapObjectsByWhatTaxonomy('', (result: metaFeature[]) => {\n resolve(result);\n });\n });\n };\n\n\n return {\n getMapObjectsByName,\n getMapObjectById,\n getMapObjectByLocalRef,\n getMapObjectsByWhatTaxonomy,\n getMapObjectsByWhereTaxonomy,\n getMapObjectsByWhatAndWhereTaxonomy,\n getMapObjectsInWhatTaxonomy,\n getMapObjectsInWhereTaxonomy,\n getMapObjectsByFilteredLocalRef,\n getMapObjectMatchingLocalRef,\n getMapObjectsMatchingLocalRefs,\n getMapObjectsByWhatTaxonomyAPI,\n getWhatTaxonomies,\n isReady: servicesReady, // Use servicesReady flag\n // getters\n getAllMetaFeatures\n };\n}\n\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["useMetaAtlas","useServicesReady","useSearch","getMapObjectsByName","getMapObjectById","getMapObjectByLocalRef","getMapObjectsByWhatTaxonomy","getMapObjectsByWhereTaxonomy","getMapObjectsByWhatAndWhereTaxonomy","getMapObjectsInWhatTaxonomy","getMapObjectsInWhereTaxonomy","getMapObjectsByFilteredLocalRef","getMapObjectMatchingLocalRef","getMapObjectsMatchingLocalRefs","getMapObjectsByWhatTaxonomyAPI","getWhatTaxonomies","servicesReady","getAllMetaFeatures","Promise","resolve","result","isReady"],"sources":["../../../../../src/react/hooks/useSearch/index.ts"],"sourcesContent":["import { useMetaAtlas } from '../useMetaAtlas';\nimport { useServicesReady } from '../../stores/useMetaAtlasStore';\nimport { UseSearchReturn } from './types';\nimport { metaFeature } from '../../../meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core';\n\nexport function useSearch(): UseSearchReturn {\n const { \n getMapObjectsByName,\n getMapObjectById,\n getMapObjectByLocalRef,\n getMapObjectsByWhatTaxonomy,\n getMapObjectsByWhereTaxonomy,\n getMapObjectsByWhatAndWhereTaxonomy,\n getMapObjectsInWhatTaxonomy,\n getMapObjectsInWhereTaxonomy,\n getMapObjectsByFilteredLocalRef,\n getMapObjectMatchingLocalRef,\n getMapObjectsMatchingLocalRefs,\n getMapObjectsByWhatTaxonomyAPI,\n getWhatTaxonomies,\n } = useMetaAtlas();\n \n const servicesReady = useServicesReady();\n\n /**\n * Gets all metafeatures by calling getMapObjectsByWhatTaxonomy.\n * @returns Promise that resolves to an array of metaFeatures.\n */\n const getAllMetaFeatures = (): Promise<metaFeature[]> => {\n return new Promise((resolve) => {\n getMapObjectsByWhatTaxonomy('', (result: metaFeature[]) => {\n resolve(result);\n });\n });\n };\n\n\n return {\n getMapObjectsByName,\n getMapObjectById,\n getMapObjectByLocalRef,\n getMapObjectsByWhatTaxonomy,\n getMapObjectsByWhereTaxonomy,\n getMapObjectsByWhatAndWhereTaxonomy,\n getMapObjectsInWhatTaxonomy,\n getMapObjectsInWhereTaxonomy,\n getMapObjectsByFilteredLocalRef,\n getMapObjectMatchingLocalRef,\n getMapObjectsMatchingLocalRefs,\n getMapObjectsByWhatTaxonomyAPI,\n getWhatTaxonomies,\n isReady: servicesReady, // Use servicesReady flag\n // getters\n getAllMetaFeatures\n };\n}\n\n"],"mappings":"SAASA,YAAY;AAAA,SACZC,gBAAgB;AAIzB,OAAO,SAASC,SAASA,CAAA,EAAoB;EAC3C,MAAM;IACJC,mBAAmB;IACnBC,gBAAgB;IAChBC,sBAAsB;IACtBC,2BAA2B;IAC3BC,4BAA4B;IAC5BC,mCAAmC;IACnCC,2BAA2B;IAC3BC,4BAA4B;IAC5BC,+BAA+B;IAC/BC,4BAA4B;IAC5BC,8BAA8B;IAC9BC,8BAA8B;IAC9BC;EACF,CAAC,GAAGf,YAAY,CAAC,CAAC;EAElB,MAAMgB,aAAa,GAAGf,gBAAgB,CAAC,CAAC;;EAExC;AACF;AACA;AACA;EACE,MAAMgB,kBAAkB,GAAGA,CAAA,KAA8B;IACvD,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;MAC9Bb,2BAA2B,CAAC,EAAE,EAAGc,MAAqB,IAAK;QACzDD,OAAO,CAACC,MAAM,CAAC;MACjB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC;EAGD,OAAO;IACLjB,mBAAmB;IACnBC,gBAAgB;IAChBC,sBAAsB;IACtBC,2BAA2B;IAC3BC,4BAA4B;IAC5BC,mCAAmC;IACnCC,2BAA2B;IAC3BC,4BAA4B;IAC5BC,+BAA+B;IAC/BC,4BAA4B;IAC5BC,8BAA8B;IAC9BC,8BAA8B;IAC9BC,iBAAiB;IACjBM,OAAO,EAAEL,aAAa;IAAE;IACxB;IACAC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useMetaAtlas } from
|
|
2
|
-
import { useServicesReady } from
|
|
3
|
-
import { getStampFeatures } from
|
|
1
|
+
import { useMetaAtlas } from "../useMetaAtlas/index.js";
|
|
2
|
+
import { useServicesReady } from "../../stores/useMetaAtlasStore.js";
|
|
3
|
+
import { getStampFeatures } from "./utils.js";
|
|
4
4
|
export function useStampRally() {
|
|
5
5
|
const {
|
|
6
6
|
map
|
|
@@ -35,10 +35,11 @@ export function useStampRally() {
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
Promise.all(logos.map(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
Promise.all(logos.map(_ref => {
|
|
39
|
+
let {
|
|
40
|
+
name,
|
|
41
|
+
url
|
|
42
|
+
} = _ref;
|
|
42
43
|
const imgName = name == 'stamp_locked' ? name : `stamp-${name}`;
|
|
43
44
|
return loadImageAsync(map, imgName, url);
|
|
44
45
|
})).then(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useMetaAtlas","useServicesReady","getStampFeatures","useStampRally","map","servicesReady","setUpStampRally","logos","Promise","resolve","console","error","loadImageAsync","id","url","reject","hasImage","loadImage","image","addImage","log","all","name","imgName","then","getSource","addSource","type","data","features","addLayer","source","layout","undefined","catch","showStamps","stamps","pointFeatures","setData","hideStamps","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":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["useMetaAtlas","useServicesReady","getStampFeatures","useStampRally","map","servicesReady","setUpStampRally","logos","Promise","resolve","console","error","loadImageAsync","id","url","reject","hasImage","loadImage","image","addImage","log","all","_ref","name","imgName","then","getSource","addSource","type","data","features","addLayer","source","layout","undefined","catch","showStamps","stamps","pointFeatures","setData","hideStamps","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":"SAASA,YAAY;AAAA,SACZC,gBAAgB;AAAA,SAEhBC,gBAAgB;AAEzB,OAAO,SAASC,aAAaA,CAAA,EAAwB;EACnD,MAAM;IAAEC;EAAI,CAAC,GAAGJ,YAAY,CAAC,CAAC;EAE9B,MAAMK,aAAa,GAAGJ,gBAAgB,CAAC,CAAC;;EAExC;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMK,eAAe,GAAIC,KAAoC,IAAu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lib/esm/react/index.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
// Main React component
|
|
2
|
-
export { MetaAtlasMap } from
|
|
2
|
+
export { MetaAtlasMap } from "./MetaAtlasMap.js";
|
|
3
3
|
// Stores
|
|
4
|
-
export { useMetaAtlasStore, useServicesReady } from
|
|
5
|
-
export { useMapDataStore } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export { useMapOverlays } from './hooks/useMapOverlays';
|
|
15
|
-
export { useStampRally } from './hooks/useStampRally';
|
|
16
|
-
|
|
17
|
-
// Types
|
|
4
|
+
export { useMetaAtlasStore, useServicesReady } from "./stores/useMetaAtlasStore.js";
|
|
5
|
+
export { useMapDataStore } from "./stores/useMapDataStore.js"; // Hooks
|
|
6
|
+
export { useMetaAtlas } from "./hooks/useMetaAtlas/index.js";
|
|
7
|
+
export { useFocus } from "./hooks/useFocus/index.js";
|
|
8
|
+
export { useRouting } from "./hooks/useRouting/index.js";
|
|
9
|
+
export { useSearch } from "./hooks/useSearch/index.js";
|
|
10
|
+
export { useDrawing } from "./hooks/useDrawing/index.js";
|
|
11
|
+
export { useMapEvents } from "./hooks/useMapEvents/index.js";
|
|
12
|
+
export { useMapOverlays } from "./hooks/useMapOverlays/index.js";
|
|
13
|
+
export { useStampRally } from "./hooks/useStampRally/index.js"; // Types
|
|
18
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MetaAtlasMap","useMetaAtlasStore","useServicesReady","useMapDataStore","useMetaAtlas","useFocus","useRouting","useSearch","useDrawing","useMapEvents","useMapOverlays","useStampRally"],"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":"AAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["MetaAtlasMap","useMetaAtlasStore","useServicesReady","useMapDataStore","useMetaAtlas","useFocus","useRouting","useSearch","useDrawing","useMapEvents","useMapOverlays","useStampRally"],"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":"AAAA;AAAA,SACSA,YAAY;AAGrB;AAAA,SACSC,iBAAiB,EAAEC,gBAAgB;AAAA,SACnCC,eAAe,uCAExB;AAAA,SACSC,YAAY;AAAA,SACZC,QAAQ;AAAA,SACRC,UAAU;AAAA,SACVC,SAAS;AAAA,SACTC,UAAU;AAAA,SACVC,YAAY;AAAA,SACZC,cAAc;AAAA,SACdC,aAAa,0CAEtB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twinmatrix/spatialverse-sdk-web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Spatialverse SDK for Web",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"clean": "rimraf lib",
|
|
29
29
|
"declarations": "tsc -p tsconfig.json",
|
|
30
|
-
"build:esm": "cross-env BABEL_ENV=esmUnbundled babel src --extensions '.ts' --out-dir 'lib/esm' --source-maps",
|
|
31
|
-
"build:cjs": "cross-env BABEL_ENV=cjs babel src --extensions '.ts' --out-dir 'lib/cjs' --source-maps",
|
|
30
|
+
"build:esm": "cross-env BABEL_ENV=esmUnbundled babel src --extensions '.ts,.tsx' --out-dir 'lib/esm' --source-maps && node fix-json-imports.js",
|
|
31
|
+
"build:cjs": "cross-env BABEL_ENV=cjs babel src --extensions '.ts,.tsx' --out-dir 'lib/cjs' --source-maps && node fix-json-imports.js",
|
|
32
32
|
"build:bundles": "cross-env BABEL_ENV=esmBundled rollup -c",
|
|
33
33
|
"build": "npm-run-all -l clean -p build:esm build:cjs build:bundles declarations",
|
|
34
34
|
"test": "jest"
|
|
@@ -51,16 +51,19 @@
|
|
|
51
51
|
"homepage": "https://github.com/TwinMatrixOrg/twinmatrix-atoms-legacy-sdk#readme",
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/cli": "^7.12.10",
|
|
54
|
-
"@babel/core": "^7.
|
|
55
|
-
"@babel/preset-env": "^7.
|
|
56
|
-
"@babel/preset-
|
|
54
|
+
"@babel/core": "^7.28.6",
|
|
55
|
+
"@babel/preset-env": "^7.28.6",
|
|
56
|
+
"@babel/preset-react": "^7.28.5",
|
|
57
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
57
58
|
"@rollup/plugin-babel": "^5.2.3",
|
|
58
59
|
"@rollup/plugin-commonjs": "^23.0.4",
|
|
59
60
|
"@rollup/plugin-json": "^6.0.0",
|
|
60
61
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
61
62
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
62
63
|
"@types/jest": "^27.4.1",
|
|
64
|
+
"babel-plugin-add-import-extension": "^1.6.0",
|
|
63
65
|
"cross-env": "^7.0.3",
|
|
66
|
+
"glob": "^13.0.0",
|
|
64
67
|
"jest": "^27.5.1",
|
|
65
68
|
"npm-run-all": "^4.1.5",
|
|
66
69
|
"prettier": "^2.2.1",
|