@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.
Files changed (143) hide show
  1. package/lib/cjs/index.js +9 -9
  2. package/lib/cjs/index.js.map +1 -1
  3. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +213 -294
  4. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
  5. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +40 -41
  6. package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
  7. package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js +170 -196
  8. package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
  9. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +167 -215
  10. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
  11. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js +28 -30
  12. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js.map +1 -1
  13. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +861 -1170
  14. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
  15. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +166 -159
  16. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
  17. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/interfaces.js +6 -6
  18. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/interfaces.js.map +1 -1
  19. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js +6 -6
  20. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js.map +1 -1
  21. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routeLayers.js +3 -3
  22. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routeLayers.js.map +1 -1
  23. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +523 -610
  24. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
  25. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +149 -154
  26. package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
  27. package/lib/cjs/meta-atlas-sdk/customStyles.js +2 -2
  28. package/lib/cjs/meta-atlas-sdk/customStyles.js.map +1 -1
  29. package/lib/cjs/meta-atlas-sdk/customerLayer.js +15 -29
  30. package/lib/cjs/meta-atlas-sdk/customerLayer.js.map +1 -1
  31. package/lib/cjs/meta-atlas-sdk/customerLayerVariant.js +5 -5
  32. package/lib/cjs/meta-atlas-sdk/customerLayerVariant.js.map +1 -1
  33. package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js +809 -1033
  34. package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
  35. package/lib/cjs/meta-atlas-sdk/utils/helpers.js +32 -49
  36. package/lib/cjs/meta-atlas-sdk/utils/helpers.js.map +1 -1
  37. package/lib/cjs/meta-atlas-sdk/utils/local-storage.js +21 -34
  38. package/lib/cjs/meta-atlas-sdk/utils/local-storage.js.map +1 -1
  39. package/lib/cjs/meta-atlas-sdk/utils/mapobjects-store.js +6 -6
  40. package/lib/cjs/meta-atlas-sdk/utils/mapobjects-store.js.map +1 -1
  41. package/lib/cjs/meta-atlas-sdk/utils/routing-store.js +6 -6
  42. package/lib/cjs/meta-atlas-sdk/utils/routing-store.js.map +1 -1
  43. package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js +363 -491
  44. package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
  45. package/lib/cjs/react/MetaAtlasMap.js +127 -0
  46. package/lib/cjs/react/MetaAtlasMap.js.map +1 -0
  47. package/lib/cjs/react/hooks/useDrawing/index.js +17 -18
  48. package/lib/cjs/react/hooks/useDrawing/index.js.map +1 -1
  49. package/lib/cjs/react/hooks/useFocus/index.js +48 -55
  50. package/lib/cjs/react/hooks/useFocus/index.js.map +1 -1
  51. package/lib/cjs/react/hooks/useMapEvents/index.js +40 -47
  52. package/lib/cjs/react/hooks/useMapEvents/index.js.map +1 -1
  53. package/lib/cjs/react/hooks/useMapOverlays/index.js +20 -21
  54. package/lib/cjs/react/hooks/useMapOverlays/index.js.map +1 -1
  55. package/lib/cjs/react/hooks/useMetaAtlas/index.js +77 -95
  56. package/lib/cjs/react/hooks/useMetaAtlas/index.js.map +1 -1
  57. package/lib/cjs/react/hooks/useMetaAtlas.js +78 -96
  58. package/lib/cjs/react/hooks/useMetaAtlas.js.map +1 -1
  59. package/lib/cjs/react/hooks/useRouting/index.js +21 -20
  60. package/lib/cjs/react/hooks/useRouting/index.js.map +1 -1
  61. package/lib/cjs/react/hooks/useSearch/index.js +35 -34
  62. package/lib/cjs/react/hooks/useSearch/index.js.map +1 -1
  63. package/lib/cjs/react/hooks/useStampRally/index.js +26 -23
  64. package/lib/cjs/react/hooks/useStampRally/index.js.map +1 -1
  65. package/lib/cjs/react/hooks/useStampRally/utils.js +2 -2
  66. package/lib/cjs/react/hooks/useStampRally/utils.js.map +1 -1
  67. package/lib/cjs/react/index.js +31 -31
  68. package/lib/cjs/react/index.js.map +1 -1
  69. package/lib/cjs/react/stores/useMapDataStore.js +47 -62
  70. package/lib/cjs/react/stores/useMapDataStore.js.map +1 -1
  71. package/lib/cjs/react/stores/useMetaAtlasStore.js +27 -40
  72. package/lib/cjs/react/stores/useMetaAtlasStore.js.map +1 -1
  73. package/lib/esm/index.js +3 -7
  74. package/lib/esm/index.js.map +1 -1
  75. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +4 -3
  76. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
  77. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +14 -12
  78. package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
  79. package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js +204 -200
  80. package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
  81. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +6 -6
  82. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
  83. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js +4 -3
  84. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js.map +1 -1
  85. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +53 -42
  86. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
  87. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +18 -16
  88. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
  89. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js +3 -3
  90. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js.map +1 -1
  91. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +73 -79
  92. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
  93. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +16 -15
  94. package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
  95. package/lib/esm/meta-atlas-sdk/customerLayer.js +4 -1
  96. package/lib/esm/meta-atlas-sdk/customerLayer.js.map +1 -1
  97. package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js +148 -124
  98. package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
  99. package/lib/esm/meta-atlas-sdk/utils/helpers.js +4 -2
  100. package/lib/esm/meta-atlas-sdk/utils/helpers.js.map +1 -1
  101. package/lib/esm/meta-atlas-sdk/utils/local-storage.js +6 -1
  102. package/lib/esm/meta-atlas-sdk/utils/local-storage.js.map +1 -1
  103. package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js +115 -109
  104. package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
  105. package/lib/esm/react/MetaAtlasMap.js +120 -0
  106. package/lib/esm/react/MetaAtlasMap.js.map +1 -0
  107. package/lib/esm/react/hooks/useDrawing/index.js +2 -2
  108. package/lib/esm/react/hooks/useDrawing/index.js.map +1 -1
  109. package/lib/esm/react/hooks/useFocus/index.js +4 -3
  110. package/lib/esm/react/hooks/useFocus/index.js.map +1 -1
  111. package/lib/esm/react/hooks/useMapEvents/index.js +9 -6
  112. package/lib/esm/react/hooks/useMapEvents/index.js.map +1 -1
  113. package/lib/esm/react/hooks/useMapOverlays/index.js +2 -2
  114. package/lib/esm/react/hooks/useMapOverlays/index.js.map +1 -1
  115. package/lib/esm/react/hooks/useMetaAtlas/index.js +162 -60
  116. package/lib/esm/react/hooks/useMetaAtlas/index.js.map +1 -1
  117. package/lib/esm/react/hooks/useMetaAtlas.js +162 -60
  118. package/lib/esm/react/hooks/useMetaAtlas.js.map +1 -1
  119. package/lib/esm/react/hooks/useRouting/index.js +2 -2
  120. package/lib/esm/react/hooks/useRouting/index.js.map +1 -1
  121. package/lib/esm/react/hooks/useSearch/index.js +2 -2
  122. package/lib/esm/react/hooks/useSearch/index.js.map +1 -1
  123. package/lib/esm/react/hooks/useStampRally/index.js +15 -12
  124. package/lib/esm/react/hooks/useStampRally/index.js.map +1 -1
  125. package/lib/esm/react/hooks/useStampRally/utils.js +1 -1
  126. package/lib/esm/react/hooks/useStampRally/utils.js.map +1 -1
  127. package/lib/esm/react/index.js +11 -15
  128. package/lib/esm/react/index.js.map +1 -1
  129. package/lib/esm/react/stores/useMapDataStore.js +17 -21
  130. package/lib/esm/react/stores/useMapDataStore.js.map +1 -1
  131. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts +30 -0
  132. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts.map +1 -0
  133. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts +5 -0
  134. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts.map +1 -0
  135. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts +21 -0
  136. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts.map +1 -0
  137. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts +27 -0
  138. package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts.map +1 -0
  139. package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts +18 -0
  140. package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts.map +1 -0
  141. package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts +37 -0
  142. package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts.map +1 -0
  143. package/package.json +10 -7
@@ -9,48 +9,48 @@ exports.getPortalDataForIds = getPortalDataForIds;
9
9
  exports.getPortalLinks = getPortalLinks;
10
10
  exports.getRouteNetworkData = getRouteNetworkData;
11
11
  var _lodash = require("lodash");
12
- var _interfaces = require("./routing-core/interfaces");
13
- var _routingStore = _interopRequireDefault(require("../utils/routing-store"));
12
+ var _interfaces = require("./routing-core/interfaces.js");
13
+ var _routingStore = _interopRequireDefault(require("../utils/routing-store.js"));
14
14
  var _nearestPointOnLine = _interopRequireDefault(require("@turf/nearest-point-on-line"));
15
15
  var _distance = _interopRequireDefault(require("@turf/distance"));
16
16
  var _turf = require("@turf/turf");
17
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  function getEdgeData(mapObjectId) {
19
- var routeData = _routingStore["default"].getState().data;
19
+ const routeData = _routingStore.default.getState().data;
20
20
  if (typeof mapObjectId === 'string') {
21
21
  if (!mapObjectId || !routeData.hasOwnProperty(_interfaces.RouteDimension.Edge) || !routeData[_interfaces.RouteDimension.Edge].edges.hasOwnProperty(mapObjectId)) {
22
22
  return undefined;
23
23
  }
24
24
  return (0, _lodash.cloneDeep)(routeData[_interfaces.RouteDimension.Edge].edges[mapObjectId]);
25
25
  } else {
26
- var routeNetworkData = getRouteNetworkData(mapObjectId.whereDimension);
26
+ const routeNetworkData = getRouteNetworkData(mapObjectId.whereDimension);
27
27
  if (routeNetworkData.length < 1) {
28
28
  console.error('RouteNetworkData is empty');
29
29
  return null;
30
30
  }
31
- var minDistance = Infinity;
32
- var closestPoint;
33
- var closestLine;
34
- routeNetworkData.map(function (lineFeature) {
35
- var cleanedFeature = (0, _turf.cleanCoords)(lineFeature);
36
- var nearestPoint = (0, _nearestPointOnLine["default"])(cleanedFeature, mapObjectId.sourceCoords);
37
- var dist = (0, _distance["default"])(nearestPoint.geometry.coordinates, mapObjectId.sourceCoords);
31
+ let minDistance = Infinity;
32
+ let closestPoint;
33
+ let closestLine;
34
+ routeNetworkData.map(lineFeature => {
35
+ const cleanedFeature = (0, _turf.cleanCoords)(lineFeature);
36
+ const nearestPoint = (0, _nearestPointOnLine.default)(cleanedFeature, mapObjectId.sourceCoords);
37
+ const dist = (0, _distance.default)(nearestPoint.geometry.coordinates, mapObjectId.sourceCoords);
38
38
  if (dist < minDistance) {
39
39
  minDistance = dist;
40
40
  closestPoint = nearestPoint;
41
41
  closestLine = lineFeature;
42
42
  }
43
43
  });
44
- var linesCoords = [mapObjectId.sourceCoords, closestPoint.geometry.coordinates];
45
- var lineProps = {
44
+ const linesCoords = [mapObjectId.sourceCoords, closestPoint.geometry.coordinates];
45
+ const lineProps = {
46
46
  title: 'user_edgeLine',
47
47
  zone: closestLine.properties.zone,
48
48
  wheelchair: 1,
49
49
  direction: _interfaces.LineDirection.TwoWay,
50
50
  dimension_where: mapObjectId.whereDimension
51
51
  };
52
- var lines = [(0, _turf.lineString)(linesCoords, lineProps)];
53
- var edge = {
52
+ const lines = [(0, _turf.lineString)(linesCoords, lineProps)];
53
+ const edge = {
54
54
  id: 'user_position',
55
55
  name: 'Custom Position',
56
56
  coords: mapObjectId.sourceCoords,
@@ -64,15 +64,15 @@ function getEdgeData(mapObjectId) {
64
64
  }
65
65
  }
66
66
  function getRouteNetworkData(whereDimension) {
67
- var includeChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
68
- var routeData = _routingStore["default"].getState().data;
67
+ let includeChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
68
+ const routeData = _routingStore.default.getState().data;
69
69
  if (!routeData.hasOwnProperty(_interfaces.RouteDimension.Network)) {
70
70
  return [];
71
71
  }
72
- var completeRouteNetworkData = routeData[_interfaces.RouteDimension.Network];
73
- var whereDimensionRouteNetworkData = [];
74
- for (var index = 0; index < completeRouteNetworkData.length; index++) {
75
- var feature = completeRouteNetworkData[index];
72
+ const completeRouteNetworkData = routeData[_interfaces.RouteDimension.Network];
73
+ const whereDimensionRouteNetworkData = [];
74
+ for (let index = 0; index < completeRouteNetworkData.length; index++) {
75
+ const feature = completeRouteNetworkData[index];
76
76
  if (feature && feature.properties && feature.properties.dimension_where) {
77
77
  if (includeChildren) {
78
78
  if (feature.properties.dimension_where.includes(whereDimension)) {
@@ -90,27 +90,25 @@ function getRouteNetworkData(whereDimension) {
90
90
 
91
91
  // NOTE: whereDimension is unused at the moment, as we are fetching the whole portal data at once on the algorithm side now.
92
92
  function getPortalLinks(whereDimension) {
93
- var routeData = _routingStore["default"].getState().data;
93
+ const routeData = _routingStore.default.getState().data;
94
94
  if (!routeData.hasOwnProperty('portal')) {
95
95
  return {
96
96
  edgeData: {},
97
97
  lines: []
98
98
  };
99
99
  }
100
- var portalEdgeData = routeData.portal;
100
+ const portalEdgeData = routeData.portal;
101
101
  return portalEdgeData;
102
102
  }
103
103
  function getPortalDataForIds(mapObjectIds) {
104
- var routeData = _routingStore["default"].getState().data;
104
+ const routeData = _routingStore.default.getState().data;
105
105
  if (!routeData.hasOwnProperty('portal')) {
106
106
  return {};
107
107
  }
108
- var portalEdgeData = routeData.portal;
108
+ const portalEdgeData = routeData.portal;
109
109
 
110
110
  // PortalEdgeData will include information for both anchor and non-anchor lifts, so filter to keep only required data
111
- var filteredEdgeData = Object.keys(portalEdgeData.edgeData).filter(function (key) {
112
- return mapObjectIds.includes(key);
113
- }).reduce(function (obj, key) {
111
+ const filteredEdgeData = Object.keys(portalEdgeData.edgeData).filter(key => mapObjectIds.includes(key)).reduce((obj, key) => {
114
112
  obj[key] = portalEdgeData.edgeData[key];
115
113
  return obj;
116
114
  }, {});
@@ -120,7 +118,7 @@ function getPortalDataForIds(mapObjectIds) {
120
118
  };
121
119
  }
122
120
  function getImmigrationDataForTaxonomy1(taxonomy1Path) {
123
- var routeData = _routingStore["default"].getState().data;
121
+ const routeData = _routingStore.default.getState().data;
124
122
  if (!taxonomy1Path || !routeData.hasOwnProperty('what.service.immigration') || !routeData['what.service.immigration'].hasOwnProperty(taxonomy1Path)) {
125
123
  return [];
126
124
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fetchMapObjectsData.js","names":["_lodash","require","_interfaces","_routingStore","_interopRequireDefault","_nearestPointOnLine","_distance","_turf","e","__esModule","getEdgeData","mapObjectId","routeData","useRouteDataStore","getState","data","hasOwnProperty","RouteDimension","Edge","edges","undefined","cloneDeep","routeNetworkData","getRouteNetworkData","whereDimension","length","console","error","minDistance","Infinity","closestPoint","closestLine","map","lineFeature","cleanedFeature","cleanCoords","nearestPoint","nearestPointOnLine","sourceCoords","dist","distance","geometry","coordinates","linesCoords","lineProps","title","zone","properties","wheelchair","direction","LineDirection","TwoWay","dimension_where","lines","lineString","edge","id","name","coords","where","what","includeChildren","arguments","Network","completeRouteNetworkData","whereDimensionRouteNetworkData","index","feature","includes","push","getPortalLinks","edgeData","portalEdgeData","portal","getPortalDataForIds","mapObjectIds","filteredEdgeData","Object","keys","filter","key","reduce","obj","getImmigrationDataForTaxonomy1","taxonomy1Path"],"sources":["../../../../src/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\nimport {Edge, LineDirection, RouteDimension, UserPosition} from './routing-core/interfaces';\nimport useRouteDataStore from '../utils/routing-store';\nimport nearestPointOnLine from '@turf/nearest-point-on-line';\nimport distance from '@turf/distance';\nimport { lineString, cleanCoords } from '@turf/turf';\n\nexport function getEdgeData(mapObjectId: string | UserPosition) {\n const routeData = useRouteDataStore.getState().data;\n\n if(typeof(mapObjectId) === 'string'){\n if (\n !mapObjectId ||\n !routeData.hasOwnProperty(RouteDimension.Edge) ||\n !routeData[RouteDimension.Edge].edges.hasOwnProperty(mapObjectId)\n ) {\n return undefined;\n }\n \n return cloneDeep(routeData[RouteDimension.Edge].edges[mapObjectId]);\n }\n else {\n const routeNetworkData = getRouteNetworkData(mapObjectId.whereDimension);\n if(routeNetworkData.length < 1){\n console.error('RouteNetworkData is empty');\n return null;\n }\n let minDistance = Infinity;\n let closestPoint;\n let closestLine;\n routeNetworkData.map((lineFeature)=>{\n const cleanedFeature = cleanCoords(lineFeature);\n const nearestPoint = nearestPointOnLine(cleanedFeature, mapObjectId.sourceCoords);\n const dist = distance(nearestPoint.geometry.coordinates, mapObjectId.sourceCoords);\n if(dist < minDistance){\n minDistance = dist;\n closestPoint = nearestPoint;\n closestLine = lineFeature;\n }\n })\n const linesCoords = [mapObjectId.sourceCoords, closestPoint.geometry.coordinates];\n const lineProps = {\n title: 'user_edgeLine',\n zone: closestLine.properties.zone,\n wheelchair: 1,\n direction: LineDirection.TwoWay,\n dimension_where: mapObjectId.whereDimension\n };\n const lines = [lineString(linesCoords, lineProps)];\n const edge: Edge = {\n id: 'user_position',\n name: 'Custom Position',\n coords: mapObjectId.sourceCoords,\n lines: lines,\n where: mapObjectId.whereDimension,\n what: '',\n zone: closestLine.properties.zone\n };\n routeData[RouteDimension.Edge][edge.id] = edge;\n return edge;\n }\n}\n\n\nexport function getRouteNetworkData(whereDimension: string, includeChildren = true) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty(RouteDimension.Network)) {\n return [];\n }\n\n const completeRouteNetworkData = routeData[RouteDimension.Network];\n const whereDimensionRouteNetworkData = [];\n for (let index = 0; index < completeRouteNetworkData.length; index++) {\n const feature = completeRouteNetworkData[index];\n if (feature && feature.properties && feature.properties.dimension_where) {\n if (includeChildren) {\n if (feature.properties.dimension_where.includes(whereDimension)) {\n whereDimensionRouteNetworkData.push(feature);\n }\n }\n else {\n if (feature.properties.dimension_where === (whereDimension)) {\n whereDimensionRouteNetworkData.push(feature);\n }\n }\n }\n }\n\n return cloneDeep(whereDimensionRouteNetworkData);\n}\n\n// NOTE: whereDimension is unused at the moment, as we are fetching the whole portal data at once on the algorithm side now.\nexport function getPortalLinks(whereDimension: string) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty('portal')) {\n return {\n edgeData: {},\n lines: []\n };\n }\n\n const portalEdgeData = routeData.portal;\n return portalEdgeData;\n}\n\nexport function getPortalDataForIds(mapObjectIds: string[]) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty('portal')) {\n return {};\n }\n\n const portalEdgeData = routeData.portal;\n\n // PortalEdgeData will include information for both anchor and non-anchor lifts, so filter to keep only required data\n const filteredEdgeData = Object.keys(portalEdgeData.edgeData)\n .filter((key) => mapObjectIds.includes(key))\n .reduce((obj: any, key) => {\n obj[key] = portalEdgeData.edgeData[key];\n return obj;\n }, {});\n\n return {\n edgeData: filteredEdgeData,\n lines: portalEdgeData.lines,\n };\n}\n\nexport function getImmigrationDataForTaxonomy1(taxonomy1Path: string) {\n const routeData = useRouteDataStore.getState().data;\n if (\n !taxonomy1Path ||\n !routeData.hasOwnProperty('what.service.immigration') ||\n !routeData['what.service.immigration'].hasOwnProperty(taxonomy1Path)\n ) {\n return [];\n }\n return routeData['what.service.immigration'][taxonomy1Path];\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAAqD,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAE9C,SAASE,WAAWA,CAACC,WAAkC,EAAE;EAC9D,IAAMC,SAAS,GAAGC,wBAAiB,CAACC,QAAQ,CAAC,CAAC,CAACC,IAAI;EAEnD,IAAG,OAAOJ,WAAY,KAAK,QAAQ,EAAC;IAClC,IACE,CAACA,WAAW,IACZ,CAACC,SAAS,CAACI,cAAc,CAACC,0BAAc,CAACC,IAAI,CAAC,IAC9C,CAACN,SAAS,CAACK,0BAAc,CAACC,IAAI,CAAC,CAACC,KAAK,CAACH,cAAc,CAACL,WAAW,CAAC,EACjE;MACA,OAAOS,SAAS;IAClB;IAEA,OAAO,IAAAC,iBAAS,EAACT,SAAS,CAACK,0BAAc,CAACC,IAAI,CAAC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IAAMxE,SAAS,GAAGC,wBAAiB,CAACC,QAAQ,CAAC,CAAC,CAACC,IAAI;EACnD,IACE,CAACqE,aAAa,IACd,CAACxE,SAAS,CAACI,cAAc,CAAC,0BAA0B,CAAC,IACrD,CAACJ,SAAS,CAAC,0BAA0B,CAAC,CAACI,cAAc,CAACoE,aAAa,CAAC,EACpE;IACA,OAAO,EAAE;EACX;EACA,OAAOxE,SAAS,CAAC,0BAA0B,CAAC,CAACwE,aAAa,CAAC;AAC7D","ignoreList":[]}
1
+ {"version":3,"file":"fetchMapObjectsData.js","names":["_lodash","require","_interfaces","_routingStore","_interopRequireDefault","_nearestPointOnLine","_distance","_turf","e","__esModule","default","getEdgeData","mapObjectId","routeData","useRouteDataStore","getState","data","hasOwnProperty","RouteDimension","Edge","edges","undefined","cloneDeep","routeNetworkData","getRouteNetworkData","whereDimension","length","console","error","minDistance","Infinity","closestPoint","closestLine","map","lineFeature","cleanedFeature","cleanCoords","nearestPoint","nearestPointOnLine","sourceCoords","dist","distance","geometry","coordinates","linesCoords","lineProps","title","zone","properties","wheelchair","direction","LineDirection","TwoWay","dimension_where","lines","lineString","edge","id","name","coords","where","what","includeChildren","arguments","Network","completeRouteNetworkData","whereDimensionRouteNetworkData","index","feature","includes","push","getPortalLinks","edgeData","portalEdgeData","portal","getPortalDataForIds","mapObjectIds","filteredEdgeData","Object","keys","filter","key","reduce","obj","getImmigrationDataForTaxonomy1","taxonomy1Path"],"sources":["../../../../src/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\nimport {Edge, LineDirection, RouteDimension, UserPosition} from './routing-core/interfaces';\nimport useRouteDataStore from '../utils/routing-store';\nimport nearestPointOnLine from '@turf/nearest-point-on-line';\nimport distance from '@turf/distance';\nimport { lineString, cleanCoords } from '@turf/turf';\n\nexport function getEdgeData(mapObjectId: string | UserPosition) {\n const routeData = useRouteDataStore.getState().data;\n\n if(typeof(mapObjectId) === 'string'){\n if (\n !mapObjectId ||\n !routeData.hasOwnProperty(RouteDimension.Edge) ||\n !routeData[RouteDimension.Edge].edges.hasOwnProperty(mapObjectId)\n ) {\n return undefined;\n }\n \n return cloneDeep(routeData[RouteDimension.Edge].edges[mapObjectId]);\n }\n else {\n const routeNetworkData = getRouteNetworkData(mapObjectId.whereDimension);\n if(routeNetworkData.length < 1){\n console.error('RouteNetworkData is empty');\n return null;\n }\n let minDistance = Infinity;\n let closestPoint;\n let closestLine;\n routeNetworkData.map((lineFeature)=>{\n const cleanedFeature = cleanCoords(lineFeature);\n const nearestPoint = nearestPointOnLine(cleanedFeature, mapObjectId.sourceCoords);\n const dist = distance(nearestPoint.geometry.coordinates, mapObjectId.sourceCoords);\n if(dist < minDistance){\n minDistance = dist;\n closestPoint = nearestPoint;\n closestLine = lineFeature;\n }\n })\n const linesCoords = [mapObjectId.sourceCoords, closestPoint.geometry.coordinates];\n const lineProps = {\n title: 'user_edgeLine',\n zone: closestLine.properties.zone,\n wheelchair: 1,\n direction: LineDirection.TwoWay,\n dimension_where: mapObjectId.whereDimension\n };\n const lines = [lineString(linesCoords, lineProps)];\n const edge: Edge = {\n id: 'user_position',\n name: 'Custom Position',\n coords: mapObjectId.sourceCoords,\n lines: lines,\n where: mapObjectId.whereDimension,\n what: '',\n zone: closestLine.properties.zone\n };\n routeData[RouteDimension.Edge][edge.id] = edge;\n return edge;\n }\n}\n\n\nexport function getRouteNetworkData(whereDimension: string, includeChildren = true) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty(RouteDimension.Network)) {\n return [];\n }\n\n const completeRouteNetworkData = routeData[RouteDimension.Network];\n const whereDimensionRouteNetworkData = [];\n for (let index = 0; index < completeRouteNetworkData.length; index++) {\n const feature = completeRouteNetworkData[index];\n if (feature && feature.properties && feature.properties.dimension_where) {\n if (includeChildren) {\n if (feature.properties.dimension_where.includes(whereDimension)) {\n whereDimensionRouteNetworkData.push(feature);\n }\n }\n else {\n if (feature.properties.dimension_where === (whereDimension)) {\n whereDimensionRouteNetworkData.push(feature);\n }\n }\n }\n }\n\n return cloneDeep(whereDimensionRouteNetworkData);\n}\n\n// NOTE: whereDimension is unused at the moment, as we are fetching the whole portal data at once on the algorithm side now.\nexport function getPortalLinks(whereDimension: string) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty('portal')) {\n return {\n edgeData: {},\n lines: []\n };\n }\n\n const portalEdgeData = routeData.portal;\n return portalEdgeData;\n}\n\nexport function getPortalDataForIds(mapObjectIds: string[]) {\n const routeData = useRouteDataStore.getState().data;\n if (!routeData.hasOwnProperty('portal')) {\n return {};\n }\n\n const portalEdgeData = routeData.portal;\n\n // PortalEdgeData will include information for both anchor and non-anchor lifts, so filter to keep only required data\n const filteredEdgeData = Object.keys(portalEdgeData.edgeData)\n .filter((key) => mapObjectIds.includes(key))\n .reduce((obj: any, key) => {\n obj[key] = portalEdgeData.edgeData[key];\n return obj;\n }, {});\n\n return {\n edgeData: filteredEdgeData,\n lines: portalEdgeData.lines,\n };\n}\n\nexport function getImmigrationDataForTaxonomy1(taxonomy1Path: string) {\n const routeData = useRouteDataStore.getState().data;\n if (\n !taxonomy1Path ||\n !routeData.hasOwnProperty('what.service.immigration') ||\n !routeData['what.service.immigration'].hasOwnProperty(taxonomy1Path)\n ) {\n return [];\n }\n return routeData['what.service.immigration'][taxonomy1Path];\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAmC,IAAAC,WAAA,GAAAD,OAAA;AAAA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGnC,IAAAI,mBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAAqD,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C,SA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