@twinmatrix/spatialverse-sdk-web 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +9 -9
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +213 -294
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +40 -41
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js +170 -196
- package/lib/cjs/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +167 -215
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js +28 -30
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +861 -1170
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +166 -159
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/interfaces.js +6 -6
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/interfaces.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js +6 -6
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routeLayers.js +3 -3
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routeLayers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +523 -610
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +149 -154
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customStyles.js +2 -2
- package/lib/cjs/meta-atlas-sdk/customStyles.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customerLayer.js +15 -29
- package/lib/cjs/meta-atlas-sdk/customerLayer.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/customerLayerVariant.js +5 -5
- package/lib/cjs/meta-atlas-sdk/customerLayerVariant.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js +809 -1033
- package/lib/cjs/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/helpers.js +32 -49
- package/lib/cjs/meta-atlas-sdk/utils/helpers.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/local-storage.js +21 -34
- package/lib/cjs/meta-atlas-sdk/utils/local-storage.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/mapobjects-store.js +6 -6
- package/lib/cjs/meta-atlas-sdk/utils/mapobjects-store.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/routing-store.js +6 -6
- package/lib/cjs/meta-atlas-sdk/utils/routing-store.js.map +1 -1
- package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js +363 -491
- package/lib/cjs/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
- package/lib/cjs/react/MetaAtlasMap.js +127 -0
- package/lib/cjs/react/MetaAtlasMap.js.map +1 -0
- package/lib/cjs/react/hooks/useDrawing/index.js +17 -18
- package/lib/cjs/react/hooks/useDrawing/index.js.map +1 -1
- package/lib/cjs/react/hooks/useFocus/index.js +48 -55
- package/lib/cjs/react/hooks/useFocus/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMapEvents/index.js +40 -47
- package/lib/cjs/react/hooks/useMapEvents/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMapOverlays/index.js +20 -21
- package/lib/cjs/react/hooks/useMapOverlays/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMetaAtlas/index.js +77 -95
- package/lib/cjs/react/hooks/useMetaAtlas/index.js.map +1 -1
- package/lib/cjs/react/hooks/useMetaAtlas.js +78 -96
- package/lib/cjs/react/hooks/useMetaAtlas.js.map +1 -1
- package/lib/cjs/react/hooks/useRouting/index.js +21 -20
- package/lib/cjs/react/hooks/useRouting/index.js.map +1 -1
- package/lib/cjs/react/hooks/useSearch/index.js +35 -34
- package/lib/cjs/react/hooks/useSearch/index.js.map +1 -1
- package/lib/cjs/react/hooks/useStampRally/index.js +26 -23
- package/lib/cjs/react/hooks/useStampRally/index.js.map +1 -1
- package/lib/cjs/react/hooks/useStampRally/utils.js +2 -2
- package/lib/cjs/react/hooks/useStampRally/utils.js.map +1 -1
- package/lib/cjs/react/index.js +31 -31
- package/lib/cjs/react/index.js.map +1 -1
- package/lib/cjs/react/stores/useMapDataStore.js +47 -62
- package/lib/cjs/react/stores/useMapDataStore.js.map +1 -1
- package/lib/cjs/react/stores/useMetaAtlasStore.js +27 -40
- package/lib/cjs/react/stores/useMetaAtlasStore.js.map +1 -1
- package/lib/esm/index.js +3 -7
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js +4 -3
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/CustomThreeJsWrapper.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js +14 -12
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/utils.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js +204 -200
- package/lib/esm/meta-atlas-sdk/3DMap/MainMap.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js +6 -6
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetch-published-json.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js +4 -3
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/fetchMapObjectsData.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +53 -42
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js +18 -16
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/index.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js +3 -3
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/mapObjectsHelper.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js +73 -79
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/routing-helpers.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js +16 -15
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/routing-core/utils.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/customerLayer.js +4 -1
- package/lib/esm/meta-atlas-sdk/customerLayer.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js +148 -124
- package/lib/esm/meta-atlas-sdk/meta-atlas-sdk.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/helpers.js +4 -2
- package/lib/esm/meta-atlas-sdk/utils/helpers.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/local-storage.js +6 -1
- package/lib/esm/meta-atlas-sdk/utils/local-storage.js.map +1 -1
- package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js +115 -109
- package/lib/esm/meta-atlas-sdk/utils/routing-visualizer/index.js.map +1 -1
- package/lib/esm/react/MetaAtlasMap.js +120 -0
- package/lib/esm/react/MetaAtlasMap.js.map +1 -0
- package/lib/esm/react/hooks/useDrawing/index.js +2 -2
- package/lib/esm/react/hooks/useDrawing/index.js.map +1 -1
- package/lib/esm/react/hooks/useFocus/index.js +4 -3
- package/lib/esm/react/hooks/useFocus/index.js.map +1 -1
- package/lib/esm/react/hooks/useMapEvents/index.js +9 -6
- package/lib/esm/react/hooks/useMapEvents/index.js.map +1 -1
- package/lib/esm/react/hooks/useMapOverlays/index.js +2 -2
- package/lib/esm/react/hooks/useMapOverlays/index.js.map +1 -1
- package/lib/esm/react/hooks/useMetaAtlas/index.js +162 -60
- package/lib/esm/react/hooks/useMetaAtlas/index.js.map +1 -1
- package/lib/esm/react/hooks/useMetaAtlas.js +162 -60
- package/lib/esm/react/hooks/useMetaAtlas.js.map +1 -1
- package/lib/esm/react/hooks/useRouting/index.js +2 -2
- package/lib/esm/react/hooks/useRouting/index.js.map +1 -1
- package/lib/esm/react/hooks/useSearch/index.js +2 -2
- package/lib/esm/react/hooks/useSearch/index.js.map +1 -1
- package/lib/esm/react/hooks/useStampRally/index.js +15 -12
- package/lib/esm/react/hooks/useStampRally/index.js.map +1 -1
- package/lib/esm/react/hooks/useStampRally/utils.js +1 -1
- package/lib/esm/react/hooks/useStampRally/utils.js.map +1 -1
- package/lib/esm/react/index.js +11 -15
- package/lib/esm/react/index.js.map +1 -1
- package/lib/esm/react/stores/useMapDataStore.js +17 -21
- package/lib/esm/react/stores/useMapDataStore.js.map +1 -1
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts +30 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts +5 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts +21 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts +27 -0
- package/lib/types/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts +18 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.d.ts.map +1 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts +37 -0
- package/lib/types/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.d.ts.map +1 -0
- package/package.json +10 -7
|
@@ -12,35 +12,17 @@ var _nearestPointOnLine = require("@turf/nearest-point-on-line");
|
|
|
12
12
|
var _turf = _interopRequireWildcard(require("@turf/turf"));
|
|
13
13
|
var turf = _turf;
|
|
14
14
|
var _transformTranslate = require("@turf/transform-translate");
|
|
15
|
-
var _interfaces = require("../../MetaAtlasCore/routing-core/interfaces");
|
|
16
|
-
var _routingHelpers = require("../../MetaAtlasCore/routing-core/routing-helpers");
|
|
17
|
-
var _routeLayers = require("../../MetaAtlasCore/routing-core/routeLayers");
|
|
18
|
-
var _routingStore = _interopRequireDefault(require("../routing-store"));
|
|
19
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : {
|
|
21
|
-
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); }
|
|
22
|
-
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
23
|
-
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
24
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
25
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
26
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
27
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
28
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
29
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
30
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
31
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
32
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
33
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
34
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
35
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
36
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
+
var _interfaces = require("../../MetaAtlasCore/routing-core/interfaces.js");
|
|
16
|
+
var _routingHelpers = require("../../MetaAtlasCore/routing-core/routing-helpers.js");
|
|
17
|
+
var _routeLayers = require("../../MetaAtlasCore/routing-core/routeLayers.js");
|
|
18
|
+
var _routingStore = _interopRequireDefault(require("../routing-store.js"));
|
|
19
|
+
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); }
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
37
21
|
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; }
|
|
38
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
39
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _this = this;
|
|
43
|
-
_classCallCheck(this, RoutingVisualizer);
|
|
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); } // import { distance } from "@turf/distance";
|
|
24
|
+
class RoutingVisualizer {
|
|
25
|
+
constructor(sdk) {
|
|
44
26
|
// Routing
|
|
45
27
|
_defineProperty(this, "routeSourceName", 'routeGeojson');
|
|
46
28
|
_defineProperty(this, "patchFeatureCollection", {
|
|
@@ -61,15 +43,15 @@ var RoutingVisualizer = exports.RoutingVisualizer = /*#__PURE__*/function () {
|
|
|
61
43
|
from: 0,
|
|
62
44
|
to: 0
|
|
63
45
|
});
|
|
64
|
-
_defineProperty(this, "animateHighlightedRouteSegment",
|
|
65
|
-
|
|
46
|
+
_defineProperty(this, "animateHighlightedRouteSegment", () => {
|
|
47
|
+
const routeFeature = (0, _lodash.cloneDeep)(this.animateRouteSegmentFeatureCollection.features[0]);
|
|
66
48
|
if (routeFeature) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
const currentTime = Date.now();
|
|
50
|
+
const elapsed = currentTime - this.animationStartTime;
|
|
51
|
+
const writeToSource = (feature, coords) => {
|
|
70
52
|
//@ts-ignore
|
|
71
53
|
feature.geometry.coordinates = coords;
|
|
72
|
-
|
|
54
|
+
const routeSource = this.map.getSource(this.animateRouteSourceName);
|
|
73
55
|
if (routeSource) {
|
|
74
56
|
//@ts-ignore
|
|
75
57
|
routeSource.setData({
|
|
@@ -78,27 +60,29 @@ var RoutingVisualizer = exports.RoutingVisualizer = /*#__PURE__*/function () {
|
|
|
78
60
|
});
|
|
79
61
|
}
|
|
80
62
|
};
|
|
81
|
-
|
|
63
|
+
const animationDuration = 2000;
|
|
82
64
|
if (elapsed < animationDuration) {
|
|
83
|
-
|
|
65
|
+
const progress = 1 - elapsed / animationDuration;
|
|
84
66
|
|
|
85
67
|
//@ts-ignore
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
const fullRoute = routeFeature.geometry.coordinates;
|
|
69
|
+
const {
|
|
70
|
+
end
|
|
71
|
+
} = this;
|
|
72
|
+
let currentEnd;
|
|
89
73
|
if (progress > 0.5) {
|
|
90
|
-
|
|
74
|
+
const customProgress = 2 * (progress - 0.5); // map 0.5 - 1 to 0 - 1 range
|
|
91
75
|
currentEnd = end.from * (1.0 - customProgress) + customProgress * end.to;
|
|
92
76
|
} else {
|
|
93
|
-
|
|
94
|
-
currentEnd = end.from * (1.0 -
|
|
77
|
+
const customProgress = progress * 2; // map 0 - 0.5 to 0 - 1 range
|
|
78
|
+
currentEnd = end.from * (1.0 - customProgress) + customProgress * end.to;
|
|
95
79
|
}
|
|
96
80
|
|
|
97
81
|
// calculate distance along the line using current animation percentage
|
|
98
82
|
// percentage travels 1 - 0
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
83
|
+
let prevsum = 0;
|
|
84
|
+
let actsum = 0;
|
|
85
|
+
let i = fullRoute.length - 1;
|
|
102
86
|
while (actsum < currentEnd && i > 0) {
|
|
103
87
|
prevsum = actsum;
|
|
104
88
|
actsum += turf.distance((0, _helpers.point)(fullRoute[i]), (0, _helpers.point)(fullRoute[i - 1]));
|
|
@@ -114,27 +98,27 @@ var RoutingVisualizer = exports.RoutingVisualizer = /*#__PURE__*/function () {
|
|
|
114
98
|
// }
|
|
115
99
|
|
|
116
100
|
// Return coordinates from line start to current percentage point
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
101
|
+
const r = (currentEnd - prevsum) / (actsum - prevsum);
|
|
102
|
+
const or = 1.0 - r;
|
|
103
|
+
const actRoute = [...fullRoute.slice(0, i + 1), [fullRoute[i][0] * r + fullRoute[i + 1][0] * or, fullRoute[i][1] * r + fullRoute[i + 1][1] * or]];
|
|
120
104
|
writeToSource(routeFeature, actRoute);
|
|
121
105
|
} else {
|
|
122
106
|
// Forward animation
|
|
123
107
|
if (actsum <= currentEnd) {
|
|
124
108
|
// Return last two points of the line as final result
|
|
125
|
-
|
|
126
|
-
writeToSource(routeFeature,
|
|
109
|
+
const actRoute = [...fullRoute.slice(fullRoute.length - 2, fullRoute.length)];
|
|
110
|
+
writeToSource(routeFeature, actRoute);
|
|
127
111
|
}
|
|
128
112
|
|
|
129
113
|
// Return coordinates from line end to current percentage point
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
writeToSource(routeFeature,
|
|
114
|
+
const r = (currentEnd - prevsum) / (actsum - prevsum);
|
|
115
|
+
const or = 1.0 - r;
|
|
116
|
+
const actRoute = [[fullRoute[i][0] * r + fullRoute[i + 1][0] * or, fullRoute[i][1] * r + fullRoute[i + 1][1] * or], ...fullRoute.slice(i + 1, fullRoute.length)];
|
|
117
|
+
writeToSource(routeFeature, actRoute);
|
|
134
118
|
}
|
|
135
|
-
|
|
119
|
+
this.animationFrameID = requestAnimationFrame(this.animateHighlightedRouteSegment);
|
|
136
120
|
} else {
|
|
137
|
-
|
|
121
|
+
this.resetRouteSegmentAnimation();
|
|
138
122
|
}
|
|
139
123
|
}
|
|
140
124
|
});
|
|
@@ -143,476 +127,364 @@ var RoutingVisualizer = exports.RoutingVisualizer = /*#__PURE__*/function () {
|
|
|
143
127
|
|
|
144
128
|
// MetaAtlasCore To Editor
|
|
145
129
|
// eslint-disable-next-line class-methods-use-this
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
130
|
+
getCurrentFocus() {
|
|
131
|
+
return this.main.getCurrentFocus();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// eslint-disable-next-line class-methods-use-this
|
|
135
|
+
filterWhereDimension(dimension) {
|
|
136
|
+
this.main.focusTo(dimension, false);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Routing
|
|
140
|
+
setupRouting(map) {
|
|
141
|
+
this.map = map;
|
|
142
|
+
this.map.addSource(this.routeSourceName, {
|
|
143
|
+
type: 'geojson',
|
|
144
|
+
data: this.patchFeatureCollection
|
|
145
|
+
});
|
|
146
|
+
for (const layer of _routeLayers.routeLayers) {
|
|
147
|
+
layer.source = this.routeSourceName;
|
|
148
|
+
this.map.addLayer(layer);
|
|
150
149
|
}
|
|
151
150
|
|
|
152
|
-
//
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
// Animation data
|
|
152
|
+
this.map.addSource(this.animateRouteSourceName, {
|
|
153
|
+
type: 'geojson',
|
|
154
|
+
data: this.animateRouteSegmentFeatureCollection
|
|
155
|
+
});
|
|
156
|
+
for (const layer of _routeLayers.routeAnimateLayers) {
|
|
157
|
+
layer.source = this.animateRouteSourceName;
|
|
158
|
+
this.map.addLayer(layer);
|
|
157
159
|
}
|
|
160
|
+
}
|
|
158
161
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
});
|
|
168
|
-
var _iterator = _createForOfIteratorHelper(_routeLayers.routeLayers),
|
|
169
|
-
_step;
|
|
170
|
-
try {
|
|
171
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
172
|
-
var layer = _step.value;
|
|
173
|
-
layer.source = this.routeSourceName;
|
|
174
|
-
this.map.addLayer(layer);
|
|
175
|
-
}
|
|
162
|
+
// eslint-disable-next-line class-methods-use-this
|
|
163
|
+
async computeRoute(startMapObjectId, endMapObjectId) {
|
|
164
|
+
let wheelChairAccessibleRouting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
165
|
+
let shouldAddOverviewSegment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
166
|
+
let indexOffset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
167
|
+
this.currentPatchNumber = -1;
|
|
168
|
+
const generatedRoute = await (0, _routingHelpers.createRoute)(startMapObjectId, endMapObjectId, wheelChairAccessibleRouting, shouldAddOverviewSegment, indexOffset);
|
|
169
|
+
console.log('internal generated: ', generatedRoute);
|
|
176
170
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
171
|
+
// Generate textual instructions
|
|
172
|
+
(0, _routingHelpers.generateInstructions)(generatedRoute);
|
|
173
|
+
console.log(generatedRoute.segments);
|
|
174
|
+
return generatedRoute;
|
|
175
|
+
}
|
|
176
|
+
handleAllRouteUpdate(allSegments, userPosition, segmentIndex) {
|
|
177
|
+
// Get the LineString Feature of the route
|
|
178
|
+
const featureLineStringToUpdate = allSegments[segmentIndex].features.filter(f => f.geometry.type === 'LineString')[0];
|
|
179
|
+
|
|
180
|
+
// Create a LineString with the coordinates of the route that would be updated accordingly
|
|
181
|
+
const lineStringToUpdate = (0, _turf.lineString)(featureLineStringToUpdate.geometry.coordinates.slice(1));
|
|
182
|
+
|
|
183
|
+
// Create a subset of LineString that contains the first two coords of the route which actually represent the route edge
|
|
184
|
+
const subLine = (0, _turf.lineString)([featureLineStringToUpdate.geometry.coordinates[0], featureLineStringToUpdate.geometry.coordinates[1]]);
|
|
185
|
+
|
|
186
|
+
// Find the nearest point to the user position on the sub line and update the LineString.
|
|
187
|
+
const nearestPoint = (0, _nearestPointOnLine.nearestPointOnLine)(subLine, userPosition.sourceCoords);
|
|
188
|
+
lineStringToUpdate.geometry.coordinates.unshift(userPosition.sourceCoords, nearestPoint.geometry.coordinates);
|
|
189
|
+
const coordsToUpdate = lineStringToUpdate.geometry.coordinates;
|
|
190
|
+
const index = nearestPoint.properties.index;
|
|
191
|
+
const coordsToKeep = coordsToUpdate.slice(index);
|
|
192
|
+
lineStringToUpdate.geometry.coordinates = coordsToKeep;
|
|
193
|
+
lineStringToUpdate.geometry.coordinates.unshift(userPosition.sourceCoords);
|
|
194
|
+
lineStringToUpdate.properties = featureLineStringToUpdate.properties;
|
|
195
|
+
let featureIndex = -1;
|
|
196
|
+
allSegments[segmentIndex].features.map((f, i) => {
|
|
197
|
+
if (f.geometry.type === 'LineString') {
|
|
198
|
+
featureIndex = i;
|
|
199
199
|
}
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// Update the new LineString in the route
|
|
203
|
+
allSegments[segmentIndex].features[featureIndex] = lineStringToUpdate;
|
|
204
|
+
allSegments[segmentIndex].coordinates = lineStringToUpdate.geometry.coordinates;
|
|
205
|
+
}
|
|
206
|
+
async computeRoutes(mapObjectIds) {
|
|
207
|
+
let wheelChairAccessibleRouteOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
208
|
+
if (mapObjectIds.length < 2) {
|
|
209
|
+
console.warn('Invalid array passed to computeRoutes');
|
|
210
|
+
return undefined;
|
|
200
211
|
}
|
|
212
|
+
console.log('calling computeRoutes with mapObjectIds: ', mapObjectIds);
|
|
213
|
+
const mergedRoute = {
|
|
214
|
+
segments: [],
|
|
215
|
+
walkingDistance: 0,
|
|
216
|
+
transportDistance: 0,
|
|
217
|
+
walkingTime: 0,
|
|
218
|
+
transportTime: 0,
|
|
219
|
+
distanceUnit: _interfaces.DISTANCE_UNIT,
|
|
220
|
+
speed: _interfaces.WALK_SPEED
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
// Dummy segment for overview segment
|
|
224
|
+
const dummySegment = {};
|
|
225
|
+
mergedRoute.segments.push(dummySegment);
|
|
226
|
+
let indexOffset = 1; // Index set to 1, since overview segment will be added to 0th index
|
|
201
227
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
var _computeRoute = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(startMapObjectId, endMapObjectId) {
|
|
207
|
-
var wheelChairAccessibleRouting,
|
|
208
|
-
shouldAddOverviewSegment,
|
|
209
|
-
indexOffset,
|
|
210
|
-
generatedRoute,
|
|
211
|
-
_args = arguments;
|
|
212
|
-
return _regenerator().w(function (_context) {
|
|
213
|
-
while (1) switch (_context.n) {
|
|
214
|
-
case 0:
|
|
215
|
-
wheelChairAccessibleRouting = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
216
|
-
shouldAddOverviewSegment = _args.length > 3 && _args[3] !== undefined ? _args[3] : true;
|
|
217
|
-
indexOffset = _args.length > 4 && _args[4] !== undefined ? _args[4] : 0;
|
|
218
|
-
this.currentPatchNumber = -1;
|
|
219
|
-
_context.n = 1;
|
|
220
|
-
return (0, _routingHelpers.createRoute)(startMapObjectId, endMapObjectId, wheelChairAccessibleRouting, shouldAddOverviewSegment, indexOffset);
|
|
221
|
-
case 1:
|
|
222
|
-
generatedRoute = _context.v;
|
|
223
|
-
console.log('internal generated: ', generatedRoute);
|
|
228
|
+
for (let index = 0; index < mapObjectIds.length - 1; index += 1) {
|
|
229
|
+
let startMapObjectId = mapObjectIds[index];
|
|
230
|
+
const endMapObjectId = mapObjectIds[index + 1];
|
|
231
|
+
const shouldAddOverviewSegment = true; // include overview segment in first route
|
|
224
232
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
233
|
+
const id = mapObjectIds[0];
|
|
234
|
+
if (typeof mapObjectIds[0] !== 'string') {
|
|
235
|
+
// Run queryRenderedFeatures.
|
|
236
|
+
const routeData = _routingStore.default.getState().data;
|
|
237
|
+
const point = this.map.project([id.sourceCoords[0], id.sourceCoords[1]]);
|
|
238
|
+
const feats = this.map.queryRenderedFeatures(point);
|
|
239
|
+
feats.map(f => {
|
|
240
|
+
if (routeData[_interfaces.RouteDimension.Edge].hasOwnProperty(f.properties.mapObjectId)) {
|
|
241
|
+
const edgeData = routeData[_interfaces.RouteDimension.Edge][f.properties.mapObjectId];
|
|
242
|
+
if (edgeData.lines.length > 0) {
|
|
243
|
+
startMapObjectId = f.properties.mapObjectId;
|
|
244
|
+
}
|
|
229
245
|
}
|
|
230
|
-
}
|
|
231
|
-
}));
|
|
232
|
-
function computeRoute(_x, _x2) {
|
|
233
|
-
return _computeRoute.apply(this, arguments);
|
|
246
|
+
});
|
|
234
247
|
}
|
|
235
|
-
return computeRoute;
|
|
236
|
-
}()
|
|
237
|
-
}, {
|
|
238
|
-
key: "handleAllRouteUpdate",
|
|
239
|
-
value: function handleAllRouteUpdate(allSegments, userPosition, segmentIndex) {
|
|
240
|
-
// Get the LineString Feature of the route
|
|
241
|
-
var featureLineStringToUpdate = allSegments[segmentIndex].features.filter(function (f) {
|
|
242
|
-
return f.geometry.type === 'LineString';
|
|
243
|
-
})[0];
|
|
244
|
-
|
|
245
|
-
// Create a LineString with the coordinates of the route that would be updated accordingly
|
|
246
|
-
var lineStringToUpdate = (0, _turf.lineString)(featureLineStringToUpdate.geometry.coordinates.slice(1));
|
|
247
|
-
|
|
248
|
-
// Create a subset of LineString that contains the first two coords of the route which actually represent the route edge
|
|
249
|
-
var subLine = (0, _turf.lineString)([featureLineStringToUpdate.geometry.coordinates[0], featureLineStringToUpdate.geometry.coordinates[1]]);
|
|
250
248
|
|
|
251
|
-
//
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
lineStringToUpdate.geometry.coordinates = coordsToKeep;
|
|
258
|
-
lineStringToUpdate.geometry.coordinates.unshift(userPosition.sourceCoords);
|
|
259
|
-
lineStringToUpdate.properties = featureLineStringToUpdate.properties;
|
|
260
|
-
var featureIndex = -1;
|
|
261
|
-
allSegments[segmentIndex].features.map(function (f, i) {
|
|
262
|
-
if (f.geometry.type === 'LineString') {
|
|
263
|
-
featureIndex = i;
|
|
264
|
-
}
|
|
265
|
-
});
|
|
249
|
+
// eslint-disable-next-line no-await-in-loop
|
|
250
|
+
const generatedRoute = await this.computeRoute(startMapObjectId, endMapObjectId, wheelChairAccessibleRouteOnly, shouldAddOverviewSegment, indexOffset);
|
|
251
|
+
const allSegments = generatedRoute.segments;
|
|
252
|
+
// if (typeof mapObjectIds[index] !== 'string' && typeof startMapObjectId === 'string') {
|
|
253
|
+
// //Handle SectionOverview:
|
|
254
|
+
// this.handleAllRouteUpdate(allSegments, id as UserPosition, 0);
|
|
266
255
|
|
|
267
|
-
//
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
var _this2 = this;
|
|
276
|
-
var wheelChairAccessibleRouteOnly,
|
|
277
|
-
mergedRoute,
|
|
278
|
-
dummySegment,
|
|
279
|
-
indexOffset,
|
|
280
|
-
_loop,
|
|
281
|
-
index,
|
|
282
|
-
overviewSegment,
|
|
283
|
-
_args3 = arguments;
|
|
284
|
-
return _regenerator().w(function (_context3) {
|
|
285
|
-
while (1) switch (_context3.n) {
|
|
286
|
-
case 0:
|
|
287
|
-
wheelChairAccessibleRouteOnly = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : false;
|
|
288
|
-
if (!(mapObjectIds.length < 2)) {
|
|
289
|
-
_context3.n = 1;
|
|
290
|
-
break;
|
|
291
|
-
}
|
|
292
|
-
console.warn('Invalid array passed to computeRoutes');
|
|
293
|
-
return _context3.a(2, undefined);
|
|
294
|
-
case 1:
|
|
295
|
-
console.log('calling computeRoutes with mapObjectIds: ', mapObjectIds);
|
|
296
|
-
mergedRoute = {
|
|
297
|
-
segments: [],
|
|
298
|
-
walkingDistance: 0,
|
|
299
|
-
transportDistance: 0,
|
|
300
|
-
walkingTime: 0,
|
|
301
|
-
transportTime: 0,
|
|
302
|
-
distanceUnit: _interfaces.DISTANCE_UNIT,
|
|
303
|
-
speed: _interfaces.WALK_SPEED
|
|
304
|
-
}; // Dummy segment for overview segment
|
|
305
|
-
dummySegment = {};
|
|
306
|
-
mergedRoute.segments.push(dummySegment);
|
|
307
|
-
indexOffset = 1; // Index set to 1, since overview segment will be added to 0th index
|
|
308
|
-
_loop = /*#__PURE__*/_regenerator().m(function _loop() {
|
|
309
|
-
var startMapObjectId, endMapObjectId, shouldAddOverviewSegment, id, routeData, _point, feats, generatedRoute, allSegments, segmentOverview, j, segment;
|
|
310
|
-
return _regenerator().w(function (_context2) {
|
|
311
|
-
while (1) switch (_context2.n) {
|
|
312
|
-
case 0:
|
|
313
|
-
startMapObjectId = mapObjectIds[index];
|
|
314
|
-
endMapObjectId = mapObjectIds[index + 1];
|
|
315
|
-
shouldAddOverviewSegment = true; // include overview segment in first route
|
|
316
|
-
id = mapObjectIds[0];
|
|
317
|
-
if (typeof mapObjectIds[0] !== 'string') {
|
|
318
|
-
// Run queryRenderedFeatures.
|
|
319
|
-
routeData = _routingStore["default"].getState().data;
|
|
320
|
-
_point = _this2.map.project([id.sourceCoords[0], id.sourceCoords[1]]);
|
|
321
|
-
feats = _this2.map.queryRenderedFeatures(_point);
|
|
322
|
-
feats.map(function (f) {
|
|
323
|
-
if (routeData[_interfaces.RouteDimension.Edge].hasOwnProperty(f.properties.mapObjectId)) {
|
|
324
|
-
var edgeData = routeData[_interfaces.RouteDimension.Edge][f.properties.mapObjectId];
|
|
325
|
-
if (edgeData.lines.length > 0) {
|
|
326
|
-
startMapObjectId = f.properties.mapObjectId;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
}
|
|
256
|
+
// // Handle the second segment.
|
|
257
|
+
// const secondSegmentFeatures = generatedRoute.segments[1].features;
|
|
258
|
+
// if (secondSegmentFeatures.length < 3 && secondSegmentFeatures[0].geometry.type === 'Point') {
|
|
259
|
+
// secondSegmentFeatures[0].geometry.coordinates = id.sourceCoords;
|
|
260
|
+
// allSegments[1].coordinates = id.sourceCoords as any;
|
|
261
|
+
// } else {
|
|
262
|
+
// this.handleAllRouteUpdate(allSegments, id as UserPosition, 1);
|
|
263
|
+
// }
|
|
331
264
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
// const secondSegmentFeatures = generatedRoute.segments[1].features;
|
|
342
|
-
// if (secondSegmentFeatures.length < 3 && secondSegmentFeatures[0].geometry.type === 'Point') {
|
|
343
|
-
// secondSegmentFeatures[0].geometry.coordinates = id.sourceCoords;
|
|
344
|
-
// allSegments[1].coordinates = id.sourceCoords as any;
|
|
345
|
-
// } else {
|
|
346
|
-
// this.handleAllRouteUpdate(allSegments, id as UserPosition, 1);
|
|
347
|
-
// }
|
|
348
|
-
// // Handle third segment
|
|
349
|
-
// const thirdSegmentFeatures = generatedRoute.segments[2].features;
|
|
350
|
-
// if (thirdSegmentFeatures.length < 3 && thirdSegmentFeatures.geometry.type === 'Point') {
|
|
351
|
-
// allSegments[1].features[0].geometry.coordinates = id.sourceCoords;
|
|
352
|
-
// allSegments[1].coordinates = id.sourceCoords as any;
|
|
353
|
-
// } else {
|
|
354
|
-
// this.handleAllRouteUpdate(allSegments, id as UserPosition, 2);
|
|
355
|
-
// }
|
|
356
|
-
// }
|
|
357
|
-
if (generatedRoute.segments.length > 0) {
|
|
358
|
-
segmentOverview = generatedRoute.segments[0];
|
|
359
|
-
segmentOverview.maneuverType = _routingHelpers.ManeuverType.SectionOverview;
|
|
360
|
-
segmentOverview.instructions = ["".concat(segmentOverview.startEdge.name, " to ").concat(segmentOverview.endEdge.name)];
|
|
361
|
-
}
|
|
362
|
-
for (j = 0; j < generatedRoute.segments.length; j += 1) {
|
|
363
|
-
segment = generatedRoute.segments[j];
|
|
364
|
-
mergedRoute.segments.push(segment);
|
|
365
|
-
}
|
|
366
|
-
mergedRoute.walkingDistance += generatedRoute.walkingDistance;
|
|
367
|
-
mergedRoute.transportDistance += generatedRoute.transportDistance;
|
|
368
|
-
mergedRoute.walkingTime += generatedRoute.walkingTime;
|
|
369
|
-
mergedRoute.transportTime += generatedRoute.transportTime;
|
|
265
|
+
// // Handle third segment
|
|
266
|
+
// const thirdSegmentFeatures = generatedRoute.segments[2].features;
|
|
267
|
+
// if (thirdSegmentFeatures.length < 3 && thirdSegmentFeatures.geometry.type === 'Point') {
|
|
268
|
+
// allSegments[1].features[0].geometry.coordinates = id.sourceCoords;
|
|
269
|
+
// allSegments[1].coordinates = id.sourceCoords as any;
|
|
270
|
+
// } else {
|
|
271
|
+
// this.handleAllRouteUpdate(allSegments, id as UserPosition, 2);
|
|
272
|
+
// }
|
|
273
|
+
// }
|
|
370
274
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
}, _loop);
|
|
377
|
-
});
|
|
378
|
-
index = 0;
|
|
379
|
-
case 2:
|
|
380
|
-
if (!(index < mapObjectIds.length - 1)) {
|
|
381
|
-
_context3.n = 4;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
return _context3.d(_regeneratorValues(_loop()), 3);
|
|
385
|
-
case 3:
|
|
386
|
-
index += 1;
|
|
387
|
-
_context3.n = 2;
|
|
388
|
-
break;
|
|
389
|
-
case 4:
|
|
390
|
-
if (mergedRoute.segments.length > 1) {
|
|
391
|
-
// Use 1 here because 1 dummy segment will always be included
|
|
392
|
-
overviewSegment = (0, _routingHelpers.generateOverviewSegment)(mergedRoute);
|
|
393
|
-
mergedRoute.segments[0] = overviewSegment;
|
|
394
|
-
} else {
|
|
395
|
-
mergedRoute.segments.length = 0; // Remove dummy segment
|
|
396
|
-
}
|
|
397
|
-
console.log('merged route: ', mergedRoute);
|
|
398
|
-
return _context3.a(2, mergedRoute);
|
|
399
|
-
}
|
|
400
|
-
}, _callee2);
|
|
401
|
-
}));
|
|
402
|
-
function computeRoutes(_x3) {
|
|
403
|
-
return _computeRoutes.apply(this, arguments);
|
|
275
|
+
if (generatedRoute.segments.length > 0) {
|
|
276
|
+
const segmentOverview = generatedRoute.segments[0];
|
|
277
|
+
segmentOverview.maneuverType = _routingHelpers.ManeuverType.SectionOverview;
|
|
278
|
+
segmentOverview.instructions = ["".concat(segmentOverview.startEdge.name, " to ").concat(segmentOverview.endEdge.name)];
|
|
404
279
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}, {
|
|
417
|
-
key: "updateAnimateRouteSource",
|
|
418
|
-
value: function updateAnimateRouteSource(updatedFeatureCollection) {
|
|
419
|
-
if (!this.map) return false;
|
|
420
|
-
this.animateRouteSegmentFeatureCollection = updatedFeatureCollection;
|
|
421
|
-
var routeSource = this.map.getSource(this.animateRouteSourceName);
|
|
422
|
-
if (routeSource) routeSource.setData(updatedFeatureCollection);
|
|
423
|
-
return true;
|
|
424
|
-
}
|
|
425
|
-
}, {
|
|
426
|
-
key: "setActiveRoute",
|
|
427
|
-
value: function setActiveRoute(route) {
|
|
428
|
-
this.route = route;
|
|
280
|
+
for (let j = 0; j < generatedRoute.segments.length; j += 1) {
|
|
281
|
+
const segment = generatedRoute.segments[j];
|
|
282
|
+
mergedRoute.segments.push(segment);
|
|
283
|
+
}
|
|
284
|
+
mergedRoute.walkingDistance += generatedRoute.walkingDistance;
|
|
285
|
+
mergedRoute.transportDistance += generatedRoute.transportDistance;
|
|
286
|
+
mergedRoute.walkingTime += generatedRoute.walkingTime;
|
|
287
|
+
mergedRoute.transportTime += generatedRoute.transportTime;
|
|
288
|
+
|
|
289
|
+
// Increment by segment count
|
|
290
|
+
indexOffset += generatedRoute.segments.length;
|
|
429
291
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
292
|
+
if (mergedRoute.segments.length > 1) {
|
|
293
|
+
// Use 1 here because 1 dummy segment will always be included
|
|
294
|
+
const overviewSegment = (0, _routingHelpers.generateOverviewSegment)(mergedRoute);
|
|
295
|
+
mergedRoute.segments[0] = overviewSegment;
|
|
296
|
+
} else {
|
|
297
|
+
mergedRoute.segments.length = 0; // Remove dummy segment
|
|
434
298
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
299
|
+
console.log('merged route: ', mergedRoute);
|
|
300
|
+
return mergedRoute;
|
|
301
|
+
}
|
|
302
|
+
updateRouteSource(updatedFeatureCollection) {
|
|
303
|
+
if (!this.map) return false;
|
|
304
|
+
this.patchFeatureCollection = updatedFeatureCollection;
|
|
305
|
+
const routeSource = this.map.getSource(this.routeSourceName);
|
|
306
|
+
if (routeSource) routeSource.setData(updatedFeatureCollection);
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
updateAnimateRouteSource(updatedFeatureCollection) {
|
|
310
|
+
if (!this.map) return false;
|
|
311
|
+
this.animateRouteSegmentFeatureCollection = updatedFeatureCollection;
|
|
312
|
+
const routeSource = this.map.getSource(this.animateRouteSourceName);
|
|
313
|
+
if (routeSource) routeSource.setData(updatedFeatureCollection);
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
setActiveRoute(route) {
|
|
317
|
+
this.route = route;
|
|
318
|
+
}
|
|
319
|
+
getActiveRoute() {
|
|
320
|
+
return this.route;
|
|
321
|
+
}
|
|
322
|
+
resetRouteSegmentAnimation() {
|
|
323
|
+
this.animationStartTime = Date.now();
|
|
324
|
+
cancelAnimationFrame(this.animationFrameID);
|
|
325
|
+
if (this.animateRouteSegmentFeatureCollection.features.length > 0) {
|
|
326
|
+
const routeFeature = this.animateRouteSegmentFeatureCollection.features[0];
|
|
327
|
+
//@ts-ignore
|
|
328
|
+
if (routeFeature.geometry.type === 'LineString') this.animateHighlightedRouteSegment();
|
|
445
329
|
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
this.resetRouteSegmentAnimation();
|
|
330
|
+
}
|
|
331
|
+
updateFeaturesToAnimate(segmentNumber, whereDimensionForFeatures) {
|
|
332
|
+
if (this.route && this.route.segments.length > segmentNumber) {
|
|
333
|
+
const routeSegment = this.route.segments[segmentNumber];
|
|
334
|
+
// set features for animated segment source
|
|
335
|
+
if (routeSegment.features.length > 0) {
|
|
336
|
+
const lineFeaturesOfSegment =
|
|
337
|
+
// include where dimension here?
|
|
338
|
+
(0, _routingHelpers.getLineStringFeaturesOfRouteSegment)(routeSegment, whereDimensionForFeatures);
|
|
339
|
+
if (lineFeaturesOfSegment.length > 0) {
|
|
340
|
+
this.updateAnimateRouteSource({
|
|
341
|
+
type: 'FeatureCollection',
|
|
342
|
+
features: lineFeaturesOfSegment
|
|
343
|
+
});
|
|
344
|
+
const ls = lineFeaturesOfSegment[0];
|
|
345
|
+
//@ts-ignore
|
|
346
|
+
const nearest = (0, _nearestPointOnLine.nearestPointOnLine)(ls, (0, _helpers.point)(lineFeaturesOfSegment[0].geometry.coordinates[0]));
|
|
347
|
+
const toDist = (0, _length.default)(ls) - nearest.properties.location;
|
|
348
|
+
this.end = {
|
|
349
|
+
from: 0,
|
|
350
|
+
to: toDist
|
|
351
|
+
};
|
|
352
|
+
} else {
|
|
353
|
+
this.updateAnimateRouteSource({
|
|
354
|
+
type: 'FeatureCollection',
|
|
355
|
+
features: []
|
|
356
|
+
});
|
|
476
357
|
}
|
|
358
|
+
this.resetRouteSegmentAnimation();
|
|
477
359
|
}
|
|
478
360
|
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
361
|
+
}
|
|
362
|
+
highlightRouteSegment(segmentNumberToHighlight) {
|
|
363
|
+
let updateFilters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
364
|
+
const {
|
|
365
|
+
route
|
|
366
|
+
} = this;
|
|
367
|
+
if (route && route.segments.length > segmentNumberToHighlight) {
|
|
368
|
+
if (route.segments[segmentNumberToHighlight].coordinates.length > 0) {
|
|
369
|
+
this.highlightedSegmentNumber = segmentNumberToHighlight;
|
|
370
|
+
const routeSegment = route.segments[segmentNumberToHighlight];
|
|
371
|
+
const segmentWhereDimension = routeSegment.maneuverType === _routingHelpers.ManeuverType.ExitPortal || routeSegment.maneuverType === _routingHelpers.ManeuverType.Static ? routeSegment.endEdge.whereDimension : routeSegment.startEdge.whereDimension;
|
|
372
|
+
let routeFeaturesToUse = this.patchFeatureCollection.features;
|
|
490
373
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
374
|
+
// update visible route features if required
|
|
375
|
+
const segmentPatchNumber = routeSegment.features[0].properties.patchNumber;
|
|
376
|
+
if (this.currentPatchNumber !== segmentPatchNumber) {
|
|
377
|
+
this.currentPatchNumber = segmentPatchNumber;
|
|
378
|
+
const featureCollectionToDraw = {
|
|
379
|
+
type: 'FeatureCollection',
|
|
380
|
+
features: (0, _routingHelpers.getFeaturesForPatch)(route, segmentPatchNumber, {
|
|
381
|
+
includeOverviewFeatures: (0, _routingHelpers.isOverviewSegment)(routeSegment),
|
|
382
|
+
patchNumberForOverviewFeatures: segmentPatchNumber
|
|
383
|
+
})
|
|
384
|
+
};
|
|
385
|
+
routeFeaturesToUse = featureCollectionToDraw.features;
|
|
386
|
+
}
|
|
387
|
+
if (segmentWhereDimension && segmentWhereDimension !== this.getCurrentFocus() && updateFilters) {
|
|
388
|
+
this.filterWhereDimension(segmentWhereDimension);
|
|
389
|
+
}
|
|
507
390
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
391
|
+
// update highlighted route segment
|
|
392
|
+
const updatedFeatures = (0, _routingHelpers.highlightRouteSegment)(routeFeaturesToUse, segmentNumberToHighlight);
|
|
393
|
+
this.updateRouteSource({
|
|
394
|
+
type: 'FeatureCollection',
|
|
395
|
+
features: updatedFeatures
|
|
396
|
+
});
|
|
397
|
+
if (!(0, _routingHelpers.isOverviewSegment)(routeSegment)) {
|
|
398
|
+
this.updateFeaturesToAnimate(segmentNumberToHighlight, segmentWhereDimension);
|
|
399
|
+
} else {
|
|
400
|
+
// clear animation source
|
|
401
|
+
this.updateAnimateRouteSource({
|
|
511
402
|
type: 'FeatureCollection',
|
|
512
|
-
features:
|
|
403
|
+
features: []
|
|
513
404
|
});
|
|
514
|
-
|
|
515
|
-
this.updateFeaturesToAnimate(segmentNumberToHighlight, segmentWhereDimension);
|
|
516
|
-
} else {
|
|
517
|
-
// clear animation source
|
|
518
|
-
this.updateAnimateRouteSource({
|
|
519
|
-
type: 'FeatureCollection',
|
|
520
|
-
features: []
|
|
521
|
-
});
|
|
522
|
-
}
|
|
405
|
+
}
|
|
523
406
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
407
|
+
// animate camera to segment
|
|
408
|
+
if (routeSegment) {
|
|
409
|
+
const getStartCoords = feature => {
|
|
410
|
+
//@ts-ignore
|
|
411
|
+
if (feature.geometry.type === 'Point') {
|
|
527
412
|
//@ts-ignore
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
return feature.geometry.coordinates;
|
|
531
|
-
}
|
|
413
|
+
return feature.geometry.coordinates;
|
|
414
|
+
}
|
|
532
415
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
try {
|
|
572
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
573
|
-
var coord = _step3.value;
|
|
574
|
-
llb.extend(coord);
|
|
575
|
-
}
|
|
576
|
-
} catch (err) {
|
|
577
|
-
_iterator3.e(err);
|
|
578
|
-
} finally {
|
|
579
|
-
_iterator3.f();
|
|
580
|
-
}
|
|
416
|
+
//@ts-ignore
|
|
417
|
+
return feature.geometry.coordinates[0];
|
|
418
|
+
};
|
|
419
|
+
const canvas = this.map.getCanvas();
|
|
420
|
+
const w = canvas.clientWidth;
|
|
421
|
+
const h = canvas.clientHeight;
|
|
422
|
+
const fitBoundsConfig = {
|
|
423
|
+
padding: {
|
|
424
|
+
top: h * 0.2,
|
|
425
|
+
bottom: h * 0.2,
|
|
426
|
+
left: w * 0.2,
|
|
427
|
+
right: w * 0.2
|
|
428
|
+
},
|
|
429
|
+
duration: 1000,
|
|
430
|
+
bearing: this.map.getBearing(),
|
|
431
|
+
pitch: this.map.getPitch()
|
|
432
|
+
};
|
|
433
|
+
if (routeSegment.coordinates.length > 1) {
|
|
434
|
+
const currentPatchFeatures = (0, _routingHelpers.getPatch)(route, routeSegment.patchNumber);
|
|
435
|
+
const startCoords = getStartCoords(currentPatchFeatures[0]);
|
|
436
|
+
// let index = 0;
|
|
437
|
+
// for (index = 0; index < currentPatchFeatures.length; index++) {
|
|
438
|
+
// const element = currentPatchFeatures[index];
|
|
439
|
+
// if (element.properties.segmentNumber === segmentNumberToHighlight) {
|
|
440
|
+
// startCoords = getStartCoords(element);
|
|
441
|
+
// }
|
|
442
|
+
// }
|
|
443
|
+
const sw = new _maplibreGl.default.LngLat(startCoords[0], startCoords[1]);
|
|
444
|
+
const ne = new _maplibreGl.default.LngLat(startCoords[0], startCoords[1]);
|
|
445
|
+
const llb = new _maplibreGl.default.LngLatBounds(sw, ne);
|
|
446
|
+
for (let index = 0; index < currentPatchFeatures.length; index++) {
|
|
447
|
+
const element = currentPatchFeatures[index];
|
|
448
|
+
if (element.geometry.type === 'Point') {
|
|
449
|
+
llb.extend(element.geometry.coordinates);
|
|
450
|
+
} else {
|
|
451
|
+
//@ts-ignore
|
|
452
|
+
for (const coord of element.geometry.coordinates) {
|
|
453
|
+
llb.extend(coord);
|
|
581
454
|
}
|
|
582
455
|
}
|
|
583
|
-
this.map.fitBounds(llb, fitBoundsConfig);
|
|
584
|
-
} else {
|
|
585
|
-
// Translate the point slightly to get another point which can used for the fitBounds function.
|
|
586
|
-
var transformedFeatures = {
|
|
587
|
-
type: 'FeatureCollection',
|
|
588
|
-
features: [(0, _helpers.point)(routeSegment.coordinates[0])]
|
|
589
|
-
};
|
|
590
|
-
var forwardTransformed = (0, _transformTranslate.transformTranslate)(transformedFeatures, 0.025, 3).features[0].geometry.coordinates;
|
|
591
|
-
var reverseTransformed = (0, _transformTranslate.transformTranslate)(transformedFeatures, -0.025, -3).features[0].geometry.coordinates;
|
|
592
|
-
var bbox = [reverseTransformed, forwardTransformed];
|
|
593
|
-
this.map.fitBounds(bbox, fitBoundsConfig);
|
|
594
456
|
}
|
|
457
|
+
this.map.fitBounds(llb, fitBoundsConfig);
|
|
458
|
+
} else {
|
|
459
|
+
// Translate the point slightly to get another point which can used for the fitBounds function.
|
|
460
|
+
const transformedFeatures = {
|
|
461
|
+
type: 'FeatureCollection',
|
|
462
|
+
features: [(0, _helpers.point)(routeSegment.coordinates[0])]
|
|
463
|
+
};
|
|
464
|
+
const forwardTransformed = (0, _transformTranslate.transformTranslate)(transformedFeatures, 0.025, 3).features[0].geometry.coordinates;
|
|
465
|
+
const reverseTransformed = (0, _transformTranslate.transformTranslate)(transformedFeatures, -0.025, -3).features[0].geometry.coordinates;
|
|
466
|
+
const bbox = [reverseTransformed, forwardTransformed];
|
|
467
|
+
this.map.fitBounds(bbox, fitBoundsConfig);
|
|
595
468
|
}
|
|
596
|
-
} else {
|
|
597
|
-
console.log('at vertical portal segment, ignoring!');
|
|
598
469
|
}
|
|
599
|
-
console.log(route.segments[segmentNumberToHighlight].instructions);
|
|
600
470
|
} else {
|
|
601
|
-
console.
|
|
471
|
+
console.log('at vertical portal segment, ignoring!');
|
|
602
472
|
}
|
|
473
|
+
console.log(route.segments[segmentNumberToHighlight].instructions);
|
|
474
|
+
} else {
|
|
475
|
+
console.warn('Invalid segment number passed to highlightRouteSegment');
|
|
603
476
|
}
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}();
|
|
477
|
+
}
|
|
478
|
+
clearRoute() {
|
|
479
|
+
const featureCollectionToDraw = {
|
|
480
|
+
type: 'FeatureCollection',
|
|
481
|
+
features: []
|
|
482
|
+
};
|
|
483
|
+
this.updateRouteSource(featureCollectionToDraw);
|
|
484
|
+
this.updateAnimateRouteSource(featureCollectionToDraw);
|
|
485
|
+
this.route = null;
|
|
486
|
+
cancelAnimationFrame(this.animationFrameID);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
exports.RoutingVisualizer = RoutingVisualizer;
|
|
618
490
|
//# sourceMappingURL=index.js.map
|