@twinmatrix/spatialverse-sdk-web 0.0.3 → 0.0.5

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.
Files changed (111) hide show
  1. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +2 -2
  2. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
  3. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.js +293 -0
  4. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.js.map +1 -0
  5. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.js +35 -0
  6. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.js.map +1 -0
  7. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.js +33 -0
  8. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.js.map +1 -0
  9. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.js +307 -0
  10. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.js.map +1 -0
  11. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +4 -3
  12. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
  13. package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js +202 -198
  14. package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
  15. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +3 -3
  16. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
  17. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/focustree.json +121 -0
  18. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +32 -29
  19. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
  20. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +10 -13
  21. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
  22. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +55 -68
  23. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
  24. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +12 -12
  25. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
  26. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/whatTaxonomies.json +170 -0
  27. package/lib/cjs/meta-atlas-sdk/combined_style.json +2313 -0
  28. package/lib/cjs/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js +166 -0
  29. package/lib/cjs/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js.map +1 -0
  30. package/lib/cjs/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js +229 -0
  31. package/lib/cjs/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js.map +1 -0
  32. package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js +73 -69
  33. package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
  34. package/lib/cjs/meta-atlas-sdk/utils/helpers.js +1 -1
  35. package/lib/cjs/meta-atlas-sdk/utils/helpers.js.map +1 -1
  36. package/lib/cjs/meta-atlas-sdk/utils/local-storage.js +6 -1
  37. package/lib/cjs/meta-atlas-sdk/utils/local-storage.js.map +1 -1
  38. package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js +103 -103
  39. package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
  40. package/lib/cjs/react/MetaAtlasMap.js +4 -4
  41. package/lib/cjs/react/MetaAtlasMap.js.map +1 -1
  42. package/lib/cjs/react/hooks/useMapEvents/index.js +6 -3
  43. package/lib/cjs/react/hooks/useMapEvents/index.js.map +1 -1
  44. package/lib/cjs/react/hooks/useStampRally/index.js +7 -5
  45. package/lib/cjs/react/hooks/useStampRally/index.js.map +1 -1
  46. package/lib/cjs/react/hooks/useStampRally/utils.js +1 -1
  47. package/lib/cjs/react/hooks/useStampRally/utils.js.map +1 -1
  48. package/lib/cjs/react/stores/useMapDataStore.js +17 -21
  49. package/lib/cjs/react/stores/useMapDataStore.js.map +1 -1
  50. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +2 -2
  51. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
  52. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.js +286 -0
  53. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.js.map +1 -0
  54. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.js +27 -0
  55. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.js.map +1 -0
  56. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.js +27 -0
  57. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.js.map +1 -0
  58. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.js +305 -0
  59. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.js.map +1 -0
  60. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +4 -3
  61. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
  62. package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js +202 -198
  63. package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
  64. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +3 -3
  65. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
  66. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/focustree.json +121 -0
  67. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +32 -29
  68. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
  69. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +10 -8
  70. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
  71. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +55 -68
  72. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
  73. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +12 -12
  74. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
  75. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/whatTaxonomies.json +170 -0
  76. package/lib/esm/meta-atlas-sdk/combined_style.json +2313 -0
  77. package/lib/esm/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js +158 -0
  78. package/lib/esm/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js.map +1 -0
  79. package/lib/esm/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js +221 -0
  80. package/lib/esm/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js.map +1 -0
  81. package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js +73 -68
  82. package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
  83. package/lib/esm/meta-atlas-sdk/utils/helpers.js +1 -1
  84. package/lib/esm/meta-atlas-sdk/utils/helpers.js.map +1 -1
  85. package/lib/esm/meta-atlas-sdk/utils/local-storage.js +6 -1
  86. package/lib/esm/meta-atlas-sdk/utils/local-storage.js.map +1 -1
  87. package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js +103 -101
  88. package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
  89. package/lib/esm/react/MetaAtlasMap.js +4 -4
  90. package/lib/esm/react/MetaAtlasMap.js.map +1 -1
  91. package/lib/esm/react/hooks/useMapEvents/index.js +6 -3
  92. package/lib/esm/react/hooks/useMapEvents/index.js.map +1 -1
  93. package/lib/esm/react/hooks/useStampRally/index.js +7 -5
  94. package/lib/esm/react/hooks/useStampRally/index.js.map +1 -1
  95. package/lib/esm/react/hooks/useStampRally/utils.js +1 -1
  96. package/lib/esm/react/hooks/useStampRally/utils.js.map +1 -1
  97. package/lib/esm/react/stores/useMapDataStore.js +17 -21
  98. package/lib/esm/react/stores/useMapDataStore.js.map +1 -1
  99. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts +30 -0
  100. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts.map +1 -0
  101. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts +5 -0
  102. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts.map +1 -0
  103. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts +21 -0
  104. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts.map +1 -0
  105. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts +27 -0
  106. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts.map +1 -0
  107. package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts +18 -0
  108. package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts.map +1 -0
  109. package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts +37 -0
  110. package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts.map +1 -0
  111. package/package.json +4 -4
@@ -26,7 +26,11 @@ var _customerLayerVariant = _interopRequireDefault(require("./customerLayerVaria
26
26
  var _booleanPointInPolygon = _interopRequireDefault(require("@turf/boolean-point-in-polygon"));
27
27
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
28
28
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
29
- // const maplibregl = require('maplibre-gl');
29
+ 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; }
30
+ 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; }
31
+ 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; }
32
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
33
+ 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); } // const maplibregl = require('maplibre-gl');
30
34
  var FilterType = /*#__PURE__*/function (FilterType) {
31
35
  FilterType["Name"] = "title";
32
36
  FilterType["LocalRef"] = "localRef";
@@ -47,30 +51,6 @@ let EventSource = exports.EventSource = /*#__PURE__*/function (EventSource) {
47
51
  }({});
48
52
  const DEFAULT_MAP_STYLE = exports.DEFAULT_MAP_STYLE = 'https://api.maptiler.com/maps/01985ac8-56d2-707b-afa8-68abfe8f18be/style.json?key=12H5hrITUbJ1sDrVPqkq';
49
53
  class MetaAtlasSdk {
50
- onLoadCallback = (() => undefined)();
51
- onLoadFailCallback = (() => undefined)();
52
- mapLoaded = false;
53
- onFailCallbackSent = false;
54
- UserLayers = [];
55
- defaultFocusedTaxonomy = 'where.gbtb';
56
- currentFocus = this.defaultFocusedTaxonomy;
57
- apiAuthenticationCallbackReceived = false;
58
- routingVisualizer = (() => new _index.RoutingVisualizer(this))();
59
- // When token middleware is online that will check the tokens.
60
- tileServer = 'https://atoms-map-tiles-middleware.sandbox.spatialverse.online';
61
- // HOST = 'https://atoms-sdk.qa.cag.spatialverse.online/2.0.0/';
62
- HOST = 'https://atoms-sdk.sandbox.spatialverse.online/';
63
- //empApiURL = 'https://atoms-api.changiairport.com';
64
- empApiURL = 'https://atoms-api.sandbox.spatialverse.online';
65
- // empApiURL = 'https://atoms-api.dev.cag.spatialverse.online';
66
-
67
- mapBoxDrawSourceID = 'drawnDataSource';
68
- drawGeojsonData = (() => ({
69
- type: 'FeatureCollection',
70
- features: []
71
- }))();
72
- popups = [];
73
- markers = [];
74
54
  setupFirebase() {
75
55
  const firebaseConfig = {
76
56
  apiKey: "AIzaSyBDWO2wNkotbgjbkyqVrC_OEAJ3mbvlheI",
@@ -132,6 +112,63 @@ class MetaAtlasSdk {
132
112
  let onLoadFail = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : errorMessage => {};
133
113
  let onRoutingStatusUpdate = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
134
114
  let onSearchStatusUpdate = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => {};
115
+ _defineProperty(this, "onLoadCallback", undefined);
116
+ _defineProperty(this, "onLoadFailCallback", undefined);
117
+ _defineProperty(this, "mapLoaded", false);
118
+ _defineProperty(this, "onFailCallbackSent", false);
119
+ _defineProperty(this, "UserLayers", []);
120
+ _defineProperty(this, "defaultFocusedTaxonomy", 'where.gbtb');
121
+ _defineProperty(this, "currentFocus", this.defaultFocusedTaxonomy);
122
+ _defineProperty(this, "apiAuthenticationCallbackReceived", false);
123
+ _defineProperty(this, "routingVisualizer", new _index.RoutingVisualizer(this));
124
+ // When token middleware is online that will check the tokens.
125
+ _defineProperty(this, "tileServer", 'https://atoms-map-tiles-middleware.sandbox.spatialverse.online');
126
+ // HOST = 'https://atoms-sdk.qa.cag.spatialverse.online/2.0.0/';
127
+ _defineProperty(this, "HOST", 'https://atoms-sdk.sandbox.spatialverse.online/');
128
+ //empApiURL = 'https://atoms-api.changiairport.com';
129
+ _defineProperty(this, "empApiURL", 'https://atoms-api.sandbox.spatialverse.online');
130
+ // empApiURL = 'https://atoms-api.dev.cag.spatialverse.online';
131
+ _defineProperty(this, "mapBoxDrawSourceID", 'drawnDataSource');
132
+ _defineProperty(this, "drawGeojsonData", {
133
+ type: 'FeatureCollection',
134
+ features: []
135
+ });
136
+ _defineProperty(this, "popups", []);
137
+ _defineProperty(this, "markers", []);
138
+ _defineProperty(this, "addCustomerLayer", (map, jsonToPass, onLoaded) => {
139
+ let customerLayerUrl = jsonToPass.customerLayerUrl;
140
+ let sourceLayer = jsonToPass.sourceLayer;
141
+ _jquery.default.getJSON(customerLayerUrl, customerLayers => {
142
+ this.CustomerLayers = customerLayers;
143
+ for (const layer of this.CustomerLayers) {
144
+ layer["source-layer"] = sourceLayer;
145
+ map.addLayer(layer);
146
+ this.map.on('click', layer.id, e => {
147
+ //setup new clicked feature
148
+ const clickedFeature = e.features[0];
149
+ this.overRideSelectionOfDrawnPointGeometry(clickedFeature);
150
+ console.log('clickedFeature: ', clickedFeature);
151
+ this.logAnalyticsEvent('feature_clicked', {
152
+ feature_clicked: clickedFeature.properties.title
153
+ });
154
+ if (clickedFeature.properties.isSearchable && clickedFeature.properties.title != 'Transit' && clickedFeature.properties.title != 'Public') {
155
+ const coords = clickedFeature.geometry.type === "Polygon" ? JSON.parse(clickedFeature.properties.center) : clickedFeature.geometry.coordinates;
156
+ this.metaAtlasCore.setLastClickedFeature({
157
+ mapObjectId: clickedFeature.properties.myMapObjectId,
158
+ coordinates: coords,
159
+ name: clickedFeature.properties.title,
160
+ whatDimension: clickedFeature.properties.dimension_what,
161
+ whereDimension: clickedFeature.properties.dimension_where,
162
+ geometry: clickedFeature.geometry,
163
+ properties: clickedFeature.properties,
164
+ clickEvent: e
165
+ });
166
+ }
167
+ });
168
+ }
169
+ onLoaded();
170
+ });
171
+ });
135
172
  this.accessToken = accessToken;
136
173
  this.secretKey = secretKey;
137
174
  this.onLoadCallback = onLoad;
@@ -241,11 +278,10 @@ class MetaAtlasSdk {
241
278
  this.mapBoxDraw = new _mapboxGlDraw.default({
242
279
  displayControlsDefault: false,
243
280
  userProperties: true,
244
- modes: {
245
- ..._mapboxGlDraw.default.modes,
281
+ modes: _objectSpread(_objectSpread({}, _mapboxGlDraw.default.modes), {}, {
246
282
  draw_marker: _draw_marker.default,
247
283
  marker_select: _marker_select.default
248
- },
284
+ }),
249
285
  styles: _customStyles.mapBoxDrawDefaultStyles
250
286
  });
251
287
  this.map.addControl(this.mapBoxDraw);
@@ -276,40 +312,6 @@ class MetaAtlasSdk {
276
312
  this.mapLoaded = true;
277
313
  this.onLoad();
278
314
  }
279
- addCustomerLayer = (map, jsonToPass, onLoaded) => {
280
- let customerLayerUrl = jsonToPass.customerLayerUrl;
281
- let sourceLayer = jsonToPass.sourceLayer;
282
- _jquery.default.getJSON(customerLayerUrl, customerLayers => {
283
- this.CustomerLayers = customerLayers;
284
- for (const layer of this.CustomerLayers) {
285
- layer["source-layer"] = sourceLayer;
286
- map.addLayer(layer);
287
- this.map.on('click', layer.id, e => {
288
- //setup new clicked feature
289
- const clickedFeature = e.features[0];
290
- this.overRideSelectionOfDrawnPointGeometry(clickedFeature);
291
- console.log('clickedFeature: ', clickedFeature);
292
- this.logAnalyticsEvent('feature_clicked', {
293
- feature_clicked: clickedFeature.properties.title
294
- });
295
- if (clickedFeature.properties.isSearchable && clickedFeature.properties.title != 'Transit' && clickedFeature.properties.title != 'Public') {
296
- const coords = clickedFeature.geometry.type === "Polygon" ? JSON.parse(clickedFeature.properties.center) : clickedFeature.geometry.coordinates;
297
- this.metaAtlasCore.setLastClickedFeature({
298
- mapObjectId: clickedFeature.properties.myMapObjectId,
299
- coordinates: coords,
300
- name: clickedFeature.properties.title,
301
- whatDimension: clickedFeature.properties.dimension_what,
302
- whereDimension: clickedFeature.properties.dimension_where,
303
- geometry: clickedFeature.geometry,
304
- properties: clickedFeature.properties,
305
- clickEvent: e
306
- });
307
- }
308
- });
309
- }
310
- onLoaded();
311
- });
312
- };
313
315
  overRideSelectionOfDrawnPointGeometry(feature) {
314
316
  // Check if a drawn point geometry is currently selected, it will be consider selected both in highlighted & non-highlighted state.
315
317
  if (this.mapBoxDraw && this.mapBoxDraw.getMode() === 'simple_select' && this.mapBoxDraw.getAll().features.length === 1) {
@@ -389,8 +391,9 @@ class MetaAtlasSdk {
389
391
  }
390
392
  dropMarkerForRouting(destinations) {
391
393
  destinations.forEach(destination => {
394
+ var _destination$selected, _destination$selected2;
392
395
  console.log(destination.selectedLocation, 'destination.selectedLocation');
393
- const coordinates = destination.selectedLocation?.coordinates ? destination.selectedLocation.coordinates : destination.selectedLocation?.geometry?.coordinates;
396
+ const coordinates = (_destination$selected = destination.selectedLocation) !== null && _destination$selected !== void 0 && _destination$selected.coordinates ? destination.selectedLocation.coordinates : (_destination$selected2 = destination.selectedLocation) === null || _destination$selected2 === void 0 || (_destination$selected2 = _destination$selected2.geometry) === null || _destination$selected2 === void 0 ? void 0 : _destination$selected2.coordinates;
394
397
  console.log(coordinates, 'Coordinates'); // Debugging line
395
398
 
396
399
  if (coordinates && coordinates.length === 2) {
@@ -435,9 +438,9 @@ class MetaAtlasSdk {
435
438
  if (popupElem) {
436
439
  popupElem.style.display = 'none';
437
440
  }
438
- console.log(`Pin with ID: ${targetPinId} is now hidden.`);
441
+ console.log("Pin with ID: ".concat(targetPinId, " is now hidden."));
439
442
  } else {
440
- console.warn(`Pin with ID: ${targetPinId} not found.`);
443
+ console.warn("Pin with ID: ".concat(targetPinId, " not found."));
441
444
  }
442
445
  }
443
446
  hidePins() {
@@ -470,9 +473,9 @@ class MetaAtlasSdk {
470
473
  if (popupElem) {
471
474
  popupElem.style.display = 'flex';
472
475
  }
473
- console.log(`Pin with ID: ${targetPinId} is now visible.`);
476
+ console.log("Pin with ID: ".concat(targetPinId, " is now visible."));
474
477
  } else {
475
- console.warn(`Pin with ID: ${targetPinId} not found.`);
478
+ console.warn("Pin with ID: ".concat(targetPinId, " not found."));
476
479
  }
477
480
  }
478
481
  showPins() {
@@ -497,7 +500,7 @@ class MetaAtlasSdk {
497
500
  } else {
498
501
  targetPinIndex = this.popups.findIndex(pin => pin.id === pinId);
499
502
  if (targetPinIndex === -1) {
500
- console.warn(`Pin with ID: ${pinId} not found.`);
503
+ console.warn("Pin with ID: ".concat(pinId, " not found."));
501
504
  return;
502
505
  }
503
506
  }
@@ -761,7 +764,8 @@ class MetaAtlasSdk {
761
764
  return new Promise(resolve => {
762
765
  if (typeof id !== 'string') resolve('User GPS Location');
763
766
  ref.getMapObjectById(id, mapObj => {
764
- resolve(mapObj[0]?.name);
767
+ var _mapObj$;
768
+ resolve((_mapObj$ = mapObj[0]) === null || _mapObj$ === void 0 ? void 0 : _mapObj$.name);
765
769
  });
766
770
  });
767
771
  };