@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
@@ -3,47 +3,46 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.default = void 0;
7
7
  var _ngraph = require("ngraph.path");
8
8
  var _ngraph2 = _interopRequireDefault(require("ngraph.graph"));
9
9
  var _helpers = require("@turf/helpers");
10
10
  var turf = _interopRequireWildcard(require("@turf/turf"));
11
11
  var _lodash = require("lodash");
12
- var _interfaces = require("./interfaces");
13
- var _mapObjectsHelper = require("./mapObjectsHelper");
14
- var _routingHelpers = require("./routing-helpers");
15
- var _utils = require("./utils");
16
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(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 (var _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); }
17
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
18
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ var _interfaces = require("./interfaces.js");
13
+ var _mapObjectsHelper = require("./mapObjectsHelper.js");
14
+ var _routingHelpers = require("./routing-helpers.js");
15
+ var _utils = require("./utils.js");
16
+ 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); }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
18
  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; }
20
19
  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; }
21
20
  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; }
22
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
23
- 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); } /* eslint-disable guard-for-in */ /* eslint-disable no-restricted-syntax */ // import turfDistance from '@turf/distance';
21
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
+ 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); } /* eslint-disable guard-for-in */ /* eslint-disable no-restricted-syntax */ // import turfDistance from '@turf/distance';
24
23
  /* eslint-disable @typescript-eslint/no-shadow */
25
24
 
26
- var RoutingCore = function () {
27
- var wheelChairAccessibleRouteOnly = true;
28
- var startNode;
29
- var endNode;
30
- var changeZoneCheckEnabled = true;
31
- var runIntersection = false;
32
- var portalData = {
25
+ const RoutingCore = function () {
26
+ let wheelChairAccessibleRouteOnly = true;
27
+ let startNode;
28
+ let endNode;
29
+ let changeZoneCheckEnabled = true;
30
+ let runIntersection = false;
31
+ let portalData = {
33
32
  edgeData: {},
34
33
  lines: []
35
34
  };
36
35
  function addVertex(graph, coords, mapObjectId, where, what, zone) {
37
- var updateMapObjectId = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
38
- var vertexName = "".concat(coords.toString(), ",").concat(where);
39
- var vertex = graph.getNode(vertexName);
36
+ let updateMapObjectId = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
37
+ const vertexName = "".concat(coords.toString(), ",").concat(where);
38
+ let vertex = graph.getNode(vertexName);
40
39
  if (vertex === undefined) {
41
- var data = {
42
- mapObjectId: mapObjectId,
43
- coords: coords,
44
- where: where,
45
- what: what,
46
- zone: zone,
40
+ const data = {
41
+ mapObjectId,
42
+ coords,
43
+ where,
44
+ what,
45
+ zone,
47
46
  zoneUnionVertex: false
48
47
  };
49
48
  vertex = graph.addNode(vertexName, data);
@@ -57,38 +56,40 @@ var RoutingCore = function () {
57
56
  return vertex;
58
57
  }
59
58
  function addLink(graph, vertex1, vertex2, data) {
60
- var cost = data.cost,
61
- description = data.description;
62
- var timeInSeconds = data.isPortal ? cost / _interfaces.WALK_SPEED : cost;
59
+ const {
60
+ cost,
61
+ description
62
+ } = data;
63
+ const timeInSeconds = data.isPortal ? cost / _interfaces.WALK_SPEED : cost;
63
64
  if (!wheelChairAccessibleRouteOnly || wheelChairAccessibleRouteOnly && data.wheelChairAccesible) {
64
65
  graph.addLink(vertex1.id, vertex2.id, {
65
66
  weight: timeInSeconds,
66
- cost: cost,
67
- description: description
67
+ cost,
68
+ description
68
69
  });
69
70
  }
70
71
  }
71
72
  function getDistance(coords1, coords2) {
72
- var point1 = (0, _helpers.point)(coords1);
73
- var point2 = (0, _helpers.point)(coords2);
74
- var distance = turf.distance(point1, point2, {
73
+ const point1 = (0, _helpers.point)(coords1);
74
+ const point2 = (0, _helpers.point)(coords2);
75
+ const distance = turf.distance(point1, point2, {
75
76
  units: 'meters'
76
77
  });
77
78
  return distance;
78
79
  }
79
80
  function addEdgeToGraph(graph, edge) {
80
- var node = edge;
81
+ const node = edge;
81
82
  if (node) {
82
- var vertex = addVertex(graph, node.coords, node.id, node.where, node.what, node.zone, true);
83
- for (var index = 0; index < node.lines.length; index += 1) {
84
- var line = node.lines[index];
83
+ const vertex = addVertex(graph, node.coords, node.id, node.where, node.what, node.zone, true);
84
+ for (let index = 0; index < node.lines.length; index += 1) {
85
+ const line = node.lines[index];
85
86
  // add edges for coord pairs
86
- var coords = turf.getCoords(line);
87
- for (var i = 0; i < coords.length - 1; i += 1) {
88
- var vertex1 = addVertex(graph, coords[i], 'vertex', node.where, _interfaces.RouteDimension.Edge, line.properties.zone);
89
- var vertex2 = addVertex(graph, coords[i + 1], 'vertex', node.where, _interfaces.RouteDimension.Edge, line.properties.zone);
87
+ const coords = turf.getCoords(line);
88
+ for (let i = 0; i < coords.length - 1; i += 1) {
89
+ const vertex1 = addVertex(graph, coords[i], 'vertex', node.where, _interfaces.RouteDimension.Edge, line.properties.zone);
90
+ const vertex2 = addVertex(graph, coords[i + 1], 'vertex', node.where, _interfaces.RouteDimension.Edge, line.properties.zone);
90
91
  if (vertex1.id !== vertex2.id) {
91
- var distance = getDistance(coords[i], coords[i + 1]);
92
+ const distance = getDistance(coords[i], coords[i + 1]);
92
93
  if (line.properties.direction === _interfaces.LineDirection.Forward || line.properties.direction === _interfaces.LineDirection.TwoWay) {
93
94
  addLink(graph, vertex1, vertex2, {
94
95
  wheelChairAccesible: line.properties.wheelchair,
@@ -113,21 +114,23 @@ var RoutingCore = function () {
113
114
  return undefined;
114
115
  }
115
116
  function addNetworkToGraph(graph, networkFeatures) {
116
- for (var index = 0; index < networkFeatures.length; index += 1) {
117
- var feature = networkFeatures[index];
117
+ for (let index = 0; index < networkFeatures.length; index += 1) {
118
+ const feature = networkFeatures[index];
118
119
  if (feature.geometry.type === 'LineString') {
119
120
  // get line
120
- var lineCoords = turf.getCoords(feature);
121
+ const lineCoords = turf.getCoords(feature);
121
122
  if (feature.properties) {
122
- var where = feature.properties.dimension_where;
123
- var what = _interfaces.RouteDimension.Network; // feature.properties.dimension_what;
124
- var zone = feature.properties.zone;
123
+ const where = feature.properties.dimension_where;
124
+ const what = _interfaces.RouteDimension.Network; // feature.properties.dimension_what;
125
+ const {
126
+ zone
127
+ } = feature.properties;
125
128
  // add edges for coord pairs
126
- for (var i = 0; i < lineCoords.length - 1; i += 1) {
127
- var vertex1 = addVertex(graph, lineCoords[i], 'vertex', where, what, zone, true);
128
- var vertex2 = addVertex(graph, lineCoords[i + 1], 'vertex', where, what, zone, true);
129
+ for (let i = 0; i < lineCoords.length - 1; i += 1) {
130
+ const vertex1 = addVertex(graph, lineCoords[i], 'vertex', where, what, zone, true);
131
+ const vertex2 = addVertex(graph, lineCoords[i + 1], 'vertex', where, what, zone, true);
129
132
  if (vertex1.id !== vertex2.id) {
130
- var distance = getDistance(lineCoords[i], lineCoords[i + 1]);
133
+ const distance = getDistance(lineCoords[i], lineCoords[i + 1]);
131
134
  if (feature.properties.direction === _interfaces.LineDirection.Forward || feature.properties.direction === _interfaces.LineDirection.TwoWay) {
132
135
  addLink(graph, vertex1, vertex2, {
133
136
  wheelChairAccesible: feature.properties.wheelchair,
@@ -151,41 +154,45 @@ var RoutingCore = function () {
151
154
  }
152
155
  }
153
156
  function addVertexByEdge(graph, edge) {
154
- var node = edge;
157
+ const node = edge;
155
158
  if (node === undefined) {
156
159
  return undefined;
157
160
  }
158
161
  return addVertex(graph, node.coords, node.id, node.where, node.what, node.zone, true);
159
162
  }
160
163
  function addPortalLinksToGraph(graph, portalEdgeData) {
161
- for (var mapObjectId1 in portalEdgeData) {
162
- var portal = portalEdgeData[mapObjectId1];
163
- for (var index = 0; index < portal.links.length; index += 1) {
164
- var portalLink = portal.links[index];
165
- var cost = portalLink.cost;
164
+ for (const mapObjectId1 in portalEdgeData) {
165
+ const portal = portalEdgeData[mapObjectId1];
166
+ for (let index = 0; index < portal.links.length; index += 1) {
167
+ const portalLink = portal.links[index];
168
+ let {
169
+ cost
170
+ } = portalLink;
166
171
  cost = (0, _lodash.toInteger)(cost);
167
172
  // if (cost <= 1) {
168
173
  // cost = portalWeight;
169
174
  // }
170
- var direction = portalLink.direction,
171
- wheelchair = portalLink.wheelchair,
172
- description = portalLink.description;
173
- var portal1 = addVertexByEdge(graph, portal);
174
- var portal2 = addVertexByEdge(graph, portalLink);
175
+ const {
176
+ direction,
177
+ wheelchair,
178
+ description
179
+ } = portalLink;
180
+ const portal1 = addVertexByEdge(graph, portal);
181
+ const portal2 = addVertexByEdge(graph, portalLink);
175
182
  if (portal1 !== undefined && portal2 !== undefined && portal1.id !== portal2.id) {
176
183
  if (direction === _interfaces.LineDirection.Forward || direction === _interfaces.LineDirection.TwoWay) {
177
184
  addLink(graph, portal1, portal2, {
178
185
  wheelChairAccesible: wheelchair,
179
- cost: cost,
180
- description: description,
186
+ cost,
187
+ description,
181
188
  isPortal: true
182
189
  });
183
190
  }
184
191
  if (direction === _interfaces.LineDirection.Backward || direction === _interfaces.LineDirection.TwoWay) {
185
192
  addLink(graph, portal2, portal1, {
186
193
  wheelChairAccesible: wheelchair,
187
- cost: cost,
188
- description: description,
194
+ cost,
195
+ description,
189
196
  isPortal: true
190
197
  });
191
198
  }
@@ -214,44 +221,44 @@ var RoutingCore = function () {
214
221
  return {};
215
222
  } // if no path found
216
223
 
217
- var startNode = source;
218
- var endNode = destination;
219
- var segments = [];
220
- var segmentStartVertexData = vertices[0].data;
221
- var geojsonPaths = [initLineString(vertices[0])];
222
- for (var i = 1; i < vertices.length; i += 1) {
223
- var curVertex = vertices[i];
224
- var prevVertex = vertices[i - 1];
225
- var line = geojsonPaths[geojsonPaths.length - 1];
224
+ const startNode = source;
225
+ const endNode = destination;
226
+ const segments = [];
227
+ let segmentStartVertexData = vertices[0].data;
228
+ const geojsonPaths = [initLineString(vertices[0])];
229
+ for (let i = 1; i < vertices.length; i += 1) {
230
+ const curVertex = vertices[i];
231
+ const prevVertex = vertices[i - 1];
232
+ const line = geojsonPaths[geojsonPaths.length - 1];
226
233
 
227
234
  // if vertex is map object
228
235
  if (curVertex.data.mapObjectId !== 'vertex' || curVertex.data.zoneUnionVertex) {
229
- var segment = void 0;
236
+ let segment;
230
237
  if ((0, _routingHelpers.isPortalTaxonomy)(prevVertex.data.what) && (0, _routingHelpers.isPortalTaxonomy)(curVertex.data.what)) {
231
238
  if (prevVertex.data.zone !== curVertex.data.zone) {
232
239
  console.warn('A portal is triggering a change in zone');
233
240
  }
234
241
 
235
242
  // check if portal path is available to visualize
236
- var portalPath = void 0;
243
+ let portalPath;
237
244
  if ((0, _routingHelpers.isMovingPortalTaxonomy)(prevVertex.data.what)) {
238
- var getPortalPath = function getPortalPath(portalEdgeData, curVertex, prevVertex) {
239
- var invertStart = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
240
- var prevVertexMapObjId = prevVertex.data.mapObjectId;
241
- var set = new Set().add(prevVertexMapObjId);
242
- var portalDataForSet = (0, _utils.filterPortalEdgeDataByList)(portalEdgeData, set);
245
+ const getPortalPath = function (portalEdgeData, curVertex, prevVertex) {
246
+ let invertStart = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
247
+ const prevVertexMapObjId = prevVertex.data.mapObjectId;
248
+ const set = new Set().add(prevVertexMapObjId);
249
+ const portalDataForSet = (0, _utils.filterPortalEdgeDataByList)(portalEdgeData, set);
243
250
  if (portalDataForSet && portalDataForSet.edgeData[prevVertexMapObjId]) {
244
- var prevVertexPortalData = portalDataForSet.edgeData[prevVertexMapObjId];
245
- for (var j = 0; j < prevVertexPortalData.links.length; j += 1) {
246
- var _link = prevVertexPortalData.links[j];
247
- if (_link.id === curVertex.data.mapObjectId) {
248
- if (_link.pathFeatures && _link.pathFeatures.length > 0) {
249
- var _line = _link.pathFeatures[0];
250
- var start = invertStart === false ? prevVertex.data.coords : curVertex.data.coords;
251
- var end = invertStart === false ? curVertex.data.coords : prevVertex.data.coords;
252
- var distanceToStart = turf.distance(start, _line.geometry.coordinates[0]);
253
- var distanceToEnd = turf.distance(end, _line.geometry.coordinates[0]);
254
- var coordsToUse = distanceToStart < distanceToEnd ? _line.geometry.coordinates : _line.geometry.coordinates.slice().reverse();
251
+ const prevVertexPortalData = portalDataForSet.edgeData[prevVertexMapObjId];
252
+ for (let j = 0; j < prevVertexPortalData.links.length; j += 1) {
253
+ const link = prevVertexPortalData.links[j];
254
+ if (link.id === curVertex.data.mapObjectId) {
255
+ if (link.pathFeatures && link.pathFeatures.length > 0) {
256
+ const line = link.pathFeatures[0];
257
+ const start = invertStart === false ? prevVertex.data.coords : curVertex.data.coords;
258
+ const end = invertStart === false ? curVertex.data.coords : prevVertex.data.coords;
259
+ const distanceToStart = turf.distance(start, line.geometry.coordinates[0]);
260
+ const distanceToEnd = turf.distance(end, line.geometry.coordinates[0]);
261
+ const coordsToUse = distanceToStart < distanceToEnd ? line.geometry.coordinates : line.geometry.coordinates.slice().reverse();
255
262
  return turf.lineString(coordsToUse);
256
263
  }
257
264
  }
@@ -264,9 +271,9 @@ var RoutingCore = function () {
264
271
  }
265
272
 
266
273
  // TODO: read description here
267
- var link = graph.getLink(prevVertex.id, curVertex.id);
268
- var cost = link ? link.data.cost ? link.data.cost : undefined : undefined;
269
- var description = link ? link.data.description ? link.data.description : undefined : undefined;
274
+ const link = graph.getLink(prevVertex.id, curVertex.id);
275
+ const cost = link ? link.data.cost ? link.data.cost : undefined : undefined;
276
+ const description = link ? link.data.description ? link.data.description : undefined : undefined;
270
277
  segment = {
271
278
  geojson: (0, _helpers.multiPoint)([prevVertex.data.coords, curVertex.data.coords], {
272
279
  zone: curVertex.data.zone
@@ -275,14 +282,14 @@ var RoutingCore = function () {
275
282
  startFloor: prevVertex.data.where,
276
283
  endFloor: curVertex.data.where,
277
284
  isPortal: true,
278
- portalPath: portalPath,
279
- cost: cost,
280
- description: description
285
+ portalPath,
286
+ cost,
287
+ description
281
288
  };
282
289
  segments.push(segment);
283
290
  segmentStartVertexData = curVertex.data;
284
291
  } else {
285
- var nextVertex = i + 1 < vertices.length ? vertices[i + 1] : undefined;
292
+ const nextVertex = i + 1 < vertices.length ? vertices[i + 1] : undefined;
286
293
  if (curVertex.data.zoneUnionVertex && prevVertex && nextVertex && (prevVertex === null || prevVertex === void 0 ? void 0 : prevVertex.data.zone) === (nextVertex === null || nextVertex === void 0 ? void 0 : nextVertex.data.zone)) {
287
294
  console.log('ignore zoneUnionVertex in segment');
288
295
  } else {
@@ -303,10 +310,10 @@ var RoutingCore = function () {
303
310
 
304
311
  // same line
305
312
  if (!((0, _routingHelpers.isPortalTaxonomy)(prevVertex.data.what) && (0, _routingHelpers.isPortalTaxonomy)(curVertex.data.what))) {
306
- var _link2 = graph.getLink(prevVertex.id, curVertex.id); // returns a link from 'hello' to 'world'
307
- var _cost = _link2 ? _link2.data.cost ? _link2.data.cost : undefined : undefined;
313
+ const link = graph.getLink(prevVertex.id, curVertex.id); // returns a link from 'hello' to 'world'
314
+ const cost = link ? link.data.cost ? link.data.cost : undefined : undefined;
308
315
  line.geometry.coordinates.push(curVertex.data.coords);
309
- line.properties.cost += _cost;
316
+ line.properties.cost += cost;
310
317
  } else {
311
318
  // new line
312
319
  if (line.geometry.coordinates.length < 2) {
@@ -317,24 +324,24 @@ var RoutingCore = function () {
317
324
 
318
325
  // new line due to change in zone
319
326
  if (curVertex.data.zoneUnionVertex) {
320
- var _prevVertex = i > 0 ? vertices[i - 1] : undefined;
321
- var _nextVertex = i + 1 < vertices.length ? vertices[i + 1] : undefined;
322
- if (_prevVertex && _nextVertex && (_prevVertex === null || _prevVertex === void 0 ? void 0 : _prevVertex.data.zone) === (_nextVertex === null || _nextVertex === void 0 ? void 0 : _nextVertex.data.zone)) {
327
+ const prevVertex = i > 0 ? vertices[i - 1] : undefined;
328
+ const nextVertex = i + 1 < vertices.length ? vertices[i + 1] : undefined;
329
+ if (prevVertex && nextVertex && (prevVertex === null || prevVertex === void 0 ? void 0 : prevVertex.data.zone) === (nextVertex === null || nextVertex === void 0 ? void 0 : nextVertex.data.zone)) {
323
330
  console.log('ignore zoneUnionVertex');
324
331
  } else
325
332
  // Use zone value of next vertex (when available) as current vertex is a common vertex and can have either of the zone values
326
- if (_nextVertex) {
327
- var copyOfCurrentVertex = (0, _lodash.cloneDeep)(curVertex);
328
- copyOfCurrentVertex.data.zone = _nextVertex.data.zone;
333
+ if (nextVertex) {
334
+ const copyOfCurrentVertex = (0, _lodash.cloneDeep)(curVertex);
335
+ copyOfCurrentVertex.data.zone = nextVertex.data.zone;
329
336
  geojsonPaths.push(initLineString(copyOfCurrentVertex));
330
337
  } else {
331
338
  geojsonPaths.push(initLineString(curVertex));
332
339
  }
333
340
  }
334
341
  }
335
- var result = {
336
- startNode: startNode,
337
- endNode: endNode,
342
+ const result = {
343
+ startNode,
344
+ endNode,
338
345
  routes: segments,
339
346
  distance: 0
340
347
  };
@@ -342,18 +349,18 @@ var RoutingCore = function () {
342
349
  }
343
350
  function findPath(vertex1, vertex2, graph) {
344
351
  // setup ngraph pathfinder
345
- var pathFinder = (0, _ngraph.aStar)(graph, {
352
+ const pathFinder = (0, _ngraph.aStar)(graph, {
346
353
  oriented: true,
347
- distance: function distance(fromNode, toNode, link) {
354
+ distance(fromNode, toNode, link) {
348
355
  return link.data.weight;
349
356
  },
350
- blocked: function blocked(fromNode, toNode, link) {
357
+ blocked(fromNode, toNode, link) {
351
358
  if (changeZoneCheckEnabled) {
352
- var isZoneCrossing = (fromNode === null || fromNode === void 0 ? void 0 : fromNode.data.zone) !== (toNode === null || toNode === void 0 ? void 0 : toNode.data.zone);
359
+ const isZoneCrossing = (fromNode === null || fromNode === void 0 ? void 0 : fromNode.data.zone) !== (toNode === null || toNode === void 0 ? void 0 : toNode.data.zone);
353
360
  if (isZoneCrossing) {
354
- var parentWhereDimensionOfFromNode = (0, _utils.getParentDimension)(fromNode.data.where);
355
- var parentWhereDimensionOfStartNode = (0, _utils.getParentDimension)(startNode.where);
356
- var parentWhereDimensionOfToNode = (0, _utils.getParentDimension)(toNode.data.where);
361
+ const parentWhereDimensionOfFromNode = (0, _utils.getParentDimension)(fromNode.data.where);
362
+ const parentWhereDimensionOfStartNode = (0, _utils.getParentDimension)(startNode.where);
363
+ const parentWhereDimensionOfToNode = (0, _utils.getParentDimension)(toNode.data.where);
357
364
  if (parentWhereDimensionOfFromNode !== parentWhereDimensionOfStartNode && parentWhereDimensionOfToNode !== parentWhereDimensionOfStartNode) {
358
365
  return true;
359
366
  }
@@ -364,81 +371,81 @@ var RoutingCore = function () {
364
371
  });
365
372
 
366
373
  // get shortest path
367
- var path = pathFinder.find(vertex1.id, vertex2.id).reverse();
374
+ const path = pathFinder.find(vertex1.id, vertex2.id).reverse();
368
375
  return path;
369
376
  }
370
377
  function setupGraphAndFindPath(source, destination, portalEdgeData, networkData) {
371
378
  // create ngraph graph
372
- var graph = (0, _ngraph2["default"])();
379
+ const graph = (0, _ngraph2.default)();
373
380
 
374
381
  // add node & node lines to graph
375
- var vertex1 = addEdgeToGraph(graph, source);
376
- var vertex2 = addEdgeToGraph(graph, destination);
382
+ const vertex1 = addEdgeToGraph(graph, source);
383
+ const vertex2 = addEdgeToGraph(graph, destination);
377
384
  if (vertex1 && vertex2) {
378
385
  // Add portal links
379
386
  addPortalLinksToGraph(graph, portalEdgeData);
380
387
 
381
388
  // add networks to graph
382
389
  addNetworkToGraph(graph, networkData);
383
- var path = findPath(vertex1, vertex2, graph);
390
+ const path = findPath(vertex1, vertex2, graph);
384
391
  // reconstruct path into geojson features
385
- var geojsonPath = pathToFeatures(source, destination, path, graph);
392
+ const geojsonPath = pathToFeatures(source, destination, path, graph);
386
393
  return geojsonPath;
387
394
  }
388
395
  return {};
389
396
  }
390
397
  function getRouteWithAllPortals(source, destination) {
391
- var start = performance.now();
398
+ let start = performance.now();
392
399
 
393
400
  // Load network data
394
- var networkFeatures = (0, _mapObjectsHelper.getNetworkFeatures)(_utils.DEFAULT_DIMENSION);
401
+ const networkFeatures = (0, _mapObjectsHelper.getNetworkFeatures)(_utils.DEFAULT_DIMENSION);
395
402
  console.log('time load: ', (performance.now() - start) / 1000);
396
403
  start = performance.now();
397
- var concatenatedEdgeFeatures = source.lines.concat(destination.lines, portalData.lines);
398
- var concatenatedNetworkFeatures = networkFeatures;
404
+ const concatenatedEdgeFeatures = source.lines.concat(destination.lines, portalData.lines);
405
+ const concatenatedNetworkFeatures = networkFeatures;
399
406
  if (runIntersection) (0, _utils.optimized)(concatenatedEdgeFeatures, concatenatedNetworkFeatures);
400
407
  console.log('time network: ', (performance.now() - start) / 1000, networkFeatures.length);
401
408
  return setupGraphAndFindPath(source, destination, portalData.edgeData, concatenatedNetworkFeatures);
402
409
  }
403
410
  function getRouteWithSpecificPortals(source, destination, routeWithAllAvailablePortals) {
404
- var portalsToUse = new Set();
405
- for (var index = 0; routeWithAllAvailablePortals.routes && index < routeWithAllAvailablePortals.routes.length; index += 1) {
406
- var segment = routeWithAllAvailablePortals.routes[index];
411
+ const portalsToUse = new Set();
412
+ for (let index = 0; routeWithAllAvailablePortals.routes && index < routeWithAllAvailablePortals.routes.length; index += 1) {
413
+ const segment = routeWithAllAvailablePortals.routes[index];
407
414
  if (segment.isPortal) {
408
415
  portalsToUse.add(segment.edges[0]);
409
416
  portalsToUse.add(segment.edges[1]);
410
417
  }
411
418
  }
412
- var start = performance.now();
419
+ let start = performance.now();
413
420
  // Load data
414
421
  // Load network data
415
- var networkFeatures = (0, _mapObjectsHelper.getNetworkFeatures)(_utils.DEFAULT_DIMENSION);
422
+ const networkFeatures = (0, _mapObjectsHelper.getNetworkFeatures)(_utils.DEFAULT_DIMENSION);
416
423
  // Load portal data
417
- var portalDataForList = (0, _utils.filterPortalEdgeDataByList)(portalData.edgeData, portalsToUse);
424
+ const portalDataForList = (0, _utils.filterPortalEdgeDataByList)(portalData.edgeData, portalsToUse);
418
425
  console.log('time load: ', (performance.now() - start) / 1000);
419
426
  start = performance.now();
420
- var concatenatedEdgeFeatures = source.lines.concat(destination.lines, portalDataForList.lines);
421
- var concatenatedNetworkFeatures = networkFeatures;
427
+ const concatenatedEdgeFeatures = source.lines.concat(destination.lines, portalDataForList.lines);
428
+ const concatenatedNetworkFeatures = networkFeatures;
422
429
  if (runIntersection) (0, _utils.optimized)(concatenatedEdgeFeatures, concatenatedNetworkFeatures);
423
430
  console.log('time network: ', (performance.now() - start) / 1000, networkFeatures.length);
424
431
  return setupGraphAndFindPath(source, destination, portalDataForList.edgeData, concatenatedNetworkFeatures);
425
432
  }
426
433
  function getDirectRoute(source, destination) {
427
- var start = performance.now();
434
+ let start = performance.now();
428
435
  // Load data
429
436
  // Load network data
430
- var networkFeaturesSourceNode = (0, _mapObjectsHelper.getNetworkFeatures)((0, _utils.getParentDimension)(source.where));
431
- var networkFeaturesDestinationNode = (0, _mapObjectsHelper.getNetworkFeatures)((0, _utils.getParentDimension)(destination.where));
437
+ const networkFeaturesSourceNode = (0, _mapObjectsHelper.getNetworkFeatures)((0, _utils.getParentDimension)(source.where));
438
+ const networkFeaturesDestinationNode = (0, _mapObjectsHelper.getNetworkFeatures)((0, _utils.getParentDimension)(destination.where));
432
439
  // Load portal data
433
- var portalDataSourceNode = (0, _utils.filterPortalEdgeDataByWhere)(portalData.edgeData, (0, _utils.getParentDimension)(source.where));
434
- var portalDataDestinationNode = (0, _utils.filterPortalEdgeDataByWhere)(portalData.edgeData, (0, _utils.getParentDimension)(destination.where));
440
+ const portalDataSourceNode = (0, _utils.filterPortalEdgeDataByWhere)(portalData.edgeData, (0, _utils.getParentDimension)(source.where));
441
+ const portalDataDestinationNode = (0, _utils.filterPortalEdgeDataByWhere)(portalData.edgeData, (0, _utils.getParentDimension)(destination.where));
435
442
  console.log('time load: ', (performance.now() - start) / 1000);
436
443
  start = performance.now();
437
- var concatenatedEdgeFeatures = source.lines.concat(destination.lines, portalDataSourceNode.lines, portalDataDestinationNode.lines);
438
- var concatenatedNetworkFeatures = networkFeaturesSourceNode.concat(networkFeaturesDestinationNode);
444
+ const concatenatedEdgeFeatures = source.lines.concat(destination.lines, portalDataSourceNode.lines, portalDataDestinationNode.lines);
445
+ const concatenatedNetworkFeatures = networkFeaturesSourceNode.concat(networkFeaturesDestinationNode);
439
446
  if (runIntersection) (0, _utils.optimized)(concatenatedEdgeFeatures, concatenatedNetworkFeatures);
440
447
  console.log('time network: ', (performance.now() - start) / 1000, networkFeaturesSourceNode.length);
441
- var portalEdgeData = _objectSpread(_objectSpread({}, portalDataSourceNode.edgeData), portalDataDestinationNode.edgeData);
448
+ const portalEdgeData = _objectSpread(_objectSpread({}, portalDataSourceNode.edgeData), portalDataDestinationNode.edgeData);
442
449
  return setupGraphAndFindPath(source, destination, portalEdgeData, concatenatedNetworkFeatures);
443
450
  }
444
451
 
@@ -450,28 +457,28 @@ var RoutingCore = function () {
450
457
  return {};
451
458
  }
452
459
  if (typeof mapObjectId1 !== 'string' || typeof mapObjectId2 !== 'string') runIntersection = true;
453
- var node1 = (0, _mapObjectsHelper.getEdge)(mapObjectId1);
454
- var node2 = (0, _mapObjectsHelper.getEdge)(mapObjectId2);
460
+ const node1 = (0, _mapObjectsHelper.getEdge)(mapObjectId1);
461
+ const node2 = (0, _mapObjectsHelper.getEdge)(mapObjectId2);
455
462
  startNode = node1;
456
463
  endNode = node2;
457
- var start = performance.now();
464
+ let start = performance.now();
458
465
  portalData = (0, _mapObjectsHelper.getPortalDataForDimension)(_utils.DEFAULT_DIMENSION);
459
466
  console.log('time portal load with extrapolation: ', (performance.now() - start) / 1000);
460
467
  start = performance.now();
461
468
  if (startNode && endNode) {
462
469
  changeZoneCheckEnabled = true;
463
- var runRouteIteration = function runRouteIteration() {
464
- var directRoute = getDirectRoute(startNode, endNode);
470
+ const runRouteIteration = () => {
471
+ const directRoute = getDirectRoute(startNode, endNode);
465
472
  console.log('Direct route', directRoute);
466
473
  if ((0, _lodash.isEmpty)(directRoute)) {
467
- var routeWithAllPortals = getRouteWithAllPortals(startNode, endNode);
468
- var _finalRoute = getRouteWithSpecificPortals(startNode, endNode, routeWithAllPortals);
469
- return _finalRoute;
474
+ const routeWithAllPortals = getRouteWithAllPortals(startNode, endNode);
475
+ const finalRoute = getRouteWithSpecificPortals(startNode, endNode, routeWithAllPortals);
476
+ return finalRoute;
470
477
  }
471
- var finalRoute = getRouteWithSpecificPortals(startNode, endNode, directRoute);
478
+ const finalRoute = getRouteWithSpecificPortals(startNode, endNode, directRoute);
472
479
  return finalRoute;
473
480
  };
474
- var route = runRouteIteration();
481
+ let route = runRouteIteration();
475
482
  if ((0, _lodash.isEmpty)(route)) {
476
483
  changeZoneCheckEnabled = false;
477
484
  route = runRouteIteration();
@@ -482,8 +489,8 @@ var RoutingCore = function () {
482
489
  return {};
483
490
  }
484
491
  return {
485
- getRoute: getRoute
492
+ getRoute
486
493
  };
487
494
  }();
488
- var _default = exports["default"] = RoutingCore;
495
+ var _default = exports.default = RoutingCore;
489
496
  //# sourceMappingURL=index.js.map