@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
|
@@ -4,38 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MetaAtlasCore = exports.FilterType = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _focustreeJson = _interopRequireDefault(require("./focustree.json.js"));
|
|
8
|
+
var _whatTaxonomiesJson = _interopRequireDefault(require("./whatTaxonomies.json.js"));
|
|
9
9
|
var _length = _interopRequireDefault(require("@turf/length"));
|
|
10
10
|
var _helpers = require("@turf/helpers");
|
|
11
11
|
var _center = _interopRequireDefault(require("@turf/center"));
|
|
12
12
|
var _lineSliceAlong = _interopRequireDefault(require("@turf/line-slice-along"));
|
|
13
13
|
var _booleanPointInPolygon = _interopRequireDefault(require("@turf/boolean-point-in-polygon"));
|
|
14
14
|
var _axios = _interopRequireDefault(require("axios"));
|
|
15
|
-
var _localStorage = require("../utils/local-storage");
|
|
16
|
-
var _fetchPublishedJson = require("./fetch-published-json");
|
|
17
|
-
var _mapobjectsStore = _interopRequireDefault(require("../utils/mapobjects-store"));
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : {
|
|
19
|
-
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); }
|
|
20
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
21
|
-
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."); }
|
|
22
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
23
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
24
|
-
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; } } }; }
|
|
25
|
-
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; } }
|
|
26
|
-
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; }
|
|
15
|
+
var _localStorage = require("../utils/local-storage.js");
|
|
16
|
+
var _fetchPublishedJson = require("./fetch-published-json.js");
|
|
17
|
+
var _mapobjectsStore = _interopRequireDefault(require("../utils/mapobjects-store.js"));
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
19
|
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; }
|
|
28
20
|
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; }
|
|
29
|
-
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 }; })(); }
|
|
30
|
-
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); }
|
|
31
|
-
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); }
|
|
32
|
-
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); }); }; }
|
|
33
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
34
|
-
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); } }
|
|
35
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
36
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; }
|
|
37
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
38
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
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); }
|
|
39
24
|
// Type for clicked features that includes both metaFeature data and raw click event
|
|
40
25
|
var SortType = /*#__PURE__*/function (SortType) {
|
|
41
26
|
SortType["Name"] = "Name";
|
|
@@ -44,15 +29,14 @@ var SortType = /*#__PURE__*/function (SortType) {
|
|
|
44
29
|
SortType["RelevanceStrict"] = "RelevanceStrict";
|
|
45
30
|
return SortType;
|
|
46
31
|
}(SortType || {});
|
|
47
|
-
|
|
32
|
+
let FilterType = exports.FilterType = /*#__PURE__*/function (FilterType) {
|
|
48
33
|
FilterType["Name"] = "title";
|
|
49
34
|
FilterType["LocalRef"] = "localRef";
|
|
50
35
|
FilterType["WhatTaxonomy"] = "dimension_what";
|
|
51
36
|
return FilterType;
|
|
52
37
|
}({});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_classCallCheck(this, MetaAtlasCore);
|
|
38
|
+
class MetaAtlasCore {
|
|
39
|
+
constructor() {
|
|
56
40
|
_defineProperty(this, "defaultFocusedTaxonomy", 'where.changi');
|
|
57
41
|
_defineProperty(this, "searchableGeoJsonFeatures", []);
|
|
58
42
|
_defineProperty(this, "currentFocus", this.defaultFocusedTaxonomy);
|
|
@@ -79,1275 +63,982 @@ var MetaAtlasCore = exports.MetaAtlasCore = /*#__PURE__*/function () {
|
|
|
79
63
|
clickEvent: null
|
|
80
64
|
};
|
|
81
65
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
(0, _axios["default"])(config).then(/*#__PURE__*/function () {
|
|
109
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(response) {
|
|
110
|
-
var _response$data;
|
|
111
|
-
return _regenerator().w(function (_context) {
|
|
112
|
-
while (1) switch (_context.n) {
|
|
113
|
-
case 0:
|
|
114
|
-
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.accessToken) {
|
|
115
|
-
_this.atomsAPIAccessToken = response.data.accessToken;
|
|
116
|
-
onAuthenticationResponse({
|
|
117
|
-
authenticated: true
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
case 1:
|
|
121
|
-
return _context.a(2);
|
|
122
|
-
}
|
|
123
|
-
}, _callee);
|
|
124
|
-
}));
|
|
125
|
-
return function (_x) {
|
|
126
|
-
return _ref.apply(this, arguments);
|
|
127
|
-
};
|
|
128
|
-
}())["catch"](function (error) {
|
|
66
|
+
init(apiServerURL, token, secretKey, onAuthenticationResponse) {
|
|
67
|
+
this.empApi = apiServerURL;
|
|
68
|
+
this.token = token;
|
|
69
|
+
this.secretKeyForDecryption = secretKey;
|
|
70
|
+
this.getAtomsAPIAccessToken(onAuthenticationResponse);
|
|
71
|
+
}
|
|
72
|
+
getAtomsAPIAccessToken(onAuthenticationResponse) {
|
|
73
|
+
const data = JSON.stringify({
|
|
74
|
+
strategy: 'atomstoken',
|
|
75
|
+
atomsSdkToken: this.token,
|
|
76
|
+
clientEngine: 'API',
|
|
77
|
+
clientOS: 'Linux'
|
|
78
|
+
});
|
|
79
|
+
const config = {
|
|
80
|
+
method: 'post',
|
|
81
|
+
url: "".concat(this.empApi, "/authentication"),
|
|
82
|
+
headers: {
|
|
83
|
+
'Content-Type': 'application/json'
|
|
84
|
+
},
|
|
85
|
+
data: data
|
|
86
|
+
};
|
|
87
|
+
(0, _axios.default)(config).then(async response => {
|
|
88
|
+
var _response$data;
|
|
89
|
+
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.accessToken) {
|
|
90
|
+
this.atomsAPIAccessToken = response.data.accessToken;
|
|
129
91
|
onAuthenticationResponse({
|
|
130
|
-
authenticated:
|
|
131
|
-
error: error
|
|
92
|
+
authenticated: true
|
|
132
93
|
});
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}, {
|
|
136
|
-
key: "setupRouting",
|
|
137
|
-
value: function () {
|
|
138
|
-
var _setupRouting = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(onRoutingStatusUpdateCallback) {
|
|
139
|
-
var status;
|
|
140
|
-
return _regenerator().w(function (_context2) {
|
|
141
|
-
while (1) switch (_context2.n) {
|
|
142
|
-
case 0:
|
|
143
|
-
_context2.n = 1;
|
|
144
|
-
return (0, _fetchPublishedJson.getPublishedData)({
|
|
145
|
-
URL: this.empApi,
|
|
146
|
-
accessToken: this.atomsAPIAccessToken,
|
|
147
|
-
secretKey: this.secretKeyForDecryption,
|
|
148
|
-
publishedDataType: _fetchPublishedJson.PublishedDataType.Routing
|
|
149
|
-
}, this.storage);
|
|
150
|
-
case 1:
|
|
151
|
-
status = _context2.v;
|
|
152
|
-
this.routingStatus = status;
|
|
153
|
-
console.log('routing status: ', status);
|
|
154
|
-
if (onRoutingStatusUpdateCallback) {
|
|
155
|
-
onRoutingStatusUpdateCallback(status === _fetchPublishedJson.Status.Ready ? true : false);
|
|
156
|
-
}
|
|
157
|
-
case 2:
|
|
158
|
-
return _context2.a(2);
|
|
159
|
-
}
|
|
160
|
-
}, _callee2, this);
|
|
161
|
-
}));
|
|
162
|
-
function setupRouting(_x2) {
|
|
163
|
-
return _setupRouting.apply(this, arguments);
|
|
164
94
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
95
|
+
}).catch(function (error) {
|
|
96
|
+
onAuthenticationResponse({
|
|
97
|
+
authenticated: false,
|
|
98
|
+
error: error
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
async setupRouting(onRoutingStatusUpdateCallback) {
|
|
103
|
+
const status = await (0, _fetchPublishedJson.getPublishedData)({
|
|
104
|
+
URL: this.empApi,
|
|
105
|
+
accessToken: this.atomsAPIAccessToken,
|
|
106
|
+
secretKey: this.secretKeyForDecryption,
|
|
107
|
+
publishedDataType: _fetchPublishedJson.PublishedDataType.Routing
|
|
108
|
+
}, this.storage);
|
|
109
|
+
this.routingStatus = status;
|
|
110
|
+
console.log('routing status: ', status);
|
|
111
|
+
if (onRoutingStatusUpdateCallback) {
|
|
112
|
+
onRoutingStatusUpdateCallback(status === _fetchPublishedJson.Status.Ready ? true : false);
|
|
171
113
|
}
|
|
114
|
+
}
|
|
115
|
+
getRoutingStatus() {
|
|
116
|
+
return this.routingStatus;
|
|
117
|
+
}
|
|
172
118
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
});
|
|
189
|
-
} else {
|
|
190
|
-
this.lastClicked = featureData;
|
|
191
|
-
}
|
|
119
|
+
// last clicked related functionality
|
|
120
|
+
setLastClickedFeature(featureData) {
|
|
121
|
+
if (featureData.mapObjectId) {
|
|
122
|
+
this.getMapObjectById(featureData.mapObjectId, res => {
|
|
123
|
+
const mo = res === null || res === void 0 ? void 0 : res[0];
|
|
124
|
+
if (mo) {
|
|
125
|
+
this.lastClicked = _objectSpread(_objectSpread({}, featureData), {}, {
|
|
126
|
+
properties: _objectSpread(_objectSpread({}, featureData.properties), {}, {
|
|
127
|
+
booth_info: mo.properties.booth_info
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
} else {
|
|
133
|
+
this.lastClicked = featureData;
|
|
192
134
|
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
clickedFeature = feature;
|
|
210
|
-
}
|
|
211
|
-
return clickedFeature;
|
|
135
|
+
}
|
|
136
|
+
getLastClickedFeature() {
|
|
137
|
+
let clickedFeature = this.lastClicked;
|
|
138
|
+
if (!this.lastClicked || this.lastClicked && (this.lastClicked.name === null || this.lastClicked.whereDimension === null)) {
|
|
139
|
+
const feature = {
|
|
140
|
+
mapObjectId: null,
|
|
141
|
+
coordinates: null,
|
|
142
|
+
name: null,
|
|
143
|
+
whatDimension: null,
|
|
144
|
+
whereDimension: null,
|
|
145
|
+
geometry: null,
|
|
146
|
+
properties: null,
|
|
147
|
+
clickEvent: null
|
|
148
|
+
};
|
|
149
|
+
this.setLastClickedFeature(feature);
|
|
150
|
+
clickedFeature = feature;
|
|
212
151
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
return false;
|
|
152
|
+
return clickedFeature;
|
|
153
|
+
}
|
|
154
|
+
isClickableFeature(feature) {
|
|
155
|
+
if (feature.properties.isSearchable && feature.properties.title !== 'Transit' && feature.properties.title !== 'Public') {
|
|
156
|
+
return true;
|
|
220
157
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
if (feature.lngLat) {
|
|
228
|
-
return feature.lngLat;
|
|
229
|
-
}
|
|
230
|
-
if (!feature.geometry) {
|
|
231
|
-
return null;
|
|
232
|
-
}
|
|
233
|
-
if (feature.geometry.type === 'Point') {
|
|
234
|
-
return feature.geometry.coordinates;
|
|
235
|
-
}
|
|
236
|
-
var gjson = (0, _helpers.feature)(feature.geometry);
|
|
237
|
-
if (gjson.geometry.type === 'LineString' || gjson.geometry.type === 'MultiLineString' && gjson.geometry.coordinates.length == 1) {
|
|
238
|
-
gjson = (0, _helpers.lineString)(feature.geometry.coordinates);
|
|
239
|
-
var gjsonLength = (0, _length["default"])(gjson);
|
|
240
|
-
var splicedLine = (0, _lineSliceAlong["default"])(gjson, gjsonLength / 2, gjsonLength);
|
|
241
|
-
return splicedLine.geometry.coordinates[0];
|
|
242
|
-
}
|
|
243
|
-
return (0, _center["default"])(gjson).geometry.coordinates;
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
getMidPointOfFeature(feature) {
|
|
161
|
+
if (!feature) {
|
|
162
|
+
return null;
|
|
244
163
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}, {
|
|
248
|
-
key: "getFocusTree",
|
|
249
|
-
value: function getFocusTree() {
|
|
250
|
-
return _focustree["default"];
|
|
164
|
+
if (feature.lngLat) {
|
|
165
|
+
return feature.lngLat;
|
|
251
166
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
value: function getWhatTaxonomies() {
|
|
255
|
-
return _whatTaxonomies["default"];
|
|
167
|
+
if (!feature.geometry) {
|
|
168
|
+
return null;
|
|
256
169
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
value: function getCurrentFocus() {
|
|
260
|
-
return this.currentFocus;
|
|
170
|
+
if (feature.geometry.type === 'Point') {
|
|
171
|
+
return feature.geometry.coordinates;
|
|
261
172
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return null;
|
|
173
|
+
let gjson = (0, _helpers.feature)(feature.geometry);
|
|
174
|
+
if (gjson.geometry.type === 'LineString' || gjson.geometry.type === 'MultiLineString' && gjson.geometry.coordinates.length == 1) {
|
|
175
|
+
gjson = (0, _helpers.lineString)(feature.geometry.coordinates);
|
|
176
|
+
let gjsonLength = (0, _length.default)(gjson);
|
|
177
|
+
let splicedLine = (0, _lineSliceAlong.default)(gjson, gjsonLength / 2, gjsonLength);
|
|
178
|
+
return splicedLine.geometry.coordinates[0];
|
|
271
179
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
180
|
+
return (0, _center.default)(gjson).geometry.coordinates;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// focus control related methods
|
|
184
|
+
getFocusTree() {
|
|
185
|
+
return _focustreeJson.default;
|
|
186
|
+
}
|
|
187
|
+
getWhatTaxonomies() {
|
|
188
|
+
return _whatTaxonomiesJson.default;
|
|
189
|
+
}
|
|
190
|
+
getCurrentFocus() {
|
|
191
|
+
return this.currentFocus;
|
|
192
|
+
}
|
|
193
|
+
getCurrentFocusBuilding() {
|
|
194
|
+
for (let bld in _focustreeJson.default.site.buildings) {
|
|
195
|
+
if (this.currentFocus.includes(_focustreeJson.default.site.buildings[bld].taxonomyPath)) {
|
|
196
|
+
return _focustreeJson.default.site.buildings[bld];
|
|
283
197
|
}
|
|
284
|
-
return null;
|
|
285
198
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
//check if center in building bounds
|
|
293
|
-
var b = _focustree["default"].site.buildings[bIndex];
|
|
294
|
-
if (!b.hasOwnProperty('bounds')) {
|
|
295
|
-
continue;
|
|
296
|
-
}
|
|
297
|
-
var bounds = (0, _helpers.polygon)(b.bounds);
|
|
298
|
-
if ((0, _booleanPointInPolygon["default"])(centerPoint, bounds)) {
|
|
299
|
-
return b;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
return null;
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
getCurrentFocusFloor() {
|
|
202
|
+
let currentBuilding = this.getCurrentFocusBuilding();
|
|
203
|
+
if (!currentBuilding) {
|
|
204
|
+
return;
|
|
303
205
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
//get user center
|
|
308
|
-
var centerPoint = (0, _helpers.point)(currentCenter);
|
|
309
|
-
//check building
|
|
310
|
-
if (building === null || building === undefined) {
|
|
311
|
-
return false;
|
|
312
|
-
}
|
|
313
|
-
//check if user is viewing building
|
|
314
|
-
if (!building.hasOwnProperty('bounds')) {
|
|
315
|
-
return false;
|
|
206
|
+
for (let f in currentBuilding.floors) {
|
|
207
|
+
if (this.currentFocus === currentBuilding.floors[f].taxonomyPath) {
|
|
208
|
+
return currentBuilding.floors[f];
|
|
316
209
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
getUserViewportBuilding(currentCenter) {
|
|
214
|
+
let centerPoint = (0, _helpers.point)(currentCenter);
|
|
215
|
+
//get building bounds
|
|
216
|
+
for (let bIndex in _focustreeJson.default.site.buildings) {
|
|
217
|
+
//check if center in building bounds
|
|
218
|
+
let b = _focustreeJson.default.site.buildings[bIndex];
|
|
219
|
+
if (!b.hasOwnProperty('bounds')) {
|
|
220
|
+
continue;
|
|
322
221
|
}
|
|
323
|
-
|
|
324
|
-
if (
|
|
325
|
-
return
|
|
222
|
+
let bounds = (0, _helpers.polygon)(b.bounds);
|
|
223
|
+
if ((0, _booleanPointInPolygon.default)(centerPoint, bounds)) {
|
|
224
|
+
return b;
|
|
326
225
|
}
|
|
327
|
-
var fBounds = (0, _helpers.polygon)(floor.bounds);
|
|
328
|
-
var isViewingFloor = (0, _booleanPointInPolygon["default"])(centerPoint, fBounds);
|
|
329
|
-
return isViewingBuilding || isViewingFloor;
|
|
330
226
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
checkUserViewport(currentCenter, building, floor) {
|
|
230
|
+
//get user center
|
|
231
|
+
let centerPoint = (0, _helpers.point)(currentCenter);
|
|
232
|
+
//check building
|
|
233
|
+
if (building === null || building === undefined) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
//check if user is viewing building
|
|
237
|
+
if (!building.hasOwnProperty('bounds')) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
let bBounds = (0, _helpers.polygon)(building.bounds);
|
|
241
|
+
let isViewingBuilding = (0, _booleanPointInPolygon.default)(centerPoint, bBounds);
|
|
242
|
+
//check floor
|
|
243
|
+
if (floor === null || floor === undefined) {
|
|
244
|
+
return isViewingBuilding;
|
|
245
|
+
}
|
|
246
|
+
//check if user is viewing floor
|
|
247
|
+
if (!floor.hasOwnProperty('bounds')) {
|
|
248
|
+
return isViewingBuilding;
|
|
249
|
+
}
|
|
250
|
+
let fBounds = (0, _helpers.polygon)(floor.bounds);
|
|
251
|
+
let isViewingFloor = (0, _booleanPointInPolygon.default)(centerPoint, fBounds);
|
|
252
|
+
return isViewingBuilding || isViewingFloor;
|
|
253
|
+
}
|
|
254
|
+
filterBaseMapWhereDimension(layersData, whereTaxonomyPath) {
|
|
255
|
+
let dimensionWhere = whereTaxonomyPath;
|
|
256
|
+
if (!dimensionWhere) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
this.currentFocus = dimensionWhere;
|
|
260
|
+
let whereFilters = [dimensionWhere];
|
|
340
261
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
if (building.floors && Array.isArray(building.floors)) {
|
|
352
|
-
var _iterator2 = _createForOfIteratorHelper(building.floors),
|
|
353
|
-
_step2;
|
|
354
|
-
try {
|
|
355
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
356
|
-
var floor = _step2.value;
|
|
357
|
-
if (floor.taxonomyPath) {
|
|
358
|
-
whereFilters.push(floor.taxonomyPath);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
} catch (err) {
|
|
362
|
-
_iterator2.e(err);
|
|
363
|
-
} finally {
|
|
364
|
-
_iterator2.f();
|
|
365
|
-
}
|
|
262
|
+
// Check if dimensionWhere matches the site taxonomyPath
|
|
263
|
+
if (dimensionWhere === _focustreeJson.default.site.taxonomyPath) {
|
|
264
|
+
// If it equals site, add all floors of all buildings
|
|
265
|
+
whereFilters = [];
|
|
266
|
+
if (_focustreeJson.default.site.buildings && Array.isArray(_focustreeJson.default.site.buildings)) {
|
|
267
|
+
for (const building of _focustreeJson.default.site.buildings) {
|
|
268
|
+
if (building.floors && Array.isArray(building.floors)) {
|
|
269
|
+
for (const floor of building.floors) {
|
|
270
|
+
if (floor.taxonomyPath) {
|
|
271
|
+
whereFilters.push(floor.taxonomyPath);
|
|
366
272
|
}
|
|
367
273
|
}
|
|
368
|
-
} catch (err) {
|
|
369
|
-
_iterator.e(err);
|
|
370
|
-
} finally {
|
|
371
|
-
_iterator.f();
|
|
372
274
|
}
|
|
373
|
-
} else {
|
|
374
|
-
// If it equals a site and has no buildings, add the site itself
|
|
375
|
-
whereFilters = [_focustree["default"].site.taxonomyPath];
|
|
376
275
|
}
|
|
377
276
|
} else {
|
|
378
|
-
//
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
392
|
-
var _floor = _step4.value;
|
|
393
|
-
if (_floor.taxonomyPath) {
|
|
394
|
-
whereFilters.push(_floor.taxonomyPath);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
} catch (err) {
|
|
398
|
-
_iterator4.e(err);
|
|
399
|
-
} finally {
|
|
400
|
-
_iterator4.f();
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
// If it equals a building, but has no floors, add the building itself
|
|
404
|
-
else {
|
|
405
|
-
whereFilters = [_building.taxonomyPath];
|
|
277
|
+
// If it equals a site and has no buildings, add the site itself
|
|
278
|
+
whereFilters = [_focustreeJson.default.site.taxonomyPath];
|
|
279
|
+
}
|
|
280
|
+
} else {
|
|
281
|
+
// Check if dimensionWhere matches any building's taxonomyPath
|
|
282
|
+
for (const building of _focustreeJson.default.site.buildings) {
|
|
283
|
+
if (dimensionWhere === building.taxonomyPath) {
|
|
284
|
+
// If it equals a building, add all floors of that building
|
|
285
|
+
whereFilters = [];
|
|
286
|
+
if (building.floors && Array.isArray(building.floors)) {
|
|
287
|
+
for (const floor of building.floors) {
|
|
288
|
+
if (floor.taxonomyPath) {
|
|
289
|
+
whereFilters.push(floor.taxonomyPath);
|
|
406
290
|
}
|
|
407
|
-
break;
|
|
408
291
|
}
|
|
409
292
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
_iterator3.f();
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
console.log('whereFilters: ', whereFilters);
|
|
417
|
-
if (layersData.length > 0) {
|
|
418
|
-
for (var index = 0; index < layersData.length; index += 1) {
|
|
419
|
-
var layerID = layersData[index].id;
|
|
420
|
-
if (!this.ignoredLayers.includes(layerID)) {
|
|
421
|
-
this.filterLayer(layersData[index], whereFilters);
|
|
293
|
+
// If it equals a building, but has no floors, add the building itself
|
|
294
|
+
else {
|
|
295
|
+
whereFilters = [building.taxonomyPath];
|
|
422
296
|
}
|
|
297
|
+
break;
|
|
423
298
|
}
|
|
424
299
|
}
|
|
425
|
-
return layersData;
|
|
426
300
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
var whereFilters = [];
|
|
435
|
-
whereFilters = [dimensionWhere];
|
|
436
|
-
for (var index = 0; index < layersData.length; index += 1) {
|
|
437
|
-
this.filterLayer(layersData[index], whereFilters);
|
|
301
|
+
console.log('whereFilters: ', whereFilters);
|
|
302
|
+
if (layersData.length > 0) {
|
|
303
|
+
for (let index = 0; index < layersData.length; index += 1) {
|
|
304
|
+
const layerID = layersData[index].id;
|
|
305
|
+
if (!this.ignoredLayers.includes(layerID)) {
|
|
306
|
+
this.filterLayer(layersData[index], whereFilters);
|
|
307
|
+
}
|
|
438
308
|
}
|
|
439
|
-
return layersData;
|
|
440
309
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
310
|
+
return layersData;
|
|
311
|
+
}
|
|
312
|
+
filterLayersWhereDimension(layersData, whereTaxonomyPath) {
|
|
313
|
+
let dimensionWhere = whereTaxonomyPath;
|
|
314
|
+
if (!dimensionWhere) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
let whereFilters = [];
|
|
318
|
+
whereFilters = [dimensionWhere];
|
|
319
|
+
for (let index = 0; index < layersData.length; index += 1) {
|
|
320
|
+
this.filterLayer(layersData[index], whereFilters);
|
|
321
|
+
}
|
|
322
|
+
return layersData;
|
|
323
|
+
}
|
|
324
|
+
filterLayer(layer, whereFilters) {
|
|
325
|
+
const layerFilter = layer.filter;
|
|
326
|
+
if (layerFilter) {
|
|
327
|
+
let filterFound = false;
|
|
328
|
+
for (let fieldIndex = 0; fieldIndex < layerFilter.length; fieldIndex += 1) {
|
|
329
|
+
const field = layerFilter[fieldIndex];
|
|
330
|
+
if (Array.isArray(field[1]) && field[1][1] === 'dimension_where') {
|
|
331
|
+
//update already added where filter value
|
|
332
|
+
field[0] = 'in';
|
|
333
|
+
field[2] = ['literal', whereFilters];
|
|
334
|
+
filterFound = true;
|
|
335
|
+
break;
|
|
459
336
|
}
|
|
460
337
|
}
|
|
338
|
+
if (!filterFound) {
|
|
339
|
+
layerFilter.push(['in', ['get', 'dimension_where'], ['literal', whereFilters]]);
|
|
340
|
+
}
|
|
461
341
|
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
var splitstr = whereTaxonomyPath.split('.');
|
|
342
|
+
}
|
|
343
|
+
getLocationNameFromWhereTaxonomyPath(whereTaxonomyPath) {
|
|
344
|
+
if (whereTaxonomyPath.includes('where.')) {
|
|
345
|
+
const splitstr = whereTaxonomyPath.split('.');
|
|
467
346
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
return splitstr[splitstr.length - 1];
|
|
471
|
-
}
|
|
347
|
+
//if floor
|
|
348
|
+
if (!this.nonFloorLayers.includes(whereTaxonomyPath)) {
|
|
472
349
|
return splitstr[splitstr.length - 1];
|
|
473
350
|
}
|
|
351
|
+
return splitstr[splitstr.length - 1];
|
|
474
352
|
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
if (
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
return getConfigForNode(building.cameraConfigs);
|
|
497
|
-
}
|
|
353
|
+
}
|
|
354
|
+
getFlyToLocation(whereTaxonomyPath) {
|
|
355
|
+
let isMobile = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
356
|
+
let location = this.getLocationNameFromWhereTaxonomyPath(whereTaxonomyPath);
|
|
357
|
+
const getConfigForNode = node => {
|
|
358
|
+
const cameraConfigs = isMobile ? node.mobile : node.web;
|
|
359
|
+
return cameraConfigs;
|
|
360
|
+
};
|
|
361
|
+
if (this.getLocationNameFromWhereTaxonomyPath(_focustreeJson.default.site.taxonomyPath) === location) {
|
|
362
|
+
return getConfigForNode(_focustreeJson.default.site.cameraConfigs);
|
|
363
|
+
} else {
|
|
364
|
+
for (let index = 0; index < _focustreeJson.default.site.buildings.length; index++) {
|
|
365
|
+
const building = _focustreeJson.default.site.buildings[index];
|
|
366
|
+
if (this.getLocationNameFromWhereTaxonomyPath(building.taxonomyPath) !== location) {
|
|
367
|
+
for (let index = 0; index < building.floors.length; index++) {
|
|
368
|
+
const floor = building.floors[index];
|
|
369
|
+
if (this.getLocationNameFromWhereTaxonomyPath(floor.taxonomyPath) === location) {
|
|
370
|
+
if (floor.cameraConfigs) {
|
|
371
|
+
return getConfigForNode(floor.cameraConfigs);
|
|
372
|
+
} else {
|
|
373
|
+
return getConfigForNode(building.cameraConfigs);
|
|
498
374
|
}
|
|
499
375
|
}
|
|
500
|
-
} else {
|
|
501
|
-
return getConfigForNode(building.cameraConfigs);
|
|
502
376
|
}
|
|
377
|
+
} else {
|
|
378
|
+
return getConfigForNode(building.cameraConfigs);
|
|
503
379
|
}
|
|
504
380
|
}
|
|
505
|
-
console.warn('Invalid whereTaxonomy passed to getFlyToLocation');
|
|
506
|
-
return {
|
|
507
|
-
center: undefined,
|
|
508
|
-
zoom: undefined,
|
|
509
|
-
bearing: undefined
|
|
510
|
-
};
|
|
511
381
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
382
|
+
console.warn('Invalid whereTaxonomy passed to getFlyToLocation');
|
|
383
|
+
return {
|
|
384
|
+
center: undefined,
|
|
385
|
+
zoom: undefined,
|
|
386
|
+
bearing: undefined
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
filterLayersByCategories(layersData, filterType, filterValues, geomType, dimensionWhat, map) {
|
|
390
|
+
if (!filterValues) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
for (let index = 0; index < layersData.length; index += 1) {
|
|
394
|
+
const layerID = layersData[index].id;
|
|
395
|
+
const layer = layersData[index];
|
|
396
|
+
let filter;
|
|
397
|
+
const layerFilter = layer.filter;
|
|
398
|
+
if (geomType) {
|
|
399
|
+
filter = ['any', ['!', ['all', ['==', ['geometry-type'], geomType], ['==', ['get', 'dimension_what'], dimensionWhat]]]];
|
|
400
|
+
for (let index = 0; index < filterValues.length; index++) {
|
|
401
|
+
const filterValue = filterValues[index];
|
|
402
|
+
filter[1][1].splice(1, 0, ['!', ['in', filterValue, ['get', filterType]]]);
|
|
403
|
+
}
|
|
404
|
+
} else {
|
|
405
|
+
filter = ['all'];
|
|
406
|
+
for (let index = 0; index < filterValues.length; index++) {
|
|
407
|
+
const filterValue = filterValues[index];
|
|
408
|
+
filter.push(['all', ['in', filterValue, ['get', filterType]]]);
|
|
535
409
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
for (var _index4 = 0; _index4 < filterValues.length; _index4++) {
|
|
555
|
-
var _filterValue2 = filterValues[_index4];
|
|
556
|
-
field[1][1].splice(1, 0, ['!', ['in', _filterValue2, ['get', filterType]]]);
|
|
557
|
-
}
|
|
558
|
-
filterFound = true;
|
|
559
|
-
break;
|
|
410
|
+
}
|
|
411
|
+
if (layerFilter) {
|
|
412
|
+
let filterFound = false;
|
|
413
|
+
for (let fieldIndex = 0; fieldIndex < layerFilter.length; fieldIndex += 1) {
|
|
414
|
+
let field = layerFilter[fieldIndex];
|
|
415
|
+
if (geomType) {
|
|
416
|
+
if (field[0] === 'any' && Array.isArray(field[1]) && Array.isArray(field[1][1]) &&
|
|
417
|
+
// Array.isArray(field[3][1]) &&
|
|
418
|
+
// Array.isArray(field[3][1]) &&
|
|
419
|
+
// Array.isArray(field[3][1][1]) &&
|
|
420
|
+
// Array.isArray(field[3][1][2]) &&
|
|
421
|
+
// Array.isArray(field[3][2]) &&
|
|
422
|
+
field[1][0] === '!' && field[1][1][0] === 'all') {
|
|
423
|
+
//update already added where filter value
|
|
424
|
+
const subField = field[1][1];
|
|
425
|
+
if (subField.length > 3) {
|
|
426
|
+
// purge all previous entries
|
|
427
|
+
subField.splice(1, subField.length - 3);
|
|
560
428
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
field[0] = '!';
|
|
565
|
-
field[1][2] = ['literal', filterValues];
|
|
566
|
-
filterFound = true;
|
|
567
|
-
break;
|
|
429
|
+
for (let index = 0; index < filterValues.length; index++) {
|
|
430
|
+
const filterValue = filterValues[index];
|
|
431
|
+
field[1][1].splice(1, 0, ['!', ['in', filterValue, ['get', filterType]]]);
|
|
568
432
|
}
|
|
433
|
+
filterFound = true;
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
} else {
|
|
437
|
+
if (Array.isArray(field[1]) && Array.isArray(field[1][1]) && field[0] === '!' && field[1][1][1] === filterType) {
|
|
438
|
+
//update already added where filter value
|
|
439
|
+
field[0] = '!';
|
|
440
|
+
field[1][2] = ['literal', filterValues];
|
|
441
|
+
filterFound = true;
|
|
442
|
+
break;
|
|
569
443
|
}
|
|
570
|
-
}
|
|
571
|
-
if (!filterFound) {
|
|
572
|
-
layerFilter.push(filter);
|
|
573
444
|
}
|
|
574
445
|
}
|
|
575
|
-
if (
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
446
|
+
if (!filterFound) {
|
|
447
|
+
layerFilter.push(filter);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
if (layerID.includes('Retail')) {
|
|
451
|
+
const layerStyle = layer.paint;
|
|
452
|
+
const styleFilter = ['case'];
|
|
453
|
+
for (let index = 0; index < filterValues.length; index++) {
|
|
454
|
+
const filterValue = filterValues[index];
|
|
455
|
+
styleFilter.push(["boolean", ['in', filterValue, ['get', filterType]], true]); // the category is enabled?
|
|
456
|
+
styleFilter.push(0.99); // when enabled
|
|
457
|
+
}
|
|
458
|
+
styleFilter.push(0.25); // when disabled
|
|
584
459
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
}
|
|
460
|
+
if (layer.type === 'fill') {
|
|
461
|
+
const property = 'fill-opacity';
|
|
462
|
+
layerStyle['fill-opacity'] = styleFilter;
|
|
463
|
+
map.setPaintProperty(layerID, property, layerStyle[property]);
|
|
464
|
+
}
|
|
465
|
+
if (layer.type === 'line') {
|
|
466
|
+
const property = 'line-opacity';
|
|
467
|
+
layerStyle['line-opacity'] = styleFilter;
|
|
468
|
+
map.setPaintProperty(layerID, property, layerStyle[property]);
|
|
595
469
|
}
|
|
596
470
|
}
|
|
597
|
-
return layersData;
|
|
598
471
|
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
472
|
+
return layersData;
|
|
473
|
+
}
|
|
474
|
+
filterLayersByType(layersData, filterType, filterValues, geomType) {
|
|
475
|
+
if (!filterValues) {
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
for (let index = 0; index < layersData.length; index += 1) {
|
|
479
|
+
const layer = layersData[index];
|
|
480
|
+
let filter;
|
|
481
|
+
const layerFilter = layer.filter;
|
|
482
|
+
if (geomType) {
|
|
483
|
+
filter = ['case', ['!', ['in', ['get', filterType], ['literal', filterValues]]], true, ['all', ['in', ['get', filterType], ['literal', filterValues]], ['!=', ['geometry-type'], geomType]], true, false];
|
|
484
|
+
} else {
|
|
485
|
+
filter = ['in', ['get', filterType], ['literal', filterValues]];
|
|
604
486
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
filterFound = true;
|
|
628
|
-
break;
|
|
629
|
-
}
|
|
630
|
-
} else {
|
|
631
|
-
if (Array.isArray(field[1]) && field[0] === '!' && field[1][1] === filterType) {
|
|
632
|
-
//update already added where filter value
|
|
633
|
-
field[2] = ['literal', filterValues];
|
|
634
|
-
filterFound = true;
|
|
635
|
-
break;
|
|
636
|
-
}
|
|
487
|
+
if (layerFilter) {
|
|
488
|
+
let filterFound = false;
|
|
489
|
+
console.log('layerFilter: ', layerFilter);
|
|
490
|
+
for (let fieldIndex = 0; fieldIndex < layerFilter.length; fieldIndex += 1) {
|
|
491
|
+
let field = layerFilter[fieldIndex];
|
|
492
|
+
if (geomType) {
|
|
493
|
+
if (field[0] === 'case' && Array.isArray(field[1]) && Array.isArray(field[3]) && Array.isArray(field[3][1]) && Array.isArray(field[3][1]) && Array.isArray(field[3][1][1]) && Array.isArray(field[3][1][2]) && Array.isArray(field[3][2]) && field[3][1][1][1] === filterType && field[3][2][2] === geomType) {
|
|
494
|
+
//update already added where filter value
|
|
495
|
+
field[1][1][2] = ['literal', filterValues];
|
|
496
|
+
field[1][1][1] = ['get', filterType];
|
|
497
|
+
field[3][1][2] = ['literal', filterValues];
|
|
498
|
+
field[3][1][1] = ['get', filterType];
|
|
499
|
+
field[3][2][2] = geomType;
|
|
500
|
+
filterFound = true;
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
} else {
|
|
504
|
+
if (Array.isArray(field[1]) && field[0] === '!' && field[1][1] === filterType) {
|
|
505
|
+
//update already added where filter value
|
|
506
|
+
field[2] = ['literal', filterValues];
|
|
507
|
+
filterFound = true;
|
|
508
|
+
break;
|
|
637
509
|
}
|
|
638
510
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
511
|
+
}
|
|
512
|
+
if (!filterFound) {
|
|
513
|
+
console.log('pushing: ', filterValues, filterType);
|
|
514
|
+
layerFilter.push(filter);
|
|
643
515
|
}
|
|
644
516
|
}
|
|
645
|
-
return layersData;
|
|
646
517
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
} else {
|
|
656
|
-
defClone[defClone.length - 1] = setRowForField(defClone[defClone.length - 1]);
|
|
657
|
-
}
|
|
658
|
-
return defClone;
|
|
518
|
+
return layersData;
|
|
519
|
+
}
|
|
520
|
+
createFilterForStyle(defValue, filterType, filterValues, value) {
|
|
521
|
+
function setRowForField(defCopy) {
|
|
522
|
+
if (Array.isArray(defCopy) && defCopy[0] === 'match') {
|
|
523
|
+
let defClone = [...defCopy];
|
|
524
|
+
if (Array.isArray(defClone[1]) && defClone[1][1] === filterType) {
|
|
525
|
+
setRowForValue(defClone, defCopy);
|
|
659
526
|
} else {
|
|
660
|
-
|
|
527
|
+
defClone[defClone.length - 1] = setRowForField(defClone[defClone.length - 1]);
|
|
661
528
|
}
|
|
529
|
+
return defClone;
|
|
530
|
+
} else {
|
|
531
|
+
return ['match', ['get', filterType], filterValues, value, defCopy];
|
|
662
532
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
533
|
+
}
|
|
534
|
+
function setRowForValue(defClone, defCopy) {
|
|
535
|
+
for (let i = 3; i < defCopy.length; i += 2) {
|
|
536
|
+
if (defClone[i] === value) {
|
|
537
|
+
const newFilterValues = pushArray(defClone[i - 1], filterValues);
|
|
538
|
+
defClone[i - 1] = newFilterValues;
|
|
539
|
+
return;
|
|
540
|
+
} else if (i + 2 === defCopy.length) {
|
|
541
|
+
defClone.splice(i + 1, 0, filterValues, value);
|
|
672
542
|
}
|
|
673
543
|
}
|
|
674
|
-
function pushArray(originalArray, newArray) {
|
|
675
|
-
var filteredArray = newArray.filter(function (item) {
|
|
676
|
-
return !originalArray.includes(item);
|
|
677
|
-
});
|
|
678
|
-
originalArray.push.apply(originalArray, _toConsumableArray(filteredArray));
|
|
679
|
-
return originalArray;
|
|
680
|
-
}
|
|
681
|
-
return setRowForField(defValue);
|
|
682
544
|
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
545
|
+
function pushArray(originalArray, newArray) {
|
|
546
|
+
const filteredArray = newArray.filter(item => !originalArray.includes(item));
|
|
547
|
+
originalArray.push(...filteredArray);
|
|
548
|
+
return originalArray;
|
|
549
|
+
}
|
|
550
|
+
return setRowForField(defValue);
|
|
551
|
+
}
|
|
552
|
+
styleLayersByType(layersData, filterType, filterValues, property, value) {
|
|
553
|
+
if (!filterValues) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
for (let index = 0; index < layersData.length; index += 1) {
|
|
557
|
+
// if (layersData[index].isFireAlarmLayer) {
|
|
558
|
+
const layer = layersData[index];
|
|
559
|
+
const layerStyle = layer.paint;
|
|
560
|
+
const layerType = layer.type;
|
|
694
561
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
}
|
|
562
|
+
// TODO: add support for other layers later
|
|
563
|
+
if (layerType && layerType === 'fill' || layerType === 'line') {
|
|
564
|
+
if (layerStyle[property]) {
|
|
565
|
+
let defValue = layerStyle[property];
|
|
566
|
+
if (defValue) {
|
|
567
|
+
const filter = this.createFilterForStyle(defValue, filterType, filterValues, value);
|
|
568
|
+
layerStyle[property] = filter;
|
|
703
569
|
}
|
|
704
570
|
}
|
|
705
|
-
// }
|
|
706
571
|
}
|
|
707
|
-
|
|
572
|
+
// }
|
|
708
573
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
} else {
|
|
719
|
-
defClone = defClone[defClone.length - 1];
|
|
720
|
-
}
|
|
574
|
+
return layersData;
|
|
575
|
+
}
|
|
576
|
+
createFilterForClearStyle(defValue, filterType, filterValues) {
|
|
577
|
+
function setRowForField(defCopy) {
|
|
578
|
+
if (Array.isArray(defCopy) && defCopy[0] === 'match') {
|
|
579
|
+
let defClone = [...defCopy];
|
|
580
|
+
if (Array.isArray(defClone[1]) && defClone[1][1] === filterType) {
|
|
581
|
+
if (filterValues.length > 0) {
|
|
582
|
+
setRowForValue(defClone, defCopy);
|
|
721
583
|
} else {
|
|
722
|
-
defClone
|
|
584
|
+
defClone = defClone[defClone.length - 1];
|
|
723
585
|
}
|
|
724
|
-
|
|
586
|
+
} else {
|
|
587
|
+
defClone[defClone.length - 1] = setRowForField(defClone[defClone.length - 1]);
|
|
725
588
|
}
|
|
589
|
+
return defClone;
|
|
726
590
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
591
|
+
}
|
|
592
|
+
function setRowForValue(defClone, defCopy) {
|
|
593
|
+
for (let i = 2; i < defCopy.length; i += 2) {
|
|
594
|
+
if (Array.isArray(defClone[i])) {
|
|
595
|
+
filterValues.forEach(filterValue => {
|
|
596
|
+
const index = defClone[i].indexOf(filterValue);
|
|
597
|
+
if (index > -1) {
|
|
598
|
+
if (defClone[i].length > 1) {
|
|
599
|
+
defClone[i].splice(index, 1);
|
|
600
|
+
} else {
|
|
601
|
+
defClone[i] = [''];
|
|
738
602
|
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
for (var i = 2; i < defCopy.length; i += 2) {
|
|
743
|
-
_loop(i);
|
|
603
|
+
}
|
|
604
|
+
});
|
|
744
605
|
}
|
|
745
606
|
}
|
|
746
|
-
return setRowForField(defValue);
|
|
747
607
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
608
|
+
return setRowForField(defValue);
|
|
609
|
+
}
|
|
610
|
+
clearStyleLayersByType(layersData, filterType, filterValues, property) {
|
|
611
|
+
for (let index = 0; index < layersData.length; index += 1) {
|
|
612
|
+
// if (layersData[index].isFireAlarmLayer) {
|
|
613
|
+
const layer = layersData[index];
|
|
614
|
+
const layerStyle = layer.paint;
|
|
615
|
+
const layerType = layer.type;
|
|
756
616
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
}
|
|
617
|
+
// TODO: add support for other layers later
|
|
618
|
+
if (layerType && layerType === 'fill' || layerType === 'line') {
|
|
619
|
+
if (layerStyle[property]) {
|
|
620
|
+
let defValue = layerStyle[property];
|
|
621
|
+
if (defValue) {
|
|
622
|
+
const filter = this.createFilterForClearStyle(defValue, filterType, filterValues);
|
|
623
|
+
layerStyle[property] = filter;
|
|
765
624
|
}
|
|
766
625
|
}
|
|
767
|
-
// }
|
|
768
626
|
}
|
|
769
|
-
|
|
770
|
-
}
|
|
771
|
-
}, {
|
|
772
|
-
key: "normalize",
|
|
773
|
-
value: function normalize(string) {
|
|
774
|
-
return string.trim().toLowerCase();
|
|
627
|
+
// }
|
|
775
628
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
629
|
+
return layersData;
|
|
630
|
+
}
|
|
631
|
+
normalize(string) {
|
|
632
|
+
return string.trim().toLowerCase();
|
|
633
|
+
}
|
|
634
|
+
relevanceSort(metaFeatures, query) {
|
|
635
|
+
let isStrict = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
636
|
+
function score(metaFeature) {
|
|
637
|
+
const noMatch = [-1, 0, metaFeature.name];
|
|
638
|
+
if (metaFeature.name) {
|
|
639
|
+
const lowerStr = metaFeature.name.toLowerCase();
|
|
640
|
+
const lowerQuery = query.toLowerCase();
|
|
785
641
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
if (lowerStr.includes(lowerQuery)) {
|
|
803
|
-
return [0, -metaFeature.name.length, lowerStr];
|
|
804
|
-
} else {
|
|
805
|
-
return noMatch;
|
|
806
|
-
}
|
|
642
|
+
// 1. If the string is the same as the query
|
|
643
|
+
if (lowerStr === lowerQuery) {
|
|
644
|
+
return [1000, -metaFeature.name.length, lowerStr];
|
|
645
|
+
}
|
|
646
|
+
// 2. If the string starts with the query
|
|
647
|
+
else if (lowerStr.startsWith(lowerQuery)) {
|
|
648
|
+
return [500, -metaFeature.name.length, lowerStr];
|
|
649
|
+
}
|
|
650
|
+
// 3. If one of the words in the string starts with the query
|
|
651
|
+
else if (lowerStr.split(' ').some(word => word.startsWith(lowerQuery))) {
|
|
652
|
+
return [200, -metaFeature.name.length, lowerStr];
|
|
653
|
+
}
|
|
654
|
+
// 4. The string contains the query
|
|
655
|
+
else if (!isStrict) {
|
|
656
|
+
if (lowerStr.includes(lowerQuery)) {
|
|
657
|
+
return [0, -metaFeature.name.length, lowerStr];
|
|
807
658
|
} else {
|
|
808
659
|
return noMatch;
|
|
809
660
|
}
|
|
810
661
|
} else {
|
|
811
662
|
return noMatch;
|
|
812
663
|
}
|
|
664
|
+
} else {
|
|
665
|
+
return noMatch;
|
|
813
666
|
}
|
|
814
|
-
return metaFeatures.sort(function (a, b) {
|
|
815
|
-
var scoreA = score(a);
|
|
816
|
-
var scoreB = score(b);
|
|
817
|
-
return scoreB[0] - scoreA[0] || scoreB[1] - scoreA[1] || scoreA[2].localeCompare(scoreB[2]);
|
|
818
|
-
}).filter(function (s) {
|
|
819
|
-
return score(s)[0] >= 0;
|
|
820
|
-
});
|
|
821
667
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
668
|
+
return metaFeatures.sort((a, b) => {
|
|
669
|
+
const scoreA = score(a);
|
|
670
|
+
const scoreB = score(b);
|
|
671
|
+
return scoreB[0] - scoreA[0] || scoreB[1] - scoreA[1] || scoreA[2].localeCompare(scoreB[2]);
|
|
672
|
+
}).filter(s => score(s)[0] >= 0);
|
|
673
|
+
}
|
|
674
|
+
sort(metaFeatures, sortType) {
|
|
675
|
+
let query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
676
|
+
const compare = (a, b) => {
|
|
677
|
+
if (!a || !b) {
|
|
678
|
+
return 0;
|
|
679
|
+
}
|
|
680
|
+
return a.localeCompare(b);
|
|
681
|
+
};
|
|
682
|
+
if (sortType === SortType.Name) {
|
|
683
|
+
return metaFeatures.sort((a, b) => {
|
|
684
|
+
return compare(a.name, b.name);
|
|
685
|
+
});
|
|
686
|
+
} else if (sortType === SortType.WhereDimension) {
|
|
687
|
+
return metaFeatures.sort((a, b) => {
|
|
688
|
+
const whereComparison = compare(a.whereDimension, b.whereDimension);
|
|
689
|
+
if (whereComparison === 0) {
|
|
834
690
|
return compare(a.name, b.name);
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
691
|
+
} else {
|
|
692
|
+
return whereComparison;
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
} else if (sortType === SortType.Relevance) {
|
|
696
|
+
return this.relevanceSort(metaFeatures, query);
|
|
697
|
+
} else if (sortType === SortType.RelevanceStrict) {
|
|
698
|
+
return this.relevanceSort(metaFeatures, query, true);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
async setupMapObjectSearch(onSearchStatusUpdateCallback) {
|
|
702
|
+
const status = await (0, _fetchPublishedJson.getPublishedData)({
|
|
703
|
+
URL: this.empApi,
|
|
704
|
+
accessToken: this.atomsAPIAccessToken,
|
|
705
|
+
secretKey: this.secretKeyForDecryption,
|
|
706
|
+
publishedDataType: _fetchPublishedJson.PublishedDataType.MapObjects
|
|
707
|
+
}, this.storage);
|
|
708
|
+
this.searchStatus = status;
|
|
709
|
+
console.log('search status: ', status);
|
|
710
|
+
const mapObjects = _mapobjectsStore.default.getState().data;
|
|
711
|
+
for (let index = 0; index < mapObjects.length; index++) {
|
|
712
|
+
const mapObject = mapObjects[index];
|
|
713
|
+
if (mapObject) {
|
|
714
|
+
// Decide geometry type based on coordinates format:
|
|
715
|
+
// - Point: [lng, lat]
|
|
716
|
+
// - LineString: [[lng, lat], [lng, lat], ...]
|
|
717
|
+
const coords = mapObject.lngLat;
|
|
718
|
+
const geometry = Array.isArray(coords) && Array.isArray(coords[0]) ? {
|
|
719
|
+
type: 'LineString',
|
|
720
|
+
coordinates: coords
|
|
721
|
+
} : {
|
|
722
|
+
type: 'Point',
|
|
723
|
+
coordinates: coords
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
// Re-create geojson
|
|
727
|
+
const moJSON = {
|
|
728
|
+
mapObjectId: mapObject.mID,
|
|
729
|
+
coordinates: mapObject.lngLat,
|
|
730
|
+
name: mapObject.name,
|
|
731
|
+
whatDimension: mapObject.what,
|
|
732
|
+
whereDimension: mapObject.where,
|
|
733
|
+
geometry,
|
|
734
|
+
properties: {
|
|
735
|
+
myMapObjectId: mapObject.mID,
|
|
736
|
+
title: mapObject.name,
|
|
737
|
+
localRef: mapObject.localRef,
|
|
738
|
+
dimension_what: mapObject.what,
|
|
739
|
+
dimension_where: mapObject.where,
|
|
740
|
+
booth_info: {
|
|
741
|
+
overview: mapObject.overview,
|
|
742
|
+
images: mapObject.images,
|
|
743
|
+
videos: mapObject.videos,
|
|
744
|
+
files: mapObject.files,
|
|
745
|
+
products: mapObject.products,
|
|
746
|
+
logos: mapObject.logos
|
|
747
|
+
},
|
|
748
|
+
metadata: mapObject.metadata ? JSON.parse(mapObject.metadata) : null
|
|
843
749
|
}
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
return this.relevanceSort(metaFeatures, query);
|
|
847
|
-
} else if (sortType === SortType.RelevanceStrict) {
|
|
848
|
-
return this.relevanceSort(metaFeatures, query, true);
|
|
750
|
+
};
|
|
751
|
+
this.searchableGeoJsonFeatures.push(moJSON);
|
|
849
752
|
}
|
|
850
753
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
status = _context3.v;
|
|
868
|
-
this.searchStatus = status;
|
|
869
|
-
console.log('search status: ', status);
|
|
870
|
-
mapObjects = _mapobjectsStore["default"].getState().data;
|
|
871
|
-
for (index = 0; index < mapObjects.length; index++) {
|
|
872
|
-
mapObject = mapObjects[index];
|
|
873
|
-
if (mapObject) {
|
|
874
|
-
// Decide geometry type based on coordinates format:
|
|
875
|
-
// - Point: [lng, lat]
|
|
876
|
-
// - LineString: [[lng, lat], [lng, lat], ...]
|
|
877
|
-
coords = mapObject.lngLat;
|
|
878
|
-
geometry = Array.isArray(coords) && Array.isArray(coords[0]) ? {
|
|
879
|
-
type: 'LineString',
|
|
880
|
-
coordinates: coords
|
|
881
|
-
} : {
|
|
882
|
-
type: 'Point',
|
|
883
|
-
coordinates: coords
|
|
884
|
-
}; // Re-create geojson
|
|
885
|
-
moJSON = {
|
|
886
|
-
mapObjectId: mapObject.mID,
|
|
887
|
-
coordinates: mapObject.lngLat,
|
|
888
|
-
name: mapObject.name,
|
|
889
|
-
whatDimension: mapObject.what,
|
|
890
|
-
whereDimension: mapObject.where,
|
|
891
|
-
geometry: geometry,
|
|
892
|
-
properties: {
|
|
893
|
-
myMapObjectId: mapObject.mID,
|
|
894
|
-
title: mapObject.name,
|
|
895
|
-
localRef: mapObject.localRef,
|
|
896
|
-
dimension_what: mapObject.what,
|
|
897
|
-
dimension_where: mapObject.where,
|
|
898
|
-
booth_info: {
|
|
899
|
-
overview: mapObject.overview,
|
|
900
|
-
images: mapObject.images,
|
|
901
|
-
videos: mapObject.videos,
|
|
902
|
-
files: mapObject.files,
|
|
903
|
-
products: mapObject.products,
|
|
904
|
-
logos: mapObject.logos
|
|
905
|
-
},
|
|
906
|
-
metadata: mapObject.metadata ? JSON.parse(mapObject.metadata) : null
|
|
907
|
-
}
|
|
908
|
-
};
|
|
909
|
-
this.searchableGeoJsonFeatures.push(moJSON);
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
if (onSearchStatusUpdateCallback) {
|
|
913
|
-
onSearchStatusUpdateCallback(status === _fetchPublishedJson.Status.Ready ? true : false);
|
|
914
|
-
}
|
|
915
|
-
case 2:
|
|
916
|
-
return _context3.a(2);
|
|
917
|
-
}
|
|
918
|
-
}, _callee3, this);
|
|
919
|
-
}));
|
|
920
|
-
function setupMapObjectSearch(_x3) {
|
|
921
|
-
return _setupMapObjectSearch.apply(this, arguments);
|
|
754
|
+
if (onSearchStatusUpdateCallback) {
|
|
755
|
+
onSearchStatusUpdateCallback(status === _fetchPublishedJson.Status.Ready ? true : false);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
getMapObjectsByFilteredLocalRef(boothId) {
|
|
759
|
+
let searchSubString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
760
|
+
let sortType = arguments.length > 2 ? arguments[2] : undefined;
|
|
761
|
+
let onResponseCallback = arguments.length > 3 ? arguments[3] : undefined;
|
|
762
|
+
const uniqueIds = new Set();
|
|
763
|
+
const metaFeatures = [];
|
|
764
|
+
const boothIdToSearch = this.normalize(String(boothId));
|
|
765
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
766
|
+
const id = feature.properties.myMapObjectId;
|
|
767
|
+
const localRef = this.normalize(String(feature.properties.localRef));
|
|
768
|
+
if (searchSubString && !localRef.includes(boothIdToSearch)) {
|
|
769
|
+
continue;
|
|
922
770
|
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}, {
|
|
926
|
-
key: "getMapObjectsByFilteredLocalRef",
|
|
927
|
-
value: function getMapObjectsByFilteredLocalRef(boothId) {
|
|
928
|
-
var searchSubString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
929
|
-
var sortType = arguments.length > 2 ? arguments[2] : undefined;
|
|
930
|
-
var onResponseCallback = arguments.length > 3 ? arguments[3] : undefined;
|
|
931
|
-
var uniqueIds = new Set();
|
|
932
|
-
var metaFeatures = [];
|
|
933
|
-
var boothIdToSearch = this.normalize(String(boothId));
|
|
934
|
-
var _iterator5 = _createForOfIteratorHelper(this.searchableGeoJsonFeatures),
|
|
935
|
-
_step5;
|
|
936
|
-
try {
|
|
937
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
938
|
-
var feature = _step5.value;
|
|
939
|
-
var id = feature.properties.myMapObjectId;
|
|
940
|
-
var localRef = this.normalize(String(feature.properties.localRef));
|
|
941
|
-
if (searchSubString && !localRef.includes(boothIdToSearch)) {
|
|
942
|
-
continue;
|
|
943
|
-
}
|
|
944
|
-
if (!searchSubString && localRef !== boothIdToSearch) {
|
|
945
|
-
continue;
|
|
946
|
-
}
|
|
947
|
-
if (uniqueIds.has(id)) {
|
|
948
|
-
continue;
|
|
949
|
-
}
|
|
950
|
-
uniqueIds.add(id);
|
|
951
|
-
var objFeature = {
|
|
952
|
-
mapObjectId: String(feature.properties.myMapObjectId),
|
|
953
|
-
coordinates: null,
|
|
954
|
-
name: feature.properties.title,
|
|
955
|
-
whatDimension: feature.properties.dimension_what,
|
|
956
|
-
whereDimension: feature.properties.dimension_where,
|
|
957
|
-
geometry: feature.geometry,
|
|
958
|
-
properties: feature.properties
|
|
959
|
-
};
|
|
960
|
-
metaFeatures.push(objFeature);
|
|
961
|
-
}
|
|
962
|
-
} catch (err) {
|
|
963
|
-
_iterator5.e(err);
|
|
964
|
-
} finally {
|
|
965
|
-
_iterator5.f();
|
|
771
|
+
if (!searchSubString && localRef !== boothIdToSearch) {
|
|
772
|
+
continue;
|
|
966
773
|
}
|
|
967
|
-
|
|
968
|
-
|
|
774
|
+
if (uniqueIds.has(id)) {
|
|
775
|
+
continue;
|
|
776
|
+
}
|
|
777
|
+
uniqueIds.add(id);
|
|
778
|
+
const objFeature = {
|
|
779
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
780
|
+
coordinates: null,
|
|
781
|
+
name: feature.properties.title,
|
|
782
|
+
whatDimension: feature.properties.dimension_what,
|
|
783
|
+
whereDimension: feature.properties.dimension_where,
|
|
784
|
+
geometry: feature.geometry,
|
|
785
|
+
properties: feature.properties
|
|
786
|
+
};
|
|
787
|
+
metaFeatures.push(objFeature);
|
|
969
788
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
}
|
|
989
|
-
if (!searchSubString && title !== nameToSearch) {
|
|
990
|
-
continue;
|
|
991
|
-
}
|
|
992
|
-
if (uniqueIds.has(id)) {
|
|
993
|
-
continue;
|
|
994
|
-
}
|
|
995
|
-
uniqueIds.add(id);
|
|
996
|
-
var objFeature = {
|
|
997
|
-
mapObjectId: String(feature.properties.myMapObjectId),
|
|
998
|
-
coordinates: null,
|
|
999
|
-
name: feature.properties.title,
|
|
1000
|
-
whatDimension: feature.properties.dimension_what,
|
|
1001
|
-
whereDimension: feature.properties.dimension_where,
|
|
1002
|
-
geometry: feature.geometry,
|
|
1003
|
-
properties: feature.properties
|
|
1004
|
-
};
|
|
1005
|
-
metaFeatures.push(objFeature);
|
|
1006
|
-
}
|
|
1007
|
-
} catch (err) {
|
|
1008
|
-
_iterator6.e(err);
|
|
1009
|
-
} finally {
|
|
1010
|
-
_iterator6.f();
|
|
789
|
+
const sortedFeatures = this.sort(metaFeatures, sortType, boothId);
|
|
790
|
+
onResponseCallback(sortedFeatures);
|
|
791
|
+
}
|
|
792
|
+
getMapObjectsByName(name) {
|
|
793
|
+
let searchSubString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
794
|
+
let sortType = arguments.length > 2 ? arguments[2] : undefined;
|
|
795
|
+
let onResponseCallback = arguments.length > 3 ? arguments[3] : undefined;
|
|
796
|
+
const uniqueIds = new Set();
|
|
797
|
+
const metaFeatures = [];
|
|
798
|
+
const nameToSearch = this.normalize(String(name));
|
|
799
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
800
|
+
const id = feature.properties.myMapObjectId;
|
|
801
|
+
const title = this.normalize(String(feature.properties.title));
|
|
802
|
+
if (searchSubString && !title.includes(nameToSearch)) {
|
|
803
|
+
continue;
|
|
804
|
+
}
|
|
805
|
+
if (!searchSubString && title !== nameToSearch) {
|
|
806
|
+
continue;
|
|
1011
807
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
808
|
+
if (uniqueIds.has(id)) {
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
uniqueIds.add(id);
|
|
812
|
+
const objFeature = {
|
|
813
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
814
|
+
coordinates: null,
|
|
815
|
+
name: feature.properties.title,
|
|
816
|
+
whatDimension: feature.properties.dimension_what,
|
|
817
|
+
whereDimension: feature.properties.dimension_where,
|
|
818
|
+
geometry: feature.geometry,
|
|
819
|
+
properties: feature.properties
|
|
820
|
+
};
|
|
821
|
+
metaFeatures.push(objFeature);
|
|
1014
822
|
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
properties: feature.properties
|
|
1034
|
-
};
|
|
1035
|
-
metaFeatures.push(objFeature);
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
} catch (err) {
|
|
1039
|
-
_iterator7.e(err);
|
|
1040
|
-
} finally {
|
|
1041
|
-
_iterator7.f();
|
|
823
|
+
const sortedFeatures = this.sort(metaFeatures, sortType, name);
|
|
824
|
+
onResponseCallback(sortedFeatures);
|
|
825
|
+
}
|
|
826
|
+
getMapObjectById(idToSearch, onResponseCallback) {
|
|
827
|
+
let metaFeatures = [];
|
|
828
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
829
|
+
const id = String(feature.properties.myMapObjectId);
|
|
830
|
+
if (id === String(idToSearch)) {
|
|
831
|
+
const objFeature = {
|
|
832
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
833
|
+
coordinates: feature.coordinates,
|
|
834
|
+
name: feature.properties.title,
|
|
835
|
+
whatDimension: feature.properties.dimension_what,
|
|
836
|
+
whereDimension: feature.properties.dimension_where,
|
|
837
|
+
geometry: feature.geometry,
|
|
838
|
+
properties: feature.properties
|
|
839
|
+
};
|
|
840
|
+
metaFeatures.push(objFeature);
|
|
1042
841
|
}
|
|
1043
|
-
onResponseCallback(metaFeatures);
|
|
1044
842
|
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
geometry: feature.geometry,
|
|
1063
|
-
properties: feature.properties
|
|
1064
|
-
};
|
|
1065
|
-
metaFeatures.push(objFeature);
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
} catch (err) {
|
|
1069
|
-
_iterator8.e(err);
|
|
1070
|
-
} finally {
|
|
1071
|
-
_iterator8.f();
|
|
843
|
+
onResponseCallback(metaFeatures);
|
|
844
|
+
}
|
|
845
|
+
getMapObjectByLocalRef(localRefToSearch, onResponseCallback) {
|
|
846
|
+
let metaFeatures = [];
|
|
847
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
848
|
+
const localRef = String(feature.properties.localRef);
|
|
849
|
+
if (localRef === String(localRefToSearch)) {
|
|
850
|
+
const objFeature = {
|
|
851
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
852
|
+
coordinates: feature.coordinates,
|
|
853
|
+
name: feature.properties.title,
|
|
854
|
+
whatDimension: feature.properties.dimension_what,
|
|
855
|
+
whereDimension: feature.properties.dimension_where,
|
|
856
|
+
geometry: feature.geometry,
|
|
857
|
+
properties: feature.properties
|
|
858
|
+
};
|
|
859
|
+
metaFeatures.push(objFeature);
|
|
1072
860
|
}
|
|
1073
|
-
onResponseCallback(metaFeatures);
|
|
1074
861
|
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
geometry: feature.geometry,
|
|
1093
|
-
properties: feature.properties
|
|
1094
|
-
};
|
|
1095
|
-
metaFeatures.push(objFeature);
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
} catch (err) {
|
|
1099
|
-
_iterator9.e(err);
|
|
1100
|
-
} finally {
|
|
1101
|
-
_iterator9.f();
|
|
862
|
+
onResponseCallback(metaFeatures);
|
|
863
|
+
}
|
|
864
|
+
getMapObjectMatchingLocalRef(localRefToSearch, onResponseCallback) {
|
|
865
|
+
let metaFeatures = [];
|
|
866
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
867
|
+
const localRef = String(feature.properties.localRef);
|
|
868
|
+
if (localRef.includes(String(localRefToSearch))) {
|
|
869
|
+
const objFeature = {
|
|
870
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
871
|
+
coordinates: feature.coordinates,
|
|
872
|
+
name: feature.properties.title,
|
|
873
|
+
whatDimension: feature.properties.dimension_what,
|
|
874
|
+
whereDimension: feature.properties.dimension_where,
|
|
875
|
+
geometry: feature.geometry,
|
|
876
|
+
properties: feature.properties
|
|
877
|
+
};
|
|
878
|
+
metaFeatures.push(objFeature);
|
|
1102
879
|
}
|
|
1103
|
-
onResponseCallback(metaFeatures);
|
|
1104
880
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
coordinates: feature.coordinates,
|
|
1122
|
-
name: feature.properties.title,
|
|
1123
|
-
whatDimension: feature.properties.dimension_what,
|
|
1124
|
-
whereDimension: feature.properties.dimension_where,
|
|
1125
|
-
geometry: feature.geometry,
|
|
1126
|
-
properties: feature.properties
|
|
1127
|
-
};
|
|
1128
|
-
metaFeatures.push(objFeature);
|
|
1129
|
-
}
|
|
881
|
+
onResponseCallback(metaFeatures);
|
|
882
|
+
}
|
|
883
|
+
getMapObjectsMatchingLocalRefs(localRefsToSearch, onResponseCallback) {
|
|
884
|
+
let metaFeatures = [];
|
|
885
|
+
const localRefsArray = Array.isArray(localRefsToSearch) ? localRefsToSearch : [localRefsToSearch];
|
|
886
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
887
|
+
const localRef = String(feature.properties.localRef);
|
|
888
|
+
if (localRefsArray.some(ref => localRef.includes(String(ref)))) {
|
|
889
|
+
const objFeature = {
|
|
890
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
891
|
+
coordinates: feature.coordinates,
|
|
892
|
+
name: feature.properties.title,
|
|
893
|
+
whatDimension: feature.properties.dimension_what,
|
|
894
|
+
whereDimension: feature.properties.dimension_where,
|
|
895
|
+
geometry: feature.geometry,
|
|
896
|
+
properties: feature.properties
|
|
1130
897
|
};
|
|
1131
|
-
|
|
1132
|
-
_loop2();
|
|
1133
|
-
}
|
|
1134
|
-
} catch (err) {
|
|
1135
|
-
_iterator0.e(err);
|
|
1136
|
-
} finally {
|
|
1137
|
-
_iterator0.f();
|
|
898
|
+
metaFeatures.push(objFeature);
|
|
1138
899
|
}
|
|
1139
|
-
onResponseCallback(metaFeatures);
|
|
1140
900
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
geometry: feature.geometry,
|
|
1159
|
-
properties: feature.properties
|
|
1160
|
-
};
|
|
1161
|
-
metaFeatures.push(objFeature);
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
} catch (err) {
|
|
1165
|
-
_iterator1.e(err);
|
|
1166
|
-
} finally {
|
|
1167
|
-
_iterator1.f();
|
|
901
|
+
onResponseCallback(metaFeatures);
|
|
902
|
+
}
|
|
903
|
+
getMapObjectsByWhatTaxonomy(whatTaxonomyPath, onResponseCallback) {
|
|
904
|
+
let metaFeatures = [];
|
|
905
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
906
|
+
const whatTaxonomy = String(feature.properties.dimension_what);
|
|
907
|
+
if (!whatTaxonomyPath || whatTaxonomy === String(whatTaxonomyPath)) {
|
|
908
|
+
const objFeature = {
|
|
909
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
910
|
+
coordinates: feature.coordinates,
|
|
911
|
+
name: feature.properties.title,
|
|
912
|
+
whatDimension: feature.properties.dimension_what,
|
|
913
|
+
whereDimension: feature.properties.dimension_where,
|
|
914
|
+
geometry: feature.geometry,
|
|
915
|
+
properties: feature.properties
|
|
916
|
+
};
|
|
917
|
+
metaFeatures.push(objFeature);
|
|
1168
918
|
}
|
|
1169
|
-
onResponseCallback(metaFeatures);
|
|
1170
919
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
geometry: feature.geometry,
|
|
1189
|
-
properties: feature.properties
|
|
1190
|
-
};
|
|
1191
|
-
metaFeatures.push(objFeature);
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
} catch (err) {
|
|
1195
|
-
_iterator10.e(err);
|
|
1196
|
-
} finally {
|
|
1197
|
-
_iterator10.f();
|
|
920
|
+
onResponseCallback(metaFeatures);
|
|
921
|
+
}
|
|
922
|
+
getMapObjectsByWhereTaxonomy(whereTaxonomyPath, onResponseCallback) {
|
|
923
|
+
let metaFeatures = [];
|
|
924
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
925
|
+
const whereTaxonomy = String(feature.properties.dimension_where);
|
|
926
|
+
if (whereTaxonomy === String(whereTaxonomyPath)) {
|
|
927
|
+
const objFeature = {
|
|
928
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
929
|
+
coordinates: feature.coordinates,
|
|
930
|
+
name: feature.properties.title,
|
|
931
|
+
whatDimension: feature.properties.dimension_what,
|
|
932
|
+
whereDimension: feature.properties.dimension_where,
|
|
933
|
+
geometry: feature.geometry,
|
|
934
|
+
properties: feature.properties
|
|
935
|
+
};
|
|
936
|
+
metaFeatures.push(objFeature);
|
|
1198
937
|
}
|
|
1199
|
-
onResponseCallback(metaFeatures);
|
|
1200
938
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
geometry: feature.geometry,
|
|
1220
|
-
properties: feature.properties
|
|
1221
|
-
};
|
|
1222
|
-
metaFeatures.push(objFeature);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
} catch (err) {
|
|
1226
|
-
_iterator11.e(err);
|
|
1227
|
-
} finally {
|
|
1228
|
-
_iterator11.f();
|
|
939
|
+
onResponseCallback(metaFeatures);
|
|
940
|
+
}
|
|
941
|
+
getMapObjectsByWhatAndWhereTaxonomy(whatTaxonomyPath, whereTaxonomyPath, onResponseCallback) {
|
|
942
|
+
let metaFeatures = [];
|
|
943
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
944
|
+
const whereTaxonomy = String(feature.properties.dimension_where);
|
|
945
|
+
const whatTaxonomy = String(feature.properties.dimension_what);
|
|
946
|
+
if (whereTaxonomy === String(whereTaxonomyPath) && whatTaxonomy === String(whatTaxonomyPath)) {
|
|
947
|
+
const objFeature = {
|
|
948
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
949
|
+
coordinates: feature.coordinates,
|
|
950
|
+
name: feature.properties.title,
|
|
951
|
+
whatDimension: feature.properties.dimension_what,
|
|
952
|
+
whereDimension: feature.properties.dimension_where,
|
|
953
|
+
geometry: feature.geometry,
|
|
954
|
+
properties: feature.properties
|
|
955
|
+
};
|
|
956
|
+
metaFeatures.push(objFeature);
|
|
1229
957
|
}
|
|
1230
|
-
onResponseCallback(metaFeatures);
|
|
1231
958
|
}
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
geometry: feature.geometry,
|
|
1250
|
-
properties: feature.properties
|
|
1251
|
-
};
|
|
1252
|
-
metaFeatures.push(objFeature);
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
} catch (err) {
|
|
1256
|
-
_iterator12.e(err);
|
|
1257
|
-
} finally {
|
|
1258
|
-
_iterator12.f();
|
|
959
|
+
onResponseCallback(metaFeatures);
|
|
960
|
+
}
|
|
961
|
+
getMapObjectsInWhatTaxonomy(whatTaxonomyPaths, onResponseCallback) {
|
|
962
|
+
let metaFeatures = [];
|
|
963
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
964
|
+
const whatTaxonomy = String(feature.properties.dimension_what);
|
|
965
|
+
if (whatTaxonomyPaths.includes(whatTaxonomy)) {
|
|
966
|
+
const objFeature = {
|
|
967
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
968
|
+
coordinates: feature.coordinates,
|
|
969
|
+
name: feature.properties.title,
|
|
970
|
+
whatDimension: feature.properties.dimension_what,
|
|
971
|
+
whereDimension: feature.properties.dimension_where,
|
|
972
|
+
geometry: feature.geometry,
|
|
973
|
+
properties: feature.properties
|
|
974
|
+
};
|
|
975
|
+
metaFeatures.push(objFeature);
|
|
1259
976
|
}
|
|
1260
|
-
onResponseCallback(metaFeatures);
|
|
1261
977
|
}
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
geometry: feature.geometry,
|
|
1280
|
-
properties: feature.properties
|
|
1281
|
-
};
|
|
1282
|
-
metaFeatures.push(objFeature);
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
} catch (err) {
|
|
1286
|
-
_iterator13.e(err);
|
|
1287
|
-
} finally {
|
|
1288
|
-
_iterator13.f();
|
|
978
|
+
onResponseCallback(metaFeatures);
|
|
979
|
+
}
|
|
980
|
+
getMapObjectsInWhereTaxonomy(whereTaxonomyPaths, onResponseCallback) {
|
|
981
|
+
let metaFeatures = [];
|
|
982
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
983
|
+
const whereTaxonomy = String(feature.properties.dimension_where);
|
|
984
|
+
if (whereTaxonomyPaths.includes(whereTaxonomy)) {
|
|
985
|
+
const objFeature = {
|
|
986
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
987
|
+
coordinates: feature.coordinates,
|
|
988
|
+
name: feature.properties.title,
|
|
989
|
+
whatDimension: feature.properties.dimension_what,
|
|
990
|
+
whereDimension: feature.properties.dimension_where,
|
|
991
|
+
geometry: feature.geometry,
|
|
992
|
+
properties: feature.properties
|
|
993
|
+
};
|
|
994
|
+
metaFeatures.push(objFeature);
|
|
1289
995
|
}
|
|
1290
|
-
onResponseCallback(metaFeatures);
|
|
1291
996
|
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
geometry: feature.geometry,
|
|
1311
|
-
properties: feature.properties
|
|
1312
|
-
};
|
|
1313
|
-
metaFeatures.push(objFeature);
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
} catch (err) {
|
|
1317
|
-
_iterator14.e(err);
|
|
1318
|
-
} finally {
|
|
1319
|
-
_iterator14.f();
|
|
997
|
+
onResponseCallback(metaFeatures);
|
|
998
|
+
}
|
|
999
|
+
getMapObjectsInWhatAndWhereTaxonomy(whatTaxonomyPaths, whereTaxonomyPaths, onResponseCallback) {
|
|
1000
|
+
let metaFeatures = [];
|
|
1001
|
+
for (const feature of this.searchableGeoJsonFeatures) {
|
|
1002
|
+
const whereTaxonomy = String(feature.properties.dimension_where);
|
|
1003
|
+
const whatTaxonomy = String(feature.properties.dimension_what);
|
|
1004
|
+
if (whereTaxonomyPaths.includes(whereTaxonomy) && whatTaxonomyPaths.includes(whatTaxonomy)) {
|
|
1005
|
+
const objFeature = {
|
|
1006
|
+
mapObjectId: String(feature.properties.myMapObjectId),
|
|
1007
|
+
coordinates: feature.coordinates,
|
|
1008
|
+
name: feature.properties.title,
|
|
1009
|
+
whatDimension: feature.properties.dimension_what,
|
|
1010
|
+
whereDimension: feature.properties.dimension_where,
|
|
1011
|
+
geometry: feature.geometry,
|
|
1012
|
+
properties: feature.properties
|
|
1013
|
+
};
|
|
1014
|
+
metaFeatures.push(objFeature);
|
|
1320
1015
|
}
|
|
1321
|
-
onResponseCallback(metaFeatures);
|
|
1322
1016
|
}
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
(
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
reject(error);
|
|
1341
|
-
});
|
|
1017
|
+
onResponseCallback(metaFeatures);
|
|
1018
|
+
}
|
|
1019
|
+
getMapObjectsApi() {
|
|
1020
|
+
let query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1021
|
+
return new Promise((resolve, reject) => {
|
|
1022
|
+
(0, _axios.default)({
|
|
1023
|
+
url: "".concat(this.empApi, "/map-objects").concat(query),
|
|
1024
|
+
headers: {
|
|
1025
|
+
Authorization: "Bearer ".concat(this.atomsAPIAccessToken)
|
|
1026
|
+
},
|
|
1027
|
+
method: 'get'
|
|
1028
|
+
}).then(response => {
|
|
1029
|
+
const data = response.data.data;
|
|
1030
|
+
let uniqueFeatures = data;
|
|
1031
|
+
resolve(uniqueFeatures);
|
|
1032
|
+
}).catch(function (error) {
|
|
1033
|
+
reject(error);
|
|
1342
1034
|
});
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
}();
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
getMapObjectsByWhatTaxonomyAPI(whatTaxonomyPath, onResponseCallback) {
|
|
1038
|
+
let query = "?$limit=".concat(this.apiRequestLimit);
|
|
1039
|
+
if (whatTaxonomyPath) query += "&taxonomy2Path=".concat(whatTaxonomyPath);
|
|
1040
|
+
this.getMapObjectsApi(query).then(onResponseCallback).catch(onResponseCallback);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
exports.MetaAtlasCore = MetaAtlasCore;
|
|
1353
1044
|
//# sourceMappingURL=meta-atlas-sdk-core.js.map
|