@mapvx/web-js 1.2.1 → 1.2.3-dev.1
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/LICENSE.md +2 -2
- package/README.md +12 -9
- package/dist/cjs/assets/icons.js +6 -8
- package/dist/cjs/assets/icons.js.map +1 -1
- package/dist/cjs/controllers/routeController.js +19 -19
- package/dist/cjs/controllers/routeController.js.map +1 -1
- package/dist/cjs/domain/models/animation.js +2 -2
- package/dist/cjs/domain/models/categories.js +23 -10
- package/dist/cjs/domain/models/categories.js.map +1 -1
- package/dist/cjs/domain/models/mapConfig.js +10 -1
- package/dist/cjs/domain/models/mapConfig.js.map +1 -1
- package/dist/cjs/domain/models/marker.js +86 -80
- package/dist/cjs/domain/models/marker.js.map +1 -1
- package/dist/cjs/domain/models/routeConfiguration.js +3 -1
- package/dist/cjs/domain/models/routeConfiguration.js.map +1 -1
- package/dist/cjs/index.js +17 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger/logger.js +13 -8
- package/dist/cjs/logger/logger.js.map +1 -1
- package/dist/cjs/logger/rollbar.js +11 -6
- package/dist/cjs/logger/rollbar.js.map +1 -1
- package/dist/cjs/map/map.js +102 -26
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/map/mapInteractionOptions.js +56 -0
- package/dist/cjs/map/mapInteractionOptions.js.map +1 -0
- package/dist/cjs/repository/repository.js +25 -26
- package/dist/cjs/repository/repository.js.map +1 -1
- package/dist/cjs/repository/requester.js +71 -91
- package/dist/cjs/repository/requester.js.map +1 -1
- package/dist/cjs/sdk.js +18 -1
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/cjs/utils/semaphore.js +143 -0
- package/dist/cjs/utils/semaphore.js.map +1 -0
- package/dist/es/assets/icons.d.ts +4 -4
- package/dist/es/assets/icons.d.ts.map +1 -1
- package/dist/es/assets/icons.js +6 -8
- package/dist/es/assets/icons.js.map +1 -1
- package/dist/es/controllers/routeController.d.ts.map +1 -1
- package/dist/es/controllers/routeController.js +19 -19
- package/dist/es/controllers/routeController.js.map +1 -1
- package/dist/es/domain/models/animation.d.ts +3 -3
- package/dist/es/domain/models/animation.js +2 -2
- package/dist/es/domain/models/categories.d.ts +34 -10
- package/dist/es/domain/models/categories.d.ts.map +1 -1
- package/dist/es/domain/models/categories.js +21 -9
- package/dist/es/domain/models/categories.js.map +1 -1
- package/dist/es/domain/models/configuration.d.ts +8 -0
- package/dist/es/domain/models/configuration.d.ts.map +1 -1
- package/dist/es/domain/models/mapConfig.d.ts +118 -3
- package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
- package/dist/es/domain/models/mapConfig.js +9 -0
- package/dist/es/domain/models/mapConfig.js.map +1 -1
- package/dist/es/domain/models/marker.d.ts +8 -0
- package/dist/es/domain/models/marker.d.ts.map +1 -1
- package/dist/es/domain/models/marker.js +86 -80
- package/dist/es/domain/models/marker.js.map +1 -1
- package/dist/es/domain/models/routeConfiguration.d.ts +47 -0
- package/dist/es/domain/models/routeConfiguration.d.ts.map +1 -1
- package/dist/es/domain/models/routeConfiguration.js +3 -1
- package/dist/es/domain/models/routeConfiguration.js.map +1 -1
- package/dist/es/index.d.ts +13 -12
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +8 -6
- package/dist/es/index.js.map +1 -1
- package/dist/es/interfaces/routeCacheResponse.d.ts.map +1 -1
- package/dist/es/logger/logger.d.ts.map +1 -1
- package/dist/es/logger/logger.js +13 -8
- package/dist/es/logger/logger.js.map +1 -1
- package/dist/es/logger/rollbar.d.ts.map +1 -1
- package/dist/es/logger/rollbar.js +11 -6
- package/dist/es/logger/rollbar.js.map +1 -1
- package/dist/es/map/map.d.ts +79 -0
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +104 -28
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/map/mapInteractionOptions.d.ts +37 -0
- package/dist/es/map/mapInteractionOptions.d.ts.map +1 -0
- package/dist/es/map/mapInteractionOptions.js +51 -0
- package/dist/es/map/mapInteractionOptions.js.map +1 -0
- package/dist/es/repository/repository.d.ts +0 -1
- package/dist/es/repository/repository.d.ts.map +1 -1
- package/dist/es/repository/repository.js +25 -26
- package/dist/es/repository/repository.js.map +1 -1
- package/dist/es/repository/requester.d.ts +12 -2
- package/dist/es/repository/requester.d.ts.map +1 -1
- package/dist/es/repository/requester.js +71 -91
- package/dist/es/repository/requester.js.map +1 -1
- package/dist/es/sdk.d.ts +2 -0
- package/dist/es/sdk.d.ts.map +1 -1
- package/dist/es/sdk.js +18 -1
- package/dist/es/sdk.js.map +1 -1
- package/dist/es/utils/semaphore.d.ts +70 -0
- package/dist/es/utils/semaphore.d.ts.map +1 -0
- package/dist/es/utils/semaphore.js +139 -0
- package/dist/es/utils/semaphore.js.map +1 -0
- package/dist/umd/index.js +1092 -643
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/styles.css +32 -14
- package/dist/umd/styles.css.map +1 -1
- package/package.json +63 -49
- package/dist/cjs/assets/route_animation_icon.svg +0 -15
- package/dist/cjs/assets/user-dot-icon.svg +0 -3
- package/dist/es/assets/route_animation_icon.svg +0 -15
- package/dist/es/assets/user-dot-icon.svg +0 -3
package/dist/umd/index.js
CHANGED
|
@@ -5726,9 +5726,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5726
5726
|
CountlyLogger: () => (/* reexport */ CountlyLogger),
|
|
5727
5727
|
DEFAULT_CACHE_CONFIGS: () => (/* reexport */ DEFAULT_CACHE_CONFIGS),
|
|
5728
5728
|
DEFAULT_MAX_STORAGE_BYTES: () => (/* reexport */ DEFAULT_MAX_STORAGE_BYTES),
|
|
5729
|
+
DEFAULT_TILE_CACHE_CONFIG: () => (/* reexport */ DEFAULT_TILE_CACHE_CONFIG),
|
|
5729
5730
|
FetchHttpClient: () => (/* reexport */ FetchHttpClient),
|
|
5730
5731
|
Institution: () => (/* reexport */ Institution),
|
|
5731
5732
|
LRUCache: () => (/* reexport */ LRUCache),
|
|
5733
|
+
MAPLIBRE_MAX_TILE_CACHE_HARD_CAP: () => (/* reexport */ MAPLIBRE_MAX_TILE_CACHE_HARD_CAP),
|
|
5732
5734
|
MAPVX_BRAND_COLOR: () => (/* reexport */ MAPVX_BRAND_COLOR),
|
|
5733
5735
|
MAPVX_DEFAULT_PRECONNECT_HOSTS: () => (/* reexport */ MAPVX_DEFAULT_PRECONNECT_HOSTS),
|
|
5734
5736
|
MVXPlace: () => (/* reexport */ place_MVXPlace),
|
|
@@ -5746,6 +5748,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5746
5748
|
initializeSDK: () => (/* reexport */ initializeSDK),
|
|
5747
5749
|
injectPreconnects: () => (/* reexport */ injectPreconnects),
|
|
5748
5750
|
isBasicWithIcon: () => (/* reexport */ isBasicWithIcon),
|
|
5751
|
+
isBasicWithImageUrl: () => (/* reexport */ isBasicWithImageUrl),
|
|
5749
5752
|
isBasicWithLogo: () => (/* reexport */ isBasicWithLogo),
|
|
5750
5753
|
isMapVxRequestHostname: () => (/* reexport */ isMapVxRequestHostname),
|
|
5751
5754
|
isValidCircleConfig: () => (/* reexport */ isValidCircleConfig),
|
|
@@ -5753,8 +5756,106 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5753
5756
|
loadStyles: () => (/* binding */ loadStyles)
|
|
5754
5757
|
});
|
|
5755
5758
|
|
|
5756
|
-
;// ./src/infrastructure/cache/
|
|
5759
|
+
;// ./src/infrastructure/cache/cacheConfig.ts
|
|
5757
5760
|
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); }
|
|
5761
|
+
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; }
|
|
5762
|
+
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; }
|
|
5763
|
+
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; }
|
|
5764
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5765
|
+
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); }
|
|
5766
|
+
/**
|
|
5767
|
+
* Cache configuration types and defaults
|
|
5768
|
+
* Defines the configuration options for the caching system
|
|
5769
|
+
* @module cacheConfig
|
|
5770
|
+
*/
|
|
5771
|
+
|
|
5772
|
+
/**
|
|
5773
|
+
* Cache types available in the SDK
|
|
5774
|
+
* @group Configuration
|
|
5775
|
+
*/
|
|
5776
|
+
|
|
5777
|
+
/**
|
|
5778
|
+
* Configuration for a single cache instance
|
|
5779
|
+
* @group Configuration
|
|
5780
|
+
*/
|
|
5781
|
+
|
|
5782
|
+
/**
|
|
5783
|
+
* Configuration for the CacheManager
|
|
5784
|
+
* @group Configuration
|
|
5785
|
+
*/
|
|
5786
|
+
|
|
5787
|
+
/**
|
|
5788
|
+
* Default maximum storage size: 5MB
|
|
5789
|
+
*/
|
|
5790
|
+
var DEFAULT_MAX_STORAGE_BYTES = 5 * 1024 * 1024;
|
|
5791
|
+
|
|
5792
|
+
/**
|
|
5793
|
+
* Default cache configurations per type
|
|
5794
|
+
* These values balance memory usage with performance
|
|
5795
|
+
*/
|
|
5796
|
+
var DEFAULT_CACHE_CONFIGS = {
|
|
5797
|
+
places: {
|
|
5798
|
+
maxItems: 500,
|
|
5799
|
+
ttlMs: 30 * 60 * 1000,
|
|
5800
|
+
// 30 minutes
|
|
5801
|
+
persistenceKey: "mvx_places"
|
|
5802
|
+
},
|
|
5803
|
+
routes: {
|
|
5804
|
+
maxItems: 100,
|
|
5805
|
+
ttlMs: 5 * 60 * 1000,
|
|
5806
|
+
// 5 minutes
|
|
5807
|
+
persistenceKey: "mvx_routes"
|
|
5808
|
+
},
|
|
5809
|
+
accessibleRoutes: {
|
|
5810
|
+
maxItems: 100,
|
|
5811
|
+
ttlMs: 5 * 60 * 1000,
|
|
5812
|
+
// 5 minutes
|
|
5813
|
+
persistenceKey: "mvx_accessible_routes"
|
|
5814
|
+
},
|
|
5815
|
+
configurations: {
|
|
5816
|
+
maxItems: 10,
|
|
5817
|
+
ttlMs: 60 * 60 * 1000,
|
|
5818
|
+
// 1 hour
|
|
5819
|
+
persistenceKey: "mvx_configurations"
|
|
5820
|
+
},
|
|
5821
|
+
categories: {
|
|
5822
|
+
maxItems: 20,
|
|
5823
|
+
ttlMs: 60 * 60 * 1000,
|
|
5824
|
+
// 1 hour
|
|
5825
|
+
persistenceKey: "mvx_categories"
|
|
5826
|
+
},
|
|
5827
|
+
vehicles: {
|
|
5828
|
+
maxItems: 50,
|
|
5829
|
+
ttlMs: 60 * 1000,
|
|
5830
|
+
// 1 minute
|
|
5831
|
+
persistenceKey: "mvx_vehicles"
|
|
5832
|
+
},
|
|
5833
|
+
stops: {
|
|
5834
|
+
maxItems: 100,
|
|
5835
|
+
ttlMs: 60 * 1000,
|
|
5836
|
+
// 1 minute
|
|
5837
|
+
persistenceKey: "mvx_stops"
|
|
5838
|
+
},
|
|
5839
|
+
subPlaces: {
|
|
5840
|
+
maxItems: 200,
|
|
5841
|
+
ttlMs: 15 * 60 * 1000,
|
|
5842
|
+
// 15 minutes
|
|
5843
|
+
persistenceKey: "mvx_subplaces"
|
|
5844
|
+
}
|
|
5845
|
+
};
|
|
5846
|
+
|
|
5847
|
+
/**
|
|
5848
|
+
* Merges user config with defaults for a specific cache type
|
|
5849
|
+
* @param cacheType - The type of cache
|
|
5850
|
+
* @param userConfig - Optional user-provided configuration
|
|
5851
|
+
* @returns Complete cache configuration
|
|
5852
|
+
*/
|
|
5853
|
+
function getCacheConfig(cacheType, userConfig) {
|
|
5854
|
+
var defaultConfig = DEFAULT_CACHE_CONFIGS[cacheType];
|
|
5855
|
+
return _objectSpread(_objectSpread({}, defaultConfig), userConfig);
|
|
5856
|
+
}
|
|
5857
|
+
;// ./src/infrastructure/cache/LRUCache.ts
|
|
5858
|
+
function LRUCache_typeof(o) { "@babel/helpers - typeof"; return LRUCache_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; }, LRUCache_typeof(o); }
|
|
5758
5859
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
5759
5860
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5760
5861
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
@@ -5763,11 +5864,11 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
5763
5864
|
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; } }
|
|
5764
5865
|
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; }
|
|
5765
5866
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5766
|
-
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,
|
|
5867
|
+
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, LRUCache_toPropertyKey(o.key), o); } }
|
|
5767
5868
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5768
|
-
function
|
|
5769
|
-
function
|
|
5770
|
-
function
|
|
5869
|
+
function LRUCache_defineProperty(e, r, t) { return (r = LRUCache_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5870
|
+
function LRUCache_toPropertyKey(t) { var i = LRUCache_toPrimitive(t, "string"); return "symbol" == LRUCache_typeof(i) ? i : i + ""; }
|
|
5871
|
+
function LRUCache_toPrimitive(t, r) { if ("object" != LRUCache_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != LRUCache_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5771
5872
|
/**
|
|
5772
5873
|
* Internal cache entry structure
|
|
5773
5874
|
*/
|
|
@@ -5794,10 +5895,10 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
5794
5895
|
function LRUCache(config) {
|
|
5795
5896
|
_classCallCheck(this, LRUCache);
|
|
5796
5897
|
// Hit rate tracking
|
|
5797
|
-
|
|
5798
|
-
|
|
5898
|
+
LRUCache_defineProperty(this, "hits", 0);
|
|
5899
|
+
LRUCache_defineProperty(this, "misses", 0);
|
|
5799
5900
|
// Monotonic counter for LRU ordering (avoids issues with same-millisecond operations)
|
|
5800
|
-
|
|
5901
|
+
LRUCache_defineProperty(this, "accessCounter", 0);
|
|
5801
5902
|
this.cache = new Map();
|
|
5802
5903
|
this.maxItems = config.maxItems;
|
|
5803
5904
|
this.ttlMs = config.ttlMs;
|
|
@@ -5965,104 +6066,6 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
5965
6066
|
}
|
|
5966
6067
|
}]);
|
|
5967
6068
|
}();
|
|
5968
|
-
;// ./src/infrastructure/cache/cacheConfig.ts
|
|
5969
|
-
function cacheConfig_typeof(o) { "@babel/helpers - typeof"; return cacheConfig_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; }, cacheConfig_typeof(o); }
|
|
5970
|
-
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; }
|
|
5971
|
-
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) { cacheConfig_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; }
|
|
5972
|
-
function cacheConfig_defineProperty(e, r, t) { return (r = cacheConfig_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5973
|
-
function cacheConfig_toPropertyKey(t) { var i = cacheConfig_toPrimitive(t, "string"); return "symbol" == cacheConfig_typeof(i) ? i : i + ""; }
|
|
5974
|
-
function cacheConfig_toPrimitive(t, r) { if ("object" != cacheConfig_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != cacheConfig_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5975
|
-
/**
|
|
5976
|
-
* Cache configuration types and defaults
|
|
5977
|
-
* Defines the configuration options for the caching system
|
|
5978
|
-
* @module cacheConfig
|
|
5979
|
-
*/
|
|
5980
|
-
|
|
5981
|
-
/**
|
|
5982
|
-
* Cache types available in the SDK
|
|
5983
|
-
* @group Configuration
|
|
5984
|
-
*/
|
|
5985
|
-
|
|
5986
|
-
/**
|
|
5987
|
-
* Configuration for a single cache instance
|
|
5988
|
-
* @group Configuration
|
|
5989
|
-
*/
|
|
5990
|
-
|
|
5991
|
-
/**
|
|
5992
|
-
* Configuration for the CacheManager
|
|
5993
|
-
* @group Configuration
|
|
5994
|
-
*/
|
|
5995
|
-
|
|
5996
|
-
/**
|
|
5997
|
-
* Default maximum storage size: 5MB
|
|
5998
|
-
*/
|
|
5999
|
-
var DEFAULT_MAX_STORAGE_BYTES = 5 * 1024 * 1024;
|
|
6000
|
-
|
|
6001
|
-
/**
|
|
6002
|
-
* Default cache configurations per type
|
|
6003
|
-
* These values balance memory usage with performance
|
|
6004
|
-
*/
|
|
6005
|
-
var DEFAULT_CACHE_CONFIGS = {
|
|
6006
|
-
places: {
|
|
6007
|
-
maxItems: 500,
|
|
6008
|
-
ttlMs: 30 * 60 * 1000,
|
|
6009
|
-
// 30 minutes
|
|
6010
|
-
persistenceKey: "mvx_places"
|
|
6011
|
-
},
|
|
6012
|
-
routes: {
|
|
6013
|
-
maxItems: 100,
|
|
6014
|
-
ttlMs: 5 * 60 * 1000,
|
|
6015
|
-
// 5 minutes
|
|
6016
|
-
persistenceKey: "mvx_routes"
|
|
6017
|
-
},
|
|
6018
|
-
accessibleRoutes: {
|
|
6019
|
-
maxItems: 100,
|
|
6020
|
-
ttlMs: 5 * 60 * 1000,
|
|
6021
|
-
// 5 minutes
|
|
6022
|
-
persistenceKey: "mvx_accessible_routes"
|
|
6023
|
-
},
|
|
6024
|
-
configurations: {
|
|
6025
|
-
maxItems: 10,
|
|
6026
|
-
ttlMs: 60 * 60 * 1000,
|
|
6027
|
-
// 1 hour
|
|
6028
|
-
persistenceKey: "mvx_configurations"
|
|
6029
|
-
},
|
|
6030
|
-
categories: {
|
|
6031
|
-
maxItems: 20,
|
|
6032
|
-
ttlMs: 60 * 60 * 1000,
|
|
6033
|
-
// 1 hour
|
|
6034
|
-
persistenceKey: "mvx_categories"
|
|
6035
|
-
},
|
|
6036
|
-
vehicles: {
|
|
6037
|
-
maxItems: 50,
|
|
6038
|
-
ttlMs: 60 * 1000,
|
|
6039
|
-
// 1 minute
|
|
6040
|
-
persistenceKey: "mvx_vehicles"
|
|
6041
|
-
},
|
|
6042
|
-
stops: {
|
|
6043
|
-
maxItems: 100,
|
|
6044
|
-
ttlMs: 60 * 1000,
|
|
6045
|
-
// 1 minute
|
|
6046
|
-
persistenceKey: "mvx_stops"
|
|
6047
|
-
},
|
|
6048
|
-
subPlaces: {
|
|
6049
|
-
maxItems: 200,
|
|
6050
|
-
ttlMs: 15 * 60 * 1000,
|
|
6051
|
-
// 15 minutes
|
|
6052
|
-
persistenceKey: "mvx_subplaces"
|
|
6053
|
-
}
|
|
6054
|
-
};
|
|
6055
|
-
|
|
6056
|
-
/**
|
|
6057
|
-
* Merges user config with defaults for a specific cache type
|
|
6058
|
-
* @param cacheType - The type of cache
|
|
6059
|
-
* @param userConfig - Optional user-provided configuration
|
|
6060
|
-
* @returns Complete cache configuration
|
|
6061
|
-
*/
|
|
6062
|
-
function getCacheConfig(cacheType, userConfig) {
|
|
6063
|
-
var defaultConfig = DEFAULT_CACHE_CONFIGS[cacheType];
|
|
6064
|
-
return _objectSpread(_objectSpread({}, defaultConfig), userConfig);
|
|
6065
|
-
}
|
|
6066
6069
|
;// ./src/infrastructure/cache/PersistentCache.ts
|
|
6067
6070
|
function PersistentCache_typeof(o) { "@babel/helpers - typeof"; return PersistentCache_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; }, PersistentCache_typeof(o); }
|
|
6068
6071
|
function PersistentCache_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = PersistentCache_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; } } }; }
|
|
@@ -6790,13 +6793,16 @@ var countly_default = /*#__PURE__*/__webpack_require__.n(countly);
|
|
|
6790
6793
|
var rollbar_umd_min = __webpack_require__(916);
|
|
6791
6794
|
var rollbar_umd_min_default = /*#__PURE__*/__webpack_require__.n(rollbar_umd_min);
|
|
6792
6795
|
;// ./src/logger/rollbar.ts
|
|
6793
|
-
// VERSION
|
|
6794
|
-
// bundle. The tsc-built ES/CJS outputs keep
|
|
6795
|
-
// typeof
|
|
6796
|
-
// replaced with the package version by
|
|
6797
|
-
|
|
6796
|
+
// VERSION and ROLLBAR_ACCESS_TOKEN are webpack DefinePlugin constants,
|
|
6797
|
+
// substituted only in the UMD bundle. The tsc-built ES/CJS outputs keep them
|
|
6798
|
+
// as bare globals, so the typeof guards make the lookup safe everywhere; the
|
|
6799
|
+
// version placeholder is replaced with the package version by
|
|
6800
|
+
// scripts/inject-build-defines.js. The access token falls back to the MapVX
|
|
6801
|
+
// SDK-web Rollbar project token when none is injected at build time.
|
|
6802
|
+
var SDK_VERSION = true ? "1.2.3-dev.1" : 0;
|
|
6803
|
+
var ACCESS_TOKEN = false ? 0 : "28279d52df43411ebd138c2bee0ab1df";
|
|
6798
6804
|
var _rollbarConfig = {
|
|
6799
|
-
accessToken:
|
|
6805
|
+
accessToken: ACCESS_TOKEN,
|
|
6800
6806
|
// Only report what the SDK logs explicitly via logError. Capturing every
|
|
6801
6807
|
// uncaught error / unhandled rejection on the host page floods Rollbar
|
|
6802
6808
|
// with items from third-party code (e.g. Countly, the host app itself)
|
|
@@ -6832,17 +6838,20 @@ function logger_toPrimitive(t, r) { if ("object" != logger_typeof(t) || !t) retu
|
|
|
6832
6838
|
|
|
6833
6839
|
|
|
6834
6840
|
|
|
6841
|
+
// DEBUG, VERSION and COUNTLY_KEY are webpack DefinePlugin constants,
|
|
6842
|
+
// substituted only in the UMD bundle. The tsc-built ES/CJS outputs keep them
|
|
6843
|
+
// as bare globals, so reading them directly throws ReferenceError in
|
|
6844
|
+
// consumers of those builds. The typeof guards make the lookup safe
|
|
6845
|
+
// everywhere; the version placeholder is replaced with the package version
|
|
6846
|
+
// by scripts/inject-build-defines.js. The Countly key falls back to the
|
|
6847
|
+
// MapVX key when none is injected at build time.
|
|
6848
|
+
var IS_DEBUG = true ? false : 0;
|
|
6849
|
+
var logger_SDK_VERSION = true ? "1.2.3-dev.1" : 0;
|
|
6850
|
+
var COUNTLY_API_KEY = false ? 0 : "f0c8d3b96d336e857a8628f49dd1baf7d7add0e9";
|
|
6835
6851
|
var logger_countly = {
|
|
6836
|
-
apiKey:
|
|
6852
|
+
apiKey: COUNTLY_API_KEY,
|
|
6837
6853
|
url: "https://countly.lazarillo.app"
|
|
6838
6854
|
};
|
|
6839
|
-
// DEBUG and VERSION are webpack DefinePlugin constants, substituted only in
|
|
6840
|
-
// the UMD bundle. The tsc-built ES/CJS outputs keep them as bare globals, so
|
|
6841
|
-
// reading them directly throws ReferenceError in consumers of those builds.
|
|
6842
|
-
// The typeof guards make the lookup safe everywhere; the version placeholder
|
|
6843
|
-
// is replaced with the package version by scripts/inject-build-defines.js.
|
|
6844
|
-
var IS_DEBUG = true ? false : 0;
|
|
6845
|
-
var logger_SDK_VERSION = true ? "1.2.1" : 0;
|
|
6846
6855
|
var Logger = /*#__PURE__*/function () {
|
|
6847
6856
|
function Logger() {
|
|
6848
6857
|
logger_classCallCheck(this, Logger);
|
|
@@ -7034,6 +7043,174 @@ var CountlyLogger = /*#__PURE__*/function () {
|
|
|
7034
7043
|
// EXTERNAL MODULE: ./node_modules/.pnpm/maplibre-gl@5.7.0/node_modules/maplibre-gl/dist/maplibre-gl.js
|
|
7035
7044
|
var maplibre_gl = __webpack_require__(997);
|
|
7036
7045
|
var maplibre_gl_default = /*#__PURE__*/__webpack_require__.n(maplibre_gl);
|
|
7046
|
+
;// ./src/utils/semaphore.ts
|
|
7047
|
+
function semaphore_typeof(o) { "@babel/helpers - typeof"; return semaphore_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; }, semaphore_typeof(o); }
|
|
7048
|
+
function semaphore_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
7049
|
+
function semaphore_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, semaphore_toPropertyKey(o.key), o); } }
|
|
7050
|
+
function semaphore_createClass(e, r, t) { return r && semaphore_defineProperties(e.prototype, r), t && semaphore_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7051
|
+
function semaphore_defineProperty(e, r, t) { return (r = semaphore_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7052
|
+
function semaphore_toPropertyKey(t) { var i = semaphore_toPrimitive(t, "string"); return "symbol" == semaphore_typeof(i) ? i : i + ""; }
|
|
7053
|
+
function semaphore_toPrimitive(t, r) { if ("object" != semaphore_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != semaphore_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7054
|
+
/**
|
|
7055
|
+
* Lower bound (inclusive) for the semaphore concurrency limit.
|
|
7056
|
+
*
|
|
7057
|
+
* A value of 1 means at least one operation can run at a time, which keeps the
|
|
7058
|
+
* semaphore meaningful: zero or negative limits would deadlock every caller.
|
|
7059
|
+
*/
|
|
7060
|
+
var MIN_LIMIT = 1;
|
|
7061
|
+
|
|
7062
|
+
/**
|
|
7063
|
+
* Upper bound (inclusive) for the semaphore concurrency limit.
|
|
7064
|
+
*
|
|
7065
|
+
* 64 is high enough for any practical browser-side fan-out (network requests,
|
|
7066
|
+
* tile fetches, etc.) while still protecting downstream services from being
|
|
7067
|
+
* overwhelmed by misconfigured callers.
|
|
7068
|
+
*/
|
|
7069
|
+
var MAX_LIMIT = 64;
|
|
7070
|
+
|
|
7071
|
+
/**
|
|
7072
|
+
* Validate and normalize a candidate concurrency limit.
|
|
7073
|
+
*
|
|
7074
|
+
* @param limit - Candidate value to validate.
|
|
7075
|
+
* @returns The validated integer limit, or `null` if the value is invalid.
|
|
7076
|
+
*/
|
|
7077
|
+
function normalizeLimit(limit) {
|
|
7078
|
+
if (!Number.isFinite(limit)) return null;
|
|
7079
|
+
var floored = Math.floor(limit);
|
|
7080
|
+
if (floored < MIN_LIMIT || floored > MAX_LIMIT) return null;
|
|
7081
|
+
return floored;
|
|
7082
|
+
}
|
|
7083
|
+
|
|
7084
|
+
/**
|
|
7085
|
+
* Counting semaphore that caps the number of concurrent operations.
|
|
7086
|
+
*
|
|
7087
|
+
* Useful when calling APIs, CDNs, or other shared resources where unbounded
|
|
7088
|
+
* parallelism can trigger rate limiting, WAF blocks, or excessive memory use.
|
|
7089
|
+
* Waiters are released in FIFO order as slots become free.
|
|
7090
|
+
*
|
|
7091
|
+
* @example
|
|
7092
|
+
* ```typescript
|
|
7093
|
+
* const sem = new Semaphore(4);
|
|
7094
|
+
*
|
|
7095
|
+
* async function fetchTile(url: string) {
|
|
7096
|
+
* await sem.acquire();
|
|
7097
|
+
* try {
|
|
7098
|
+
* return await fetch(url);
|
|
7099
|
+
* } finally {
|
|
7100
|
+
* sem.release();
|
|
7101
|
+
* }
|
|
7102
|
+
* }
|
|
7103
|
+
* ```
|
|
7104
|
+
*
|
|
7105
|
+
* @group Utils
|
|
7106
|
+
*/
|
|
7107
|
+
var Semaphore = /*#__PURE__*/function () {
|
|
7108
|
+
/**
|
|
7109
|
+
* @param limit - Maximum number of concurrent slots. Must be a finite
|
|
7110
|
+
* integer in `[1, 64]`; invalid values fall back to `1`.
|
|
7111
|
+
*/
|
|
7112
|
+
function Semaphore() {
|
|
7113
|
+
var _normalizeLimit;
|
|
7114
|
+
var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MIN_LIMIT;
|
|
7115
|
+
semaphore_classCallCheck(this, Semaphore);
|
|
7116
|
+
semaphore_defineProperty(this, "waiters", []);
|
|
7117
|
+
semaphore_defineProperty(this, "slotsInUse", 0);
|
|
7118
|
+
this.slotLimit = (_normalizeLimit = normalizeLimit(limit)) !== null && _normalizeLimit !== void 0 ? _normalizeLimit : MIN_LIMIT;
|
|
7119
|
+
}
|
|
7120
|
+
|
|
7121
|
+
/**
|
|
7122
|
+
* Maximum number of slots that can be acquired concurrently.
|
|
7123
|
+
*/
|
|
7124
|
+
return semaphore_createClass(Semaphore, [{
|
|
7125
|
+
key: "limit",
|
|
7126
|
+
get: function get() {
|
|
7127
|
+
return this.slotLimit;
|
|
7128
|
+
}
|
|
7129
|
+
|
|
7130
|
+
/**
|
|
7131
|
+
* Number of slots currently held by callers (acquired but not released).
|
|
7132
|
+
*/
|
|
7133
|
+
}, {
|
|
7134
|
+
key: "inUse",
|
|
7135
|
+
get: function get() {
|
|
7136
|
+
return this.slotsInUse;
|
|
7137
|
+
}
|
|
7138
|
+
|
|
7139
|
+
/**
|
|
7140
|
+
* Number of callers currently waiting for a slot.
|
|
7141
|
+
*/
|
|
7142
|
+
}, {
|
|
7143
|
+
key: "waiting",
|
|
7144
|
+
get: function get() {
|
|
7145
|
+
return this.waiters.length;
|
|
7146
|
+
}
|
|
7147
|
+
|
|
7148
|
+
/**
|
|
7149
|
+
* Acquire one slot. Resolves immediately if a slot is free; otherwise waits
|
|
7150
|
+
* in FIFO order until `release()` is called.
|
|
7151
|
+
*
|
|
7152
|
+
* Every successful `acquire()` must be paired with exactly one `release()`,
|
|
7153
|
+
* typically from a `finally` block. If the promise rejects (e.g. the optional
|
|
7154
|
+
* `signal` aborts while queued) no slot was granted, so `release()` must NOT
|
|
7155
|
+
* be called.
|
|
7156
|
+
*
|
|
7157
|
+
* @param signal - Optional `AbortSignal`. If it aborts while the caller is
|
|
7158
|
+
* still queued, the waiter is removed from the queue and the promise rejects
|
|
7159
|
+
* with an `AbortError`, so cancelled work never occupies a slot.
|
|
7160
|
+
* @returns A promise that resolves once a slot has been granted.
|
|
7161
|
+
*/
|
|
7162
|
+
}, {
|
|
7163
|
+
key: "acquire",
|
|
7164
|
+
value: function acquire(signal) {
|
|
7165
|
+
var _this = this;
|
|
7166
|
+
if (signal !== null && signal !== void 0 && signal.aborted) {
|
|
7167
|
+
return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
7168
|
+
}
|
|
7169
|
+
if (this.slotsInUse < this.slotLimit) {
|
|
7170
|
+
this.slotsInUse++;
|
|
7171
|
+
return Promise.resolve();
|
|
7172
|
+
}
|
|
7173
|
+
return new Promise(function (resolve, reject) {
|
|
7174
|
+
var waiter = function waiter() {
|
|
7175
|
+
_this.slotsInUse++;
|
|
7176
|
+
resolve();
|
|
7177
|
+
};
|
|
7178
|
+
_this.waiters.push(waiter);
|
|
7179
|
+
if (signal) {
|
|
7180
|
+
signal.addEventListener("abort", function () {
|
|
7181
|
+
var index = _this.waiters.indexOf(waiter);
|
|
7182
|
+
if (index !== -1) {
|
|
7183
|
+
_this.waiters.splice(index, 1);
|
|
7184
|
+
reject(new DOMException("Aborted", "AbortError"));
|
|
7185
|
+
}
|
|
7186
|
+
}, {
|
|
7187
|
+
once: true
|
|
7188
|
+
});
|
|
7189
|
+
}
|
|
7190
|
+
});
|
|
7191
|
+
}
|
|
7192
|
+
|
|
7193
|
+
/**
|
|
7194
|
+
* Release one slot, waking the next FIFO waiter only when a slot was actually
|
|
7195
|
+
* freed.
|
|
7196
|
+
*
|
|
7197
|
+
* Safe to call even when no slots are in use: it is a true no-op in that case,
|
|
7198
|
+
* so cleanup code in `finally` blocks is defensive against double-releases and
|
|
7199
|
+
* a stray release can never admit a waiter beyond {@link limit}.
|
|
7200
|
+
*/
|
|
7201
|
+
}, {
|
|
7202
|
+
key: "release",
|
|
7203
|
+
value: function release() {
|
|
7204
|
+
if (this.slotsInUse > 0) {
|
|
7205
|
+
this.slotsInUse--;
|
|
7206
|
+
var next = this.waiters.shift();
|
|
7207
|
+
if (next) {
|
|
7208
|
+
next();
|
|
7209
|
+
}
|
|
7210
|
+
}
|
|
7211
|
+
}
|
|
7212
|
+
}]);
|
|
7213
|
+
}();
|
|
7037
7214
|
;// ./src/assets/icons.ts
|
|
7038
7215
|
var userLocationDataUrl = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20aria-hidden%3D%22false%22%20role%3D%22img%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%226%22%20fill%3D%22var(--icon-fill%2C%20%23007aff)%22%20stroke%3D%22var(--icon-stroke%2C%20%23ffffff)%22%20stroke-width%3D%222%22/%3E%3C/svg%3E";
|
|
7039
7216
|
|
|
@@ -7046,7 +7223,7 @@ var userLocationDataUrl = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w
|
|
|
7046
7223
|
* Generates a data URL for the route animation icon SVG with customizable appearance.
|
|
7047
7224
|
*
|
|
7048
7225
|
* @param config - Optional configuration for the icon appearance.
|
|
7049
|
-
* @param config.backgroundColor - The background color of the circle (default: "#
|
|
7226
|
+
* @param config.backgroundColor - The background color of the circle (default: "#276EF1").
|
|
7050
7227
|
* @param config.arrowColor - The color of the arrow (default: "#FFFFFF").
|
|
7051
7228
|
* @param config.arrowWidth - The stroke width of the arrow path in pixels (default: 0).
|
|
7052
7229
|
* @param config.borderWidth - The border width of the circle in pixels (default: 0).
|
|
@@ -7078,7 +7255,7 @@ var userLocationDataUrl = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w
|
|
|
7078
7255
|
*/
|
|
7079
7256
|
function createRouteAnimationIconDataUrl(config) {
|
|
7080
7257
|
var _config$backgroundCol, _config$arrowColor, _config$arrowWidth, _config$borderWidth, _config$borderColor, _config$blur;
|
|
7081
|
-
var backgroundColor = (_config$backgroundCol = config === null || config === void 0 ? void 0 : config.backgroundColor) !== null && _config$backgroundCol !== void 0 ? _config$backgroundCol : "#
|
|
7258
|
+
var backgroundColor = (_config$backgroundCol = config === null || config === void 0 ? void 0 : config.backgroundColor) !== null && _config$backgroundCol !== void 0 ? _config$backgroundCol : "#276EF1";
|
|
7082
7259
|
var arrowColor = (_config$arrowColor = config === null || config === void 0 ? void 0 : config.arrowColor) !== null && _config$arrowColor !== void 0 ? _config$arrowColor : "#FFFFFF";
|
|
7083
7260
|
var arrowWidth = (_config$arrowWidth = config === null || config === void 0 ? void 0 : config.arrowWidth) !== null && _config$arrowWidth !== void 0 ? _config$arrowWidth : 0;
|
|
7084
7261
|
var borderWidth = (_config$borderWidth = config === null || config === void 0 ? void 0 : config.borderWidth) !== null && _config$borderWidth !== void 0 ? _config$borderWidth : 0;
|
|
@@ -7097,7 +7274,7 @@ function createRouteAnimationIconDataUrl(config) {
|
|
|
7097
7274
|
var filterId = blur > 0 ? "blurFilter" : "";
|
|
7098
7275
|
var filterDef = blur > 0 ? "<defs><filter id=\"".concat(filterId, "\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"").concat(blur, "\"/></filter></defs>") : "";
|
|
7099
7276
|
var filterAttr = blur > 0 ? "filter=\"url(#".concat(filterId, ")\"") : "";
|
|
7100
|
-
var svg = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0
|
|
7277
|
+
var svg = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 30 30\" style=\"enable-background:new 0 0 30 30;\" xml:space=\"preserve\">\n".concat(filterDef, "\n<g ").concat(filterAttr, ">\n\t<circle cx=\"15\" cy=\"15\" r=\"15\" style=\"").concat(circleStyle).concat(circleStroke, "\"/>\n\t<path style=\"").concat(arrowStyle).concat(arrowStroke, "\" d=\"M16.4471 7.26386C16.2568 6.80696 15.808 6.51052 15.3131 6.51052C14.8181 6.51052 14.3693 6.80696 14.179 7.26386L8.52211 20.7533C8.29366 21.2972 8.48404 21.9227 8.97085 22.2518C9.45767 22.5809 10.1104 22.5156 10.5265 22.0995L15.3131 17.3129L20.0996 22.0995C20.5157 22.5156 21.1657 22.5782 21.6553 22.2518C22.1448 21.9254 22.3325 21.2972 22.104 20.7533L16.4471 7.26386Z\"/>\n</g>\n</svg>");
|
|
7101
7278
|
|
|
7102
7279
|
// Encode the SVG as a data URL
|
|
7103
7280
|
var encodedSvg = encodeURIComponent(svg);
|
|
@@ -7105,7 +7282,7 @@ function createRouteAnimationIconDataUrl(config) {
|
|
|
7105
7282
|
}
|
|
7106
7283
|
|
|
7107
7284
|
/**
|
|
7108
|
-
* Default route animation icon data URL with blue background (#
|
|
7285
|
+
* Default route animation icon data URL with blue background (#276EF1) and white arrow (#FFFFFF).
|
|
7109
7286
|
* This constant is maintained for backward compatibility.
|
|
7110
7287
|
*
|
|
7111
7288
|
* @example
|
|
@@ -7227,6 +7404,10 @@ function getBoundingBox(points) {
|
|
|
7227
7404
|
return [southwest, northeast];
|
|
7228
7405
|
}
|
|
7229
7406
|
;// ./src/domain/models/marker.ts
|
|
7407
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || marker_unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
7408
|
+
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."); }
|
|
7409
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
7410
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return marker_arrayLikeToArray(r); }
|
|
7230
7411
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7231
7412
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == marker_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7232
7413
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
@@ -7235,6 +7416,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
7235
7416
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
7236
7417
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
7237
7418
|
function marker_typeof(o) { "@babel/helpers - typeof"; return marker_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; }, marker_typeof(o); }
|
|
7419
|
+
function marker_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = marker_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; } } }; }
|
|
7420
|
+
function marker_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return marker_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) ? marker_arrayLikeToArray(r, a) : void 0; } }
|
|
7421
|
+
function marker_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; }
|
|
7238
7422
|
function marker_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
7239
7423
|
function marker_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, marker_toPropertyKey(o.key), o); } }
|
|
7240
7424
|
function marker_createClass(e, r, t) { return r && marker_defineProperties(e.prototype, r), t && marker_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -7338,82 +7522,104 @@ var MarkerUtils = /*#__PURE__*/function () {
|
|
|
7338
7522
|
* ```
|
|
7339
7523
|
*/
|
|
7340
7524
|
function createMarkerElement(marker) {
|
|
7341
|
-
var _marker$iconPropertie, _marker$iconPropertie2, _marker$iconPropertie3, _marker$iconPropertie4;
|
|
7342
7525
|
var markerContainer = document.createElement("div");
|
|
7343
|
-
|
|
7344
|
-
// Configure specific marker dimensions
|
|
7345
|
-
var iconWidth = (_marker$iconPropertie = (_marker$iconPropertie2 = marker.iconProperties) === null || _marker$iconPropertie2 === void 0 ? void 0 : _marker$iconPropertie2.width) !== null && _marker$iconPropertie !== void 0 ? _marker$iconPropertie : 40;
|
|
7346
|
-
var iconHeight = (_marker$iconPropertie3 = (_marker$iconPropertie4 = marker.iconProperties) === null || _marker$iconPropertie4 === void 0 ? void 0 : _marker$iconPropertie4.height) !== null && _marker$iconPropertie3 !== void 0 ? _marker$iconPropertie3 : 40;
|
|
7347
|
-
|
|
7348
|
-
// Apply base class
|
|
7349
7526
|
markerContainer.className = "mapvx-marker";
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
markerContainer.classList.add("text-column");
|
|
7358
|
-
markerContainer.style.width = "".concat(Math.max(iconWidth, 200), "px");
|
|
7359
|
-
markerContainer.style.height = "auto";
|
|
7360
|
-
break;
|
|
7361
|
-
case TextPosition.left:
|
|
7362
|
-
case TextPosition.right:
|
|
7363
|
-
default:
|
|
7364
|
-
markerContainer.classList.add("text-row");
|
|
7365
|
-
markerContainer.style.width = "auto";
|
|
7366
|
-
markerContainer.style.height = "".concat(iconHeight, "px");
|
|
7367
|
-
break;
|
|
7527
|
+
this.applyContainerLayout(markerContainer, marker);
|
|
7528
|
+
var _iterator = marker_createForOfIteratorHelper(this.createMarkerChildren(marker)),
|
|
7529
|
+
_step;
|
|
7530
|
+
try {
|
|
7531
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
7532
|
+
var child = _step.value;
|
|
7533
|
+
markerContainer.appendChild(child);
|
|
7368
7534
|
}
|
|
7369
|
-
}
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
markerContainer.style.height = "".concat(iconHeight, "px");
|
|
7374
|
-
}
|
|
7375
|
-
markerContainer.addEventListener("click", function () {
|
|
7376
|
-
var _marker$onClick;
|
|
7377
|
-
(_marker$onClick = marker.onClick) === null || _marker$onClick === void 0 || _marker$onClick.call(marker);
|
|
7378
|
-
});
|
|
7379
|
-
if (marker.element) {
|
|
7380
|
-
markerContainer.appendChild(marker.element);
|
|
7381
|
-
return this.setAndCreateText(marker, markerContainer, "".concat(iconHeight, "px"), "".concat(iconWidth, "px"));
|
|
7535
|
+
} catch (err) {
|
|
7536
|
+
_iterator.e(err);
|
|
7537
|
+
} finally {
|
|
7538
|
+
_iterator.f();
|
|
7382
7539
|
}
|
|
7540
|
+
return markerContainer;
|
|
7541
|
+
}
|
|
7383
7542
|
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7543
|
+
/**
|
|
7544
|
+
* Applies the marker container's own classes and box size from a config.
|
|
7545
|
+
* Shared by {@link createMarkerElement} and {@link MarkerAttribute.updateIcon}
|
|
7546
|
+
* so create and update stay in sync (single source of truth for which state
|
|
7547
|
+
* classes exist and how the anchored box is sized). It is idempotent, so it
|
|
7548
|
+
* also resets stale state when reused to update an existing element.
|
|
7549
|
+
*
|
|
7550
|
+
* @param container - The `.mapvx-marker` element to configure
|
|
7551
|
+
* @param marker - Marker configuration
|
|
7552
|
+
*/
|
|
7553
|
+
}, {
|
|
7554
|
+
key: "applyContainerLayout",
|
|
7555
|
+
value: function applyContainerLayout(container, marker) {
|
|
7556
|
+
// Reset the state classes we own (no-op on a fresh element).
|
|
7557
|
+
container.classList.remove("no-text", "interactive");
|
|
7387
7558
|
|
|
7388
|
-
//
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7559
|
+
// The container box equals the icon box so the out-of-flow label never
|
|
7560
|
+
// displaces the icon from the coordinate MapLibre anchors. A caller-
|
|
7561
|
+
// provided `element` owns its own size, so we let the box size to it.
|
|
7562
|
+
if (marker.element) {
|
|
7563
|
+
container.style.width = "";
|
|
7564
|
+
container.style.height = "";
|
|
7392
7565
|
} else {
|
|
7393
|
-
|
|
7394
|
-
|
|
7566
|
+
var _marker$iconPropertie, _marker$iconPropertie2, _marker$iconPropertie3, _marker$iconPropertie4;
|
|
7567
|
+
var iconWidth = (_marker$iconPropertie = (_marker$iconPropertie2 = marker.iconProperties) === null || _marker$iconPropertie2 === void 0 ? void 0 : _marker$iconPropertie2.width) !== null && _marker$iconPropertie !== void 0 ? _marker$iconPropertie : 40;
|
|
7568
|
+
var iconHeight = (_marker$iconPropertie3 = (_marker$iconPropertie4 = marker.iconProperties) === null || _marker$iconPropertie4 === void 0 ? void 0 : _marker$iconPropertie4.height) !== null && _marker$iconPropertie3 !== void 0 ? _marker$iconPropertie3 : 40;
|
|
7569
|
+
container.style.width = "".concat(iconWidth, "px");
|
|
7570
|
+
container.style.height = "".concat(iconHeight, "px");
|
|
7571
|
+
}
|
|
7572
|
+
if (!marker.text) {
|
|
7573
|
+
container.classList.add("no-text");
|
|
7574
|
+
}
|
|
7575
|
+
|
|
7576
|
+
// Only flag the marker interactive when it actually handles clicks: this
|
|
7577
|
+
// flips the out-of-flow label's pointer-events to auto (see styles.css)
|
|
7578
|
+
// so the label is hit-testable, while non-clickable labels stay
|
|
7579
|
+
// click-through and never block the map.
|
|
7580
|
+
if (marker.onClick) {
|
|
7581
|
+
container.classList.add("interactive");
|
|
7395
7582
|
}
|
|
7396
|
-
return markerContainer;
|
|
7397
7583
|
}
|
|
7398
7584
|
|
|
7399
7585
|
/**
|
|
7400
|
-
*
|
|
7586
|
+
* Builds the in-order children for a marker container: the icon (or the
|
|
7587
|
+
* caller-provided element) followed by the optional out-of-flow label. DOM
|
|
7588
|
+
* order is irrelevant for placement — the .text-container position classes
|
|
7589
|
+
* (top/bottom/left/right) lay the label out around the icon.
|
|
7401
7590
|
*
|
|
7402
|
-
* @param
|
|
7403
|
-
* @
|
|
7404
|
-
* @param iconHeight - Height of the icon for positioning calculations
|
|
7405
|
-
* @param iconWidth - Width of the icon for positioning calculations
|
|
7406
|
-
* @returns Container element with properly positioned text
|
|
7591
|
+
* @param marker - Marker configuration
|
|
7592
|
+
* @returns The child elements to append to the container
|
|
7407
7593
|
*/
|
|
7408
7594
|
}, {
|
|
7409
|
-
key: "
|
|
7410
|
-
value: function
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7595
|
+
key: "createMarkerChildren",
|
|
7596
|
+
value: function createMarkerChildren(marker) {
|
|
7597
|
+
var children = [];
|
|
7598
|
+
if (marker.element) {
|
|
7599
|
+
children.push(marker.element);
|
|
7600
|
+
} else {
|
|
7601
|
+
var _marker$iconPropertie5, _marker$iconPropertie6, _marker$iconPropertie7, _marker$iconPropertie8;
|
|
7602
|
+
var iconWidth = (_marker$iconPropertie5 = (_marker$iconPropertie6 = marker.iconProperties) === null || _marker$iconPropertie6 === void 0 ? void 0 : _marker$iconPropertie6.width) !== null && _marker$iconPropertie5 !== void 0 ? _marker$iconPropertie5 : 40;
|
|
7603
|
+
var iconHeight = (_marker$iconPropertie7 = (_marker$iconPropertie8 = marker.iconProperties) === null || _marker$iconPropertie8 === void 0 ? void 0 : _marker$iconPropertie8.height) !== null && _marker$iconPropertie7 !== void 0 ? _marker$iconPropertie7 : 40;
|
|
7604
|
+
children.push(this.createIconElement(marker, iconWidth, iconHeight));
|
|
7605
|
+
}
|
|
7606
|
+
if (marker.text) {
|
|
7607
|
+
children.push(this.buildTextContainer(marker));
|
|
7415
7608
|
}
|
|
7416
|
-
return
|
|
7609
|
+
return children;
|
|
7610
|
+
}
|
|
7611
|
+
|
|
7612
|
+
/**
|
|
7613
|
+
* Builds the positioned label container for a marker.
|
|
7614
|
+
*
|
|
7615
|
+
* @param marker - Marker configuration; `text` is assumed to be set
|
|
7616
|
+
* @returns The `.text-container` element ready to append
|
|
7617
|
+
*/
|
|
7618
|
+
}, {
|
|
7619
|
+
key: "buildTextContainer",
|
|
7620
|
+
value: function buildTextContainer(marker) {
|
|
7621
|
+
var textElement = typeof marker.text === "string" ? this.createTextElement(marker.text, marker.textProperties) : marker.text;
|
|
7622
|
+
return this.createTextContainer(textElement, marker.textPosition);
|
|
7417
7623
|
}
|
|
7418
7624
|
|
|
7419
7625
|
/**
|
|
@@ -7447,7 +7653,8 @@ var MarkerUtils = /*#__PURE__*/function () {
|
|
|
7447
7653
|
|
|
7448
7654
|
/**
|
|
7449
7655
|
* Creates a text container with proper positioning using CSS classes.
|
|
7450
|
-
*
|
|
7656
|
+
* The container is absolutely positioned (out of flow) so the label
|
|
7657
|
+
* never grows the marker's anchored box.
|
|
7451
7658
|
*
|
|
7452
7659
|
* @param textElement - The text element to contain
|
|
7453
7660
|
* @param textPosition - Desired position relative to the icon
|
|
@@ -7499,11 +7706,11 @@ var MarkerUtils = /*#__PURE__*/function () {
|
|
|
7499
7706
|
}, {
|
|
7500
7707
|
key: "createIcon",
|
|
7501
7708
|
value: function createIcon(marker) {
|
|
7502
|
-
var _marker$
|
|
7709
|
+
var _marker$iconPropertie9, _marker$iconPropertie0, _marker$iconPropertie1, _marker$iconPropertie10;
|
|
7503
7710
|
var image = document.createElement("img");
|
|
7504
7711
|
image.src = typeof marker.icon == "string" ? marker.icon : "";
|
|
7505
|
-
image.width = (_marker$
|
|
7506
|
-
image.height = (_marker$
|
|
7712
|
+
image.width = (_marker$iconPropertie9 = (_marker$iconPropertie0 = marker.iconProperties) === null || _marker$iconPropertie0 === void 0 ? void 0 : _marker$iconPropertie0.width) !== null && _marker$iconPropertie9 !== void 0 ? _marker$iconPropertie9 : 40;
|
|
7713
|
+
image.height = (_marker$iconPropertie1 = (_marker$iconPropertie10 = marker.iconProperties) === null || _marker$iconPropertie10 === void 0 ? void 0 : _marker$iconPropertie10.height) !== null && _marker$iconPropertie1 !== void 0 ? _marker$iconPropertie1 : 40;
|
|
7507
7714
|
image.style.objectFit = "contain";
|
|
7508
7715
|
image.style.filter = "drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))";
|
|
7509
7716
|
return image;
|
|
@@ -7572,6 +7779,12 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
|
|
|
7572
7779
|
* Used for indoor navigation and floor-specific marker management.
|
|
7573
7780
|
*/
|
|
7574
7781
|
|
|
7782
|
+
/**
|
|
7783
|
+
* Current click handler for the marker. Stored on the instance (rather than
|
|
7784
|
+
* captured in the DOM listener's closure) so {@link updateIcon} can swap it
|
|
7785
|
+
* without leaving the original handler attached to MapLibre's element.
|
|
7786
|
+
*/
|
|
7787
|
+
|
|
7575
7788
|
/**
|
|
7576
7789
|
* Constructs a new `MarkerAttribute` object with the specified properties.
|
|
7577
7790
|
*
|
|
@@ -7597,6 +7810,14 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
|
|
|
7597
7810
|
anchor: (_markerConfig$anchor = markerConfig.anchor) !== null && _markerConfig$anchor !== void 0 ? _markerConfig$anchor : "center",
|
|
7598
7811
|
offset: [0, 0]
|
|
7599
7812
|
}]);
|
|
7813
|
+
|
|
7814
|
+
// Route clicks through an instance-level handler so the latest onClick is
|
|
7815
|
+
// always invoked, even after updateIcon replaces the marker content.
|
|
7816
|
+
_this._userOnClick = markerConfig.onClick;
|
|
7817
|
+
_this._element.addEventListener("click", function () {
|
|
7818
|
+
var _this$_userOnClick, _this2;
|
|
7819
|
+
return (_this$_userOnClick = (_this2 = _this)._userOnClick) === null || _this$_userOnClick === void 0 ? void 0 : _this$_userOnClick.call(_this2);
|
|
7820
|
+
});
|
|
7600
7821
|
_this.setLngLat([markerConfig.coordinate.lng, markerConfig.coordinate.lat]);
|
|
7601
7822
|
_this.setRotationAlignment((_markerConfig$rotatio = markerConfig.rotationAlignment) !== null && _markerConfig$rotatio !== void 0 ? _markerConfig$rotatio : "viewport");
|
|
7602
7823
|
_this.setPitchAlignment("viewport");
|
|
@@ -7644,19 +7865,16 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
|
|
|
7644
7865
|
}, {
|
|
7645
7866
|
key: "updateIcon",
|
|
7646
7867
|
value: function updateIcon(marker) {
|
|
7647
|
-
var _marker$rotationAlign;
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
oldMarkerContent === null || oldMarkerContent === void 0 || (_oldMarkerContent$par = oldMarkerContent.parentElement) === null || _oldMarkerContent$par === void 0 || _oldMarkerContent$par.replaceChild(newMarkerContent, oldMarkerContent);
|
|
7658
|
-
}
|
|
7659
|
-
}
|
|
7868
|
+
var _this$_element, _marker$rotationAlign;
|
|
7869
|
+
// Reconfigure the element MapLibre already holds in place, rather than
|
|
7870
|
+
// building a throwaway element and grafting pieces of it. MapLibre owns the
|
|
7871
|
+
// element's other classes and inline styles (transform, position), which
|
|
7872
|
+
// must survive the update; we only reset our own classes/size and swap the
|
|
7873
|
+
// children. Both create and update go through the same MarkerUtils helpers,
|
|
7874
|
+
// so they cannot drift apart.
|
|
7875
|
+
MarkerUtils.applyContainerLayout(this._element, marker);
|
|
7876
|
+
(_this$_element = this._element).replaceChildren.apply(_this$_element, _toConsumableArray(MarkerUtils.createMarkerChildren(marker)));
|
|
7877
|
+
this._userOnClick = marker.onClick;
|
|
7660
7878
|
this.setRotationAlignment((_marker$rotationAlign = marker.rotationAlignment) !== null && _marker$rotationAlign !== void 0 ? _marker$rotationAlign : "viewport");
|
|
7661
7879
|
this.setPitchAlignment("viewport");
|
|
7662
7880
|
if (typeof marker.rotation === "number") {
|
|
@@ -7735,9 +7953,55 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
|
|
|
7735
7953
|
} else {
|
|
7736
7954
|
this.hide();
|
|
7737
7955
|
}
|
|
7738
|
-
}
|
|
7739
|
-
}]);
|
|
7740
|
-
}(maplibre_gl.Marker);
|
|
7956
|
+
}
|
|
7957
|
+
}]);
|
|
7958
|
+
}(maplibre_gl.Marker);
|
|
7959
|
+
;// ./src/domain/models/routeInstance.ts
|
|
7960
|
+
/**
|
|
7961
|
+
* Represents the conditions for the step animation.
|
|
7962
|
+
* @group Routes
|
|
7963
|
+
*/
|
|
7964
|
+
|
|
7965
|
+
/**
|
|
7966
|
+
* Represents a single route instance on the map with its own
|
|
7967
|
+
* MapLibre sources/layers, GeoJSON data, animation state, and marker.
|
|
7968
|
+
* @group Routes
|
|
7969
|
+
*/
|
|
7970
|
+
|
|
7971
|
+
/**
|
|
7972
|
+
* Creates a new RouteInstance from a route.
|
|
7973
|
+
* Each instance gets unique MapLibre source/layer IDs based on the route's UUID.
|
|
7974
|
+
* @param route The route to create an instance for.
|
|
7975
|
+
* @returns A new RouteInstance with initialized GeoJSON data structures.
|
|
7976
|
+
* @group Routes
|
|
7977
|
+
*/
|
|
7978
|
+
function createRouteInstance(route) {
|
|
7979
|
+
return {
|
|
7980
|
+
id: route.id,
|
|
7981
|
+
route: route,
|
|
7982
|
+
aheadId: "AHEAD_".concat(route.id),
|
|
7983
|
+
behindId: "BEHIND_".concat(route.id),
|
|
7984
|
+
currentId: "CURRENT_".concat(route.id),
|
|
7985
|
+
aheadSourceData: {
|
|
7986
|
+
type: "FeatureCollection",
|
|
7987
|
+
features: []
|
|
7988
|
+
},
|
|
7989
|
+
behindSourceData: {
|
|
7990
|
+
type: "FeatureCollection",
|
|
7991
|
+
features: []
|
|
7992
|
+
},
|
|
7993
|
+
currentSourceData: {
|
|
7994
|
+
type: "Feature",
|
|
7995
|
+
properties: {},
|
|
7996
|
+
geometry: {
|
|
7997
|
+
type: "LineString",
|
|
7998
|
+
coordinates: []
|
|
7999
|
+
}
|
|
8000
|
+
},
|
|
8001
|
+
animationStatus: "NO_ROUTE",
|
|
8002
|
+
stepAnimationStatus: "NO_ROUTE"
|
|
8003
|
+
};
|
|
8004
|
+
}
|
|
7741
8005
|
;// ./src/utils/nav-functions.ts
|
|
7742
8006
|
function nav_functions_typeof(o) { "@babel/helpers - typeof"; return nav_functions_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; }, nav_functions_typeof(o); }
|
|
7743
8007
|
function nav_functions_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -7917,60 +8181,14 @@ var NavFunctions = /*#__PURE__*/function () {
|
|
|
7917
8181
|
* The radius of the Earth in meters.
|
|
7918
8182
|
*/
|
|
7919
8183
|
nav_functions_defineProperty(NavFunctions, "EARTH_RADIUS", 6378000);
|
|
7920
|
-
;// ./src/domain/models/routeInstance.ts
|
|
7921
|
-
/**
|
|
7922
|
-
* Represents the conditions for the step animation.
|
|
7923
|
-
* @group Routes
|
|
7924
|
-
*/
|
|
7925
|
-
|
|
7926
|
-
/**
|
|
7927
|
-
* Represents a single route instance on the map with its own
|
|
7928
|
-
* MapLibre sources/layers, GeoJSON data, animation state, and marker.
|
|
7929
|
-
* @group Routes
|
|
7930
|
-
*/
|
|
7931
|
-
|
|
7932
|
-
/**
|
|
7933
|
-
* Creates a new RouteInstance from a route.
|
|
7934
|
-
* Each instance gets unique MapLibre source/layer IDs based on the route's UUID.
|
|
7935
|
-
* @param route The route to create an instance for.
|
|
7936
|
-
* @returns A new RouteInstance with initialized GeoJSON data structures.
|
|
7937
|
-
* @group Routes
|
|
7938
|
-
*/
|
|
7939
|
-
function createRouteInstance(route) {
|
|
7940
|
-
return {
|
|
7941
|
-
id: route.id,
|
|
7942
|
-
route: route,
|
|
7943
|
-
aheadId: "AHEAD_".concat(route.id),
|
|
7944
|
-
behindId: "BEHIND_".concat(route.id),
|
|
7945
|
-
currentId: "CURRENT_".concat(route.id),
|
|
7946
|
-
aheadSourceData: {
|
|
7947
|
-
type: "FeatureCollection",
|
|
7948
|
-
features: []
|
|
7949
|
-
},
|
|
7950
|
-
behindSourceData: {
|
|
7951
|
-
type: "FeatureCollection",
|
|
7952
|
-
features: []
|
|
7953
|
-
},
|
|
7954
|
-
currentSourceData: {
|
|
7955
|
-
type: "Feature",
|
|
7956
|
-
properties: {},
|
|
7957
|
-
geometry: {
|
|
7958
|
-
type: "LineString",
|
|
7959
|
-
coordinates: []
|
|
7960
|
-
}
|
|
7961
|
-
},
|
|
7962
|
-
animationStatus: "NO_ROUTE",
|
|
7963
|
-
stepAnimationStatus: "NO_ROUTE"
|
|
7964
|
-
};
|
|
7965
|
-
}
|
|
7966
8184
|
;// ./src/controllers/routeController.ts
|
|
7967
8185
|
function routeController_typeof(o) { "@babel/helpers - typeof"; return routeController_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; }, routeController_typeof(o); }
|
|
7968
8186
|
function routeController_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; }
|
|
7969
8187
|
function routeController_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? routeController_ownKeys(Object(t), !0).forEach(function (r) { routeController_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : routeController_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7970
|
-
function
|
|
7971
|
-
function
|
|
7972
|
-
function
|
|
7973
|
-
function
|
|
8188
|
+
function routeController_toConsumableArray(r) { return routeController_arrayWithoutHoles(r) || routeController_iterableToArray(r) || routeController_unsupportedIterableToArray(r) || routeController_nonIterableSpread(); }
|
|
8189
|
+
function routeController_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."); }
|
|
8190
|
+
function routeController_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
8191
|
+
function routeController_arrayWithoutHoles(r) { if (Array.isArray(r)) return routeController_arrayLikeToArray(r); }
|
|
7974
8192
|
function routeController_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = routeController_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; } } }; }
|
|
7975
8193
|
function routeController_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return routeController_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) ? routeController_arrayLikeToArray(r, a) : void 0; } }
|
|
7976
8194
|
function routeController_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; }
|
|
@@ -8345,7 +8563,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
8345
8563
|
throw new Error("Error: position array has different length than colors array");
|
|
8346
8564
|
}
|
|
8347
8565
|
var stops = createStops(positionsToUse, colors);
|
|
8348
|
-
var gradient = ["interpolate", ["linear"], ["line-progress"]].concat(
|
|
8566
|
+
var gradient = ["interpolate", ["linear"], ["line-progress"]].concat(routeController_toConsumableArray(stops));
|
|
8349
8567
|
return {
|
|
8350
8568
|
"line-color": null,
|
|
8351
8569
|
"line-gradient": gradient,
|
|
@@ -8592,7 +8810,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
8592
8810
|
this.removeSourcesAndLayersForRoute(instance);
|
|
8593
8811
|
this.routes["delete"](instance.id);
|
|
8594
8812
|
if (this.lastAddedRouteId === instance.id) {
|
|
8595
|
-
var remaining =
|
|
8813
|
+
var remaining = routeController_toConsumableArray(this.routes.keys());
|
|
8596
8814
|
this.lastAddedRouteId = remaining.length > 0 ? remaining[remaining.length - 1] : undefined;
|
|
8597
8815
|
}
|
|
8598
8816
|
}
|
|
@@ -8627,7 +8845,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
8627
8845
|
}, {
|
|
8628
8846
|
key: "getRouteIds",
|
|
8629
8847
|
value: function getRouteIds() {
|
|
8630
|
-
return
|
|
8848
|
+
return routeController_toConsumableArray(this.routes.keys());
|
|
8631
8849
|
}
|
|
8632
8850
|
}, {
|
|
8633
8851
|
key: "internalPause",
|
|
@@ -9136,6 +9354,27 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
9136
9354
|
return;
|
|
9137
9355
|
}
|
|
9138
9356
|
}
|
|
9357
|
+
if (step.startInsideFloor !== step.endInsideFloor) {
|
|
9358
|
+
if (waitStartTime == null) {
|
|
9359
|
+
instance.conditions.waitStartTime = timestamp;
|
|
9360
|
+
instance.conditions.animationId = requestAnimationFrame(function (time) {
|
|
9361
|
+
return _this8.animateStep(time, instance);
|
|
9362
|
+
});
|
|
9363
|
+
return;
|
|
9364
|
+
}
|
|
9365
|
+
if (timestamp - waitStartTime < changeFloorTime * 1000) {
|
|
9366
|
+
instance.conditions.animationId = requestAnimationFrame(function (time) {
|
|
9367
|
+
return _this8.animateStep(time, instance);
|
|
9368
|
+
});
|
|
9369
|
+
return;
|
|
9370
|
+
} else {
|
|
9371
|
+
this.updatePlaceFloorForRouting(instance, step.endInsidePlace, step.endInsideFloor);
|
|
9372
|
+
this.setMarkerLngLat(instance, step.endLocation);
|
|
9373
|
+
instance.conditions.waitStartTime = undefined;
|
|
9374
|
+
onFinish === null || onFinish === void 0 || onFinish(timestamp);
|
|
9375
|
+
return;
|
|
9376
|
+
}
|
|
9377
|
+
}
|
|
9139
9378
|
var distance = NavFunctions.distance(start, end);
|
|
9140
9379
|
var speed = Math.max(step.distance / stepTime, minimumSpeed !== null && minimumSpeed !== void 0 ? minimumSpeed : 0);
|
|
9141
9380
|
if (speed * progressInSeconds > distance) {
|
|
@@ -9161,26 +9400,6 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
9161
9400
|
return _this8.animateStep(time, instance);
|
|
9162
9401
|
});
|
|
9163
9402
|
return;
|
|
9164
|
-
} else if (step.startInsideFloor !== step.endInsideFloor) {
|
|
9165
|
-
if (waitStartTime == null) {
|
|
9166
|
-
instance.conditions.waitStartTime = timestamp;
|
|
9167
|
-
instance.conditions.animationId = requestAnimationFrame(function (time) {
|
|
9168
|
-
return _this8.animateStep(time, instance);
|
|
9169
|
-
});
|
|
9170
|
-
return;
|
|
9171
|
-
}
|
|
9172
|
-
if (timestamp - waitStartTime < changeFloorTime * 1000) {
|
|
9173
|
-
instance.conditions.animationId = requestAnimationFrame(function (time) {
|
|
9174
|
-
return _this8.animateStep(time, instance);
|
|
9175
|
-
});
|
|
9176
|
-
return;
|
|
9177
|
-
} else {
|
|
9178
|
-
this.updatePlaceFloorForRouting(instance, step.endInsidePlace, step.endInsideFloor);
|
|
9179
|
-
this.setMarkerLngLat(instance, step.endLocation);
|
|
9180
|
-
instance.conditions.waitStartTime = undefined;
|
|
9181
|
-
onFinish === null || onFinish === void 0 || onFinish(timestamp);
|
|
9182
|
-
return;
|
|
9183
|
-
}
|
|
9184
9403
|
} else {
|
|
9185
9404
|
onFinish === null || onFinish === void 0 || onFinish(timestamp);
|
|
9186
9405
|
return;
|
|
@@ -9314,9 +9533,10 @@ var InternalGetRouteConfiguration = /*#__PURE__*/routeConfiguration_createClass(
|
|
|
9314
9533
|
* @param language The language for the instructions.
|
|
9315
9534
|
* @param unitSystem The unit system used for the distance.
|
|
9316
9535
|
* @param announceFormat The format used to announce directions in the instructions.
|
|
9536
|
+
* @param userBearing The user's heading in degrees used as the reference direction for announcing turns.
|
|
9317
9537
|
*/
|
|
9318
9538
|
function InternalGetRouteConfiguration(config) {
|
|
9319
|
-
var _config$preferAccessi, _config$language, _config$unitSystem, _config$announceForma;
|
|
9539
|
+
var _config$preferAccessi, _config$language, _config$unitSystem, _config$announceForma, _config$userBearing;
|
|
9320
9540
|
routeConfiguration_classCallCheck(this, InternalGetRouteConfiguration);
|
|
9321
9541
|
this.initialLocation = config.initialLocation;
|
|
9322
9542
|
this.finalLocation = config.finalLocation;
|
|
@@ -9324,6 +9544,7 @@ function InternalGetRouteConfiguration(config) {
|
|
|
9324
9544
|
this.language = (_config$language = config.language) !== null && _config$language !== void 0 ? _config$language : "en";
|
|
9325
9545
|
this.unitSystem = (_config$unitSystem = config.unitSystem) !== null && _config$unitSystem !== void 0 ? _config$unitSystem : UnitSystem.metric;
|
|
9326
9546
|
this.announceFormat = (_config$announceForma = config.announceFormat) !== null && _config$announceForma !== void 0 ? _config$announceForma : AnnounceFormat.relative;
|
|
9547
|
+
this.userBearing = (_config$userBearing = config.userBearing) !== null && _config$userBearing !== void 0 ? _config$userBearing : 0;
|
|
9327
9548
|
});
|
|
9328
9549
|
|
|
9329
9550
|
/**
|
|
@@ -9354,6 +9575,16 @@ function InternalDrawRouteConfiguration(config) {
|
|
|
9354
9575
|
/**
|
|
9355
9576
|
* Interface that represent a place with their id.
|
|
9356
9577
|
* @group Routes
|
|
9578
|
+
* @example
|
|
9579
|
+
* ```typescript
|
|
9580
|
+
* // Resolve an internal alias that is reused across several malls by
|
|
9581
|
+
* // pinning the building (and, optionally, the floor) it belongs to.
|
|
9582
|
+
* const origin: IdLocation = {
|
|
9583
|
+
* id: "store-204", // integrator alias, may repeat across buildings
|
|
9584
|
+
* buildingId: "mall-santiago",
|
|
9585
|
+
* floorId: "level-2", // takes precedence over `level`
|
|
9586
|
+
* }
|
|
9587
|
+
* ```
|
|
9357
9588
|
*/
|
|
9358
9589
|
|
|
9359
9590
|
/**
|
|
@@ -9408,11 +9639,11 @@ var InternalAnimationDrawingConfig = /*#__PURE__*/function () {
|
|
|
9408
9639
|
animation_classCallCheck(this, InternalAnimationDrawingConfig);
|
|
9409
9640
|
this.aheadPathStyle = (_data$aheadPathStyle = data.aheadPathStyle) !== null && _data$aheadPathStyle !== void 0 ? _data$aheadPathStyle : {
|
|
9410
9641
|
type: "Solid",
|
|
9411
|
-
color: "#
|
|
9642
|
+
color: "#0C0C0C"
|
|
9412
9643
|
};
|
|
9413
9644
|
this.behindPathStyle = (_data$behindPathStyle = data.behindPathStyle) !== null && _data$behindPathStyle !== void 0 ? _data$behindPathStyle : {
|
|
9414
9645
|
type: "Solid",
|
|
9415
|
-
color: "#
|
|
9646
|
+
color: "#276EF1"
|
|
9416
9647
|
};
|
|
9417
9648
|
this.polylineWidth = (_data$polylineWidth = data.polylineWidth) !== null && _data$polylineWidth !== void 0 ? _data$polylineWidth : 10;
|
|
9418
9649
|
if (data.routeIcon != null) {
|
|
@@ -9566,7 +9797,8 @@ var Loggeable = /*#__PURE__*/function () {
|
|
|
9566
9797
|
* maxTiles: 500,
|
|
9567
9798
|
* ttlMs: 60 * 60 * 1000, // 1 hour
|
|
9568
9799
|
* persistToServiceWorker: true,
|
|
9569
|
-
* preloadAdjacentZooms: false
|
|
9800
|
+
* preloadAdjacentZooms: false,
|
|
9801
|
+
* maxConcurrentTileFetches: 6
|
|
9570
9802
|
* };
|
|
9571
9803
|
* ```
|
|
9572
9804
|
*
|
|
@@ -9583,9 +9815,19 @@ var DEFAULT_TILE_CACHE_CONFIG = {
|
|
|
9583
9815
|
ttlMs: 30 * 60 * 1000,
|
|
9584
9816
|
// 30 minutes
|
|
9585
9817
|
persistToServiceWorker: true,
|
|
9586
|
-
preloadAdjacentZooms: false
|
|
9818
|
+
preloadAdjacentZooms: false,
|
|
9819
|
+
maxConcurrentTileFetches: 6
|
|
9587
9820
|
};
|
|
9588
9821
|
|
|
9822
|
+
/**
|
|
9823
|
+
* Hard cap for {@link MapTileCacheConfig.maxTiles}.
|
|
9824
|
+
* Configurations above this (e.g. millions) are clamped to avoid memory pressure
|
|
9825
|
+
* and excessive interaction with the tile CDN / service worker.
|
|
9826
|
+
*
|
|
9827
|
+
* @internal
|
|
9828
|
+
*/
|
|
9829
|
+
var MAPLIBRE_MAX_TILE_CACHE_HARD_CAP = 100000;
|
|
9830
|
+
|
|
9589
9831
|
/**
|
|
9590
9832
|
* Basic configuration for the map.
|
|
9591
9833
|
* Provides essential settings for initializing and customizing map behavior.
|
|
@@ -9623,6 +9865,14 @@ var DEFAULT_TILE_CACHE_CONFIG = {
|
|
|
9623
9865
|
* @property showZoom - (Optional) Whether to display the zoom control.
|
|
9624
9866
|
* @property navigationPosition - (Optional) Position of the navigation controls on the map.
|
|
9625
9867
|
* @property bearingSnap - (Optional) The bearing snap threshold in degrees.
|
|
9868
|
+
* @property bearing - (Optional) Initial bearing (rotation) of the map in degrees, clockwise from north.
|
|
9869
|
+
* @property interactive - (Optional) Master switch for all user interaction (pan/zoom/rotate).
|
|
9870
|
+
* @property rotateEnabled - (Optional) Whether the user can rotate the map; keeps pinch-zoom when disabled.
|
|
9871
|
+
* @property dragPan - (Optional) Whether the user can pan by dragging/swiping.
|
|
9872
|
+
* @property scrollZoom - (Optional) Whether the scroll wheel/trackpad can zoom the map.
|
|
9873
|
+
* @property doubleClickZoom - (Optional) Whether double-click/double-tap zooms the map.
|
|
9874
|
+
* @property touchZoomRotate - (Optional) Whether pinch gestures can zoom the map on touch devices.
|
|
9875
|
+
* @property keyboard - (Optional) Whether keyboard shortcuts can pan/zoom/rotate the map.
|
|
9626
9876
|
* @property institutionId - (Optional) The institution identifier for map context. Required for loading map related data from Portal.
|
|
9627
9877
|
* @property authToken - (Optional) Authentication token for accessing protected map resources. Required for loading map related data from Portal.
|
|
9628
9878
|
* @property apiUrl - (Optional) Injected by SDK when creating map; base API URL for map requests.
|
|
@@ -11104,11 +11354,9 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11104
11354
|
// Ensure we have an absolute URL (required for new URL() in fetchFromUrl)
|
|
11105
11355
|
var withProtocol = apiUrl.startsWith("http://") || apiUrl.startsWith("https://") ? apiUrl : "https://".concat(apiUrl);
|
|
11106
11356
|
var cleanApiUrl = withProtocol.endsWith("/") ? withProtocol.slice(0, -1) : withProtocol;
|
|
11107
|
-
this.baseUrl = "".concat(cleanApiUrl, "/api/sdk/");
|
|
11108
|
-
this.baseUrlV2 = "".concat(cleanApiUrl, "/api/sdk/v2/");
|
|
11109
|
-
this.baseUrlApi = "".concat(cleanApiUrl, "/api/");
|
|
11357
|
+
this.baseUrl = "".concat(cleanApiUrl, "/api/sdk/v2/");
|
|
11110
11358
|
this.baseUrlPortal = "".concat(cleanApiUrl, "/api/portal/");
|
|
11111
|
-
this.baseUrlHealth = "https://api.mapvx.com/api/health
|
|
11359
|
+
this.baseUrlHealth = "https://api.mapvx.com/api/sdk/v2/health";
|
|
11112
11360
|
this.oldBaseUrl = "https://api.mapvx.com/api/sdk/";
|
|
11113
11361
|
this.routeBaseUrl = "https://api.mapvx.com/sdk/";
|
|
11114
11362
|
}
|
|
@@ -11201,11 +11449,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11201
11449
|
options = {
|
|
11202
11450
|
method: "GET",
|
|
11203
11451
|
headers: {
|
|
11204
|
-
"content-type": "application/json"
|
|
11452
|
+
"content-type": "application/json",
|
|
11453
|
+
Authorization: "Bearer ".concat(token)
|
|
11205
11454
|
}
|
|
11206
11455
|
};
|
|
11207
11456
|
params = {
|
|
11208
|
-
token: token,
|
|
11209
11457
|
stopId: stopId,
|
|
11210
11458
|
lang: this.lang
|
|
11211
11459
|
};
|
|
@@ -11237,11 +11485,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11237
11485
|
options = {
|
|
11238
11486
|
method: "GET",
|
|
11239
11487
|
headers: {
|
|
11240
|
-
"content-type": "application/json"
|
|
11488
|
+
"content-type": "application/json",
|
|
11489
|
+
Authorization: "Bearer ".concat(token)
|
|
11241
11490
|
}
|
|
11242
11491
|
};
|
|
11243
11492
|
params = {
|
|
11244
|
-
token: token,
|
|
11245
11493
|
stopId: stopId,
|
|
11246
11494
|
vehicleId: vehicleId,
|
|
11247
11495
|
lang: this.lang
|
|
@@ -11273,11 +11521,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11273
11521
|
options = {
|
|
11274
11522
|
method: "GET",
|
|
11275
11523
|
headers: {
|
|
11276
|
-
"content-type": "application/json"
|
|
11524
|
+
"content-type": "application/json",
|
|
11525
|
+
Authorization: "Bearer ".concat(token)
|
|
11277
11526
|
}
|
|
11278
11527
|
};
|
|
11279
11528
|
params = {
|
|
11280
|
-
token: token,
|
|
11281
11529
|
lang: this.lang
|
|
11282
11530
|
};
|
|
11283
11531
|
if (placeId != null) {
|
|
@@ -11350,11 +11598,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11350
11598
|
options = {
|
|
11351
11599
|
method: "GET",
|
|
11352
11600
|
headers: {
|
|
11353
|
-
"content-type": "application/json"
|
|
11601
|
+
"content-type": "application/json",
|
|
11602
|
+
Authorization: "Bearer ".concat(token)
|
|
11354
11603
|
}
|
|
11355
11604
|
};
|
|
11356
11605
|
params = {
|
|
11357
|
-
token: token,
|
|
11358
11606
|
lang: this.lang
|
|
11359
11607
|
};
|
|
11360
11608
|
return _context6.a(2, this.fetchFromUrl(this.baseUrl + "availablePlaces", params, options));
|
|
@@ -11423,11 +11671,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11423
11671
|
options = {
|
|
11424
11672
|
method: "GET",
|
|
11425
11673
|
headers: {
|
|
11426
|
-
"content-type": "application/json"
|
|
11674
|
+
"content-type": "application/json",
|
|
11675
|
+
Authorization: "Bearer ".concat(token)
|
|
11427
11676
|
}
|
|
11428
11677
|
};
|
|
11429
11678
|
params = {
|
|
11430
|
-
token: token,
|
|
11431
11679
|
place_id: placeId,
|
|
11432
11680
|
lang: this.lang
|
|
11433
11681
|
};
|
|
@@ -11497,11 +11745,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11497
11745
|
options = {
|
|
11498
11746
|
method: "GET",
|
|
11499
11747
|
headers: {
|
|
11500
|
-
"content-type": "application/json"
|
|
11748
|
+
"content-type": "application/json",
|
|
11749
|
+
Authorization: "Bearer ".concat(token)
|
|
11501
11750
|
}
|
|
11502
11751
|
};
|
|
11503
11752
|
params = {
|
|
11504
|
-
token: token,
|
|
11505
11753
|
targetPlace: targetPlaceId,
|
|
11506
11754
|
lang: this.lang
|
|
11507
11755
|
};
|
|
@@ -11555,72 +11803,118 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11555
11803
|
}
|
|
11556
11804
|
return fetchAnySubPlaces;
|
|
11557
11805
|
}()
|
|
11806
|
+
/**
|
|
11807
|
+
* Build the cleaned query parameters for a route request.
|
|
11808
|
+
*
|
|
11809
|
+
* Resolves both the origin (`from*`) and destination (`to*`) sides of the route
|
|
11810
|
+
* from the provided configuration. For {@link IdLocation} endpoints this also
|
|
11811
|
+
* forwards the building (`fromBuilding`/`toBuilding`) and floor
|
|
11812
|
+
* (`fromFloor`/`toFloor`) so internal aliases that are reused across buildings
|
|
11813
|
+
* can be disambiguated. Parameters that resolve to `null`/`undefined` are dropped.
|
|
11814
|
+
* @param routeConfig The route configuration to translate into query params.
|
|
11815
|
+
* @returns The cleaned query parameters ready to be appended to the request URL.
|
|
11816
|
+
*/
|
|
11817
|
+
)
|
|
11818
|
+
}, {
|
|
11819
|
+
key: "buildRouteParams",
|
|
11820
|
+
value: function buildRouteParams(routeConfig) {
|
|
11821
|
+
var params = {
|
|
11822
|
+
fromLatLng: undefined,
|
|
11823
|
+
fromBuilding: undefined,
|
|
11824
|
+
fromFloor: undefined,
|
|
11825
|
+
toLatLng: undefined,
|
|
11826
|
+
toBuilding: undefined,
|
|
11827
|
+
toFloor: undefined,
|
|
11828
|
+
fromPlaceId: undefined,
|
|
11829
|
+
toPlaceId: undefined,
|
|
11830
|
+
travelMode: TransportationMode.walking,
|
|
11831
|
+
reducedMobility: routeConfig.preferAccessibleRoute ? 1 : 0,
|
|
11832
|
+
announceFormat: routeConfig.announceFormat,
|
|
11833
|
+
userBearing: routeConfig.userBearing,
|
|
11834
|
+
lang: this.lang,
|
|
11835
|
+
unitSystem: routeConfig.unitSystem
|
|
11836
|
+
};
|
|
11837
|
+
if ("id" in routeConfig.initialLocation) {
|
|
11838
|
+
var _routeConfig$initialL = routeConfig.initialLocation,
|
|
11839
|
+
id = _routeConfig$initialL.id,
|
|
11840
|
+
buildingId = _routeConfig$initialL.buildingId,
|
|
11841
|
+
floorId = _routeConfig$initialL.floorId,
|
|
11842
|
+
level = _routeConfig$initialL.level;
|
|
11843
|
+
params.fromPlaceId = id;
|
|
11844
|
+
if (buildingId !== undefined) {
|
|
11845
|
+
params.fromBuilding = buildingId;
|
|
11846
|
+
}
|
|
11847
|
+
if (floorId !== undefined) {
|
|
11848
|
+
params.fromFloor = floorId;
|
|
11849
|
+
} else if (level !== undefined) {
|
|
11850
|
+
params.fromFloor = level;
|
|
11851
|
+
}
|
|
11852
|
+
} else {
|
|
11853
|
+
var _routeConfig$initialL2 = routeConfig.initialLocation,
|
|
11854
|
+
lat = _routeConfig$initialL2.lat,
|
|
11855
|
+
lng = _routeConfig$initialL2.lng,
|
|
11856
|
+
_floorId = _routeConfig$initialL2.floorId,
|
|
11857
|
+
placeId = _routeConfig$initialL2.placeId;
|
|
11858
|
+
params.fromLatLng = "".concat(lat, ",").concat(lng);
|
|
11859
|
+
params.fromFloor = _floorId;
|
|
11860
|
+
params.fromBuilding = placeId;
|
|
11861
|
+
}
|
|
11862
|
+
if ("id" in routeConfig.finalLocation) {
|
|
11863
|
+
var _routeConfig$finalLoc = routeConfig.finalLocation,
|
|
11864
|
+
_id = _routeConfig$finalLoc.id,
|
|
11865
|
+
_buildingId = _routeConfig$finalLoc.buildingId,
|
|
11866
|
+
_floorId2 = _routeConfig$finalLoc.floorId,
|
|
11867
|
+
_level = _routeConfig$finalLoc.level;
|
|
11868
|
+
params.toPlaceId = _id;
|
|
11869
|
+
if (_buildingId !== undefined) {
|
|
11870
|
+
params.toBuilding = _buildingId;
|
|
11871
|
+
}
|
|
11872
|
+
if (_floorId2 !== undefined) {
|
|
11873
|
+
params.toFloor = _floorId2;
|
|
11874
|
+
} else if (_level !== undefined) {
|
|
11875
|
+
params.toFloor = _level;
|
|
11876
|
+
}
|
|
11877
|
+
} else {
|
|
11878
|
+
var _routeConfig$finalLoc2 = routeConfig.finalLocation,
|
|
11879
|
+
_lat = _routeConfig$finalLoc2.lat,
|
|
11880
|
+
_lng = _routeConfig$finalLoc2.lng,
|
|
11881
|
+
_floorId3 = _routeConfig$finalLoc2.floorId,
|
|
11882
|
+
_placeId = _routeConfig$finalLoc2.placeId;
|
|
11883
|
+
params.toLatLng = "".concat(_lat, ",").concat(_lng);
|
|
11884
|
+
params.toFloor = _floorId3;
|
|
11885
|
+
params.toBuilding = _placeId;
|
|
11886
|
+
}
|
|
11887
|
+
var cleanParams = {};
|
|
11888
|
+
for (var key in params) {
|
|
11889
|
+
var value = params[key];
|
|
11890
|
+
if (value != null) {
|
|
11891
|
+
cleanParams[key] = value;
|
|
11892
|
+
}
|
|
11893
|
+
}
|
|
11894
|
+
return cleanParams;
|
|
11895
|
+
}
|
|
11896
|
+
|
|
11558
11897
|
/**
|
|
11559
11898
|
* To obtain the route
|
|
11560
11899
|
* @param routeConfig
|
|
11561
11900
|
* @returns
|
|
11562
11901
|
*/
|
|
11563
|
-
)
|
|
11564
11902
|
}, {
|
|
11565
11903
|
key: "fetchRoute",
|
|
11566
11904
|
value: (function () {
|
|
11567
11905
|
var _fetchRoute = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee10(routeConfig, token) {
|
|
11568
|
-
var options,
|
|
11906
|
+
var options, cleanParams;
|
|
11569
11907
|
return requester_regenerator().w(function (_context10) {
|
|
11570
11908
|
while (1) switch (_context10.n) {
|
|
11571
11909
|
case 0:
|
|
11572
11910
|
options = {
|
|
11573
11911
|
method: "GET",
|
|
11574
11912
|
headers: {
|
|
11575
|
-
"content-type": "application/json"
|
|
11913
|
+
"content-type": "application/json",
|
|
11914
|
+
Authorization: "Bearer ".concat(token)
|
|
11576
11915
|
}
|
|
11577
11916
|
};
|
|
11578
|
-
|
|
11579
|
-
fromLatLng: undefined,
|
|
11580
|
-
fromBuilding: undefined,
|
|
11581
|
-
fromFloor: undefined,
|
|
11582
|
-
toLatLng: undefined,
|
|
11583
|
-
toBuilding: undefined,
|
|
11584
|
-
toFloor: undefined,
|
|
11585
|
-
fromPlaceId: undefined,
|
|
11586
|
-
toPlaceId: undefined,
|
|
11587
|
-
travelMode: TransportationMode.walking,
|
|
11588
|
-
reducedMobility: routeConfig.preferAccessibleRoute ? 1 : 0,
|
|
11589
|
-
announceFormat: routeConfig.announceFormat,
|
|
11590
|
-
userBearing: 0,
|
|
11591
|
-
lang: this.lang,
|
|
11592
|
-
unitSystem: routeConfig.unitSystem,
|
|
11593
|
-
token: token
|
|
11594
|
-
};
|
|
11595
|
-
if ("id" in routeConfig.initialLocation) {
|
|
11596
|
-
params.fromPlaceId = routeConfig.initialLocation.id;
|
|
11597
|
-
if (routeConfig.initialLocation.level !== undefined) {
|
|
11598
|
-
params.fromFloor = routeConfig.initialLocation.level;
|
|
11599
|
-
}
|
|
11600
|
-
} else {
|
|
11601
|
-
_routeConfig$initialL = routeConfig.initialLocation, lat = _routeConfig$initialL.lat, lng = _routeConfig$initialL.lng, floorId = _routeConfig$initialL.floorId, placeId = _routeConfig$initialL.placeId;
|
|
11602
|
-
params.fromLatLng = "".concat(lat, ",").concat(lng);
|
|
11603
|
-
params.fromFloor = floorId;
|
|
11604
|
-
params.fromBuilding = placeId;
|
|
11605
|
-
}
|
|
11606
|
-
if ("id" in routeConfig.finalLocation) {
|
|
11607
|
-
params.toPlaceId = routeConfig.finalLocation.id;
|
|
11608
|
-
if (routeConfig.finalLocation.level !== undefined) {
|
|
11609
|
-
params.toFloor = routeConfig.finalLocation.level;
|
|
11610
|
-
}
|
|
11611
|
-
} else {
|
|
11612
|
-
_routeConfig$finalLoc = routeConfig.finalLocation, _lat = _routeConfig$finalLoc.lat, _lng = _routeConfig$finalLoc.lng, _floorId = _routeConfig$finalLoc.floorId, _placeId = _routeConfig$finalLoc.placeId;
|
|
11613
|
-
params.toLatLng = "".concat(_lat, ",").concat(_lng);
|
|
11614
|
-
params.toFloor = _floorId;
|
|
11615
|
-
params.toBuilding = _placeId;
|
|
11616
|
-
}
|
|
11617
|
-
cleanParams = {};
|
|
11618
|
-
for (key in params) {
|
|
11619
|
-
value = params[key];
|
|
11620
|
-
if (value != null) {
|
|
11621
|
-
cleanParams[key] = value;
|
|
11622
|
-
}
|
|
11623
|
-
}
|
|
11917
|
+
cleanParams = this.buildRouteParams(routeConfig);
|
|
11624
11918
|
return _context10.a(2, this.fetchFromUrl(this.routeBaseUrl + "route", cleanParams, options));
|
|
11625
11919
|
}
|
|
11626
11920
|
}, _callee10, this);
|
|
@@ -11640,62 +11934,18 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11640
11934
|
key: "fetchRouteV2",
|
|
11641
11935
|
value: (function () {
|
|
11642
11936
|
var _fetchRouteV = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee11(routeConfig, token) {
|
|
11643
|
-
var options,
|
|
11937
|
+
var options, cleanParams;
|
|
11644
11938
|
return requester_regenerator().w(function (_context11) {
|
|
11645
11939
|
while (1) switch (_context11.n) {
|
|
11646
11940
|
case 0:
|
|
11647
11941
|
options = {
|
|
11648
11942
|
method: "GET",
|
|
11649
11943
|
headers: {
|
|
11650
|
-
"content-type": "application/json"
|
|
11944
|
+
"content-type": "application/json",
|
|
11945
|
+
Authorization: "Bearer ".concat(token)
|
|
11651
11946
|
}
|
|
11652
11947
|
};
|
|
11653
|
-
|
|
11654
|
-
fromLatLng: undefined,
|
|
11655
|
-
fromBuilding: undefined,
|
|
11656
|
-
fromFloor: undefined,
|
|
11657
|
-
toLatLng: undefined,
|
|
11658
|
-
toBuilding: undefined,
|
|
11659
|
-
toFloor: undefined,
|
|
11660
|
-
fromPlaceId: undefined,
|
|
11661
|
-
toPlaceId: undefined,
|
|
11662
|
-
travelMode: TransportationMode.walking,
|
|
11663
|
-
reducedMobility: routeConfig.preferAccessibleRoute ? 1 : 0,
|
|
11664
|
-
announceFormat: routeConfig.announceFormat,
|
|
11665
|
-
userBearing: 0,
|
|
11666
|
-
lang: this.lang,
|
|
11667
|
-
unitSystem: routeConfig.unitSystem,
|
|
11668
|
-
token: token
|
|
11669
|
-
};
|
|
11670
|
-
if ("id" in routeConfig.initialLocation) {
|
|
11671
|
-
params.fromPlaceId = routeConfig.initialLocation.id;
|
|
11672
|
-
if (routeConfig.initialLocation.level !== undefined) {
|
|
11673
|
-
params.fromFloor = routeConfig.initialLocation.level;
|
|
11674
|
-
}
|
|
11675
|
-
} else {
|
|
11676
|
-
_routeConfig$initialL2 = routeConfig.initialLocation, lat = _routeConfig$initialL2.lat, lng = _routeConfig$initialL2.lng, floorId = _routeConfig$initialL2.floorId, placeId = _routeConfig$initialL2.placeId;
|
|
11677
|
-
params.fromLatLng = "".concat(lat, ",").concat(lng);
|
|
11678
|
-
params.fromFloor = floorId;
|
|
11679
|
-
params.fromBuilding = placeId;
|
|
11680
|
-
}
|
|
11681
|
-
if ("id" in routeConfig.finalLocation) {
|
|
11682
|
-
params.toPlaceId = routeConfig.finalLocation.id;
|
|
11683
|
-
if (routeConfig.finalLocation.level !== undefined) {
|
|
11684
|
-
params.toFloor = routeConfig.finalLocation.level;
|
|
11685
|
-
}
|
|
11686
|
-
} else {
|
|
11687
|
-
_routeConfig$finalLoc2 = routeConfig.finalLocation, _lat2 = _routeConfig$finalLoc2.lat, _lng2 = _routeConfig$finalLoc2.lng, _floorId2 = _routeConfig$finalLoc2.floorId, _placeId2 = _routeConfig$finalLoc2.placeId;
|
|
11688
|
-
params.toLatLng = "".concat(_lat2, ",").concat(_lng2);
|
|
11689
|
-
params.toFloor = _floorId2;
|
|
11690
|
-
params.toBuilding = _placeId2;
|
|
11691
|
-
}
|
|
11692
|
-
cleanParams = {};
|
|
11693
|
-
for (key in params) {
|
|
11694
|
-
value = params[key];
|
|
11695
|
-
if (value != null) {
|
|
11696
|
-
cleanParams[key] = value;
|
|
11697
|
-
}
|
|
11698
|
-
}
|
|
11948
|
+
cleanParams = this.buildRouteParams(routeConfig);
|
|
11699
11949
|
return _context11.a(2, this.fetchFromUrl(this.routeBaseUrl + "v2/route", cleanParams, options));
|
|
11700
11950
|
}
|
|
11701
11951
|
}, _callee11, this);
|
|
@@ -11724,11 +11974,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11724
11974
|
options = {
|
|
11725
11975
|
method: "GET",
|
|
11726
11976
|
headers: {
|
|
11727
|
-
"content-type": "application/json"
|
|
11977
|
+
"content-type": "application/json",
|
|
11978
|
+
Authorization: "Bearer ".concat(token)
|
|
11728
11979
|
}
|
|
11729
11980
|
};
|
|
11730
11981
|
params = {
|
|
11731
|
-
token: token,
|
|
11732
11982
|
lang: this.lang
|
|
11733
11983
|
};
|
|
11734
11984
|
return _context12.a(2, this.fetchFromUrl(this.baseUrl + "institution", params, options));
|
|
@@ -11764,14 +12014,14 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11764
12014
|
options = {
|
|
11765
12015
|
method: "GET",
|
|
11766
12016
|
headers: {
|
|
11767
|
-
"content-type": "application/json"
|
|
12017
|
+
"content-type": "application/json",
|
|
12018
|
+
Authorization: "Bearer ".concat(token)
|
|
11768
12019
|
}
|
|
11769
12020
|
};
|
|
11770
12021
|
params = {
|
|
11771
12022
|
institution_id: institutionId,
|
|
11772
12023
|
input: input,
|
|
11773
|
-
lang: this.lang
|
|
11774
|
-
token: token
|
|
12024
|
+
lang: this.lang
|
|
11775
12025
|
};
|
|
11776
12026
|
if (parentIds) {
|
|
11777
12027
|
params.parentPlaces = requester_toConsumableArray(parentIds);
|
|
@@ -11824,7 +12074,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11824
12074
|
return requester_regenerator().w(function (_context14) {
|
|
11825
12075
|
while (1) switch (_context14.n) {
|
|
11826
12076
|
case 0:
|
|
11827
|
-
// The v2
|
|
12077
|
+
// The v2 endpoints authenticate via the Authorization header (Bearer),
|
|
11828
12078
|
// not via a `token` query parameter like the legacy /api/sdk/* routes.
|
|
11829
12079
|
options = {
|
|
11830
12080
|
method: "GET",
|
|
@@ -11856,7 +12106,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11856
12106
|
if (floor) {
|
|
11857
12107
|
params.floor = floor;
|
|
11858
12108
|
}
|
|
11859
|
-
return _context14.a(2, this.fetchFromUrl(this.
|
|
12109
|
+
return _context14.a(2, this.fetchFromUrl(this.baseUrl + "searchPlacesByTags", params, options));
|
|
11860
12110
|
}
|
|
11861
12111
|
}, _callee14, this);
|
|
11862
12112
|
}));
|
|
@@ -11876,16 +12126,16 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11876
12126
|
options = {
|
|
11877
12127
|
method: "GET",
|
|
11878
12128
|
headers: {
|
|
11879
|
-
"content-type": "application/json"
|
|
12129
|
+
"content-type": "application/json",
|
|
12130
|
+
Authorization: "Bearer ".concat(token)
|
|
11880
12131
|
}
|
|
11881
12132
|
};
|
|
11882
12133
|
params = {
|
|
11883
|
-
token: token,
|
|
11884
12134
|
lang: this.lang
|
|
11885
12135
|
};
|
|
11886
12136
|
if (place_id) params.place_id = place_id;
|
|
11887
12137
|
if (product) params.product = product;
|
|
11888
|
-
return _context15.a(2, this.fetchFromUrl(this.
|
|
12138
|
+
return _context15.a(2, this.fetchFromUrl(this.baseUrl + "configuration", params, options));
|
|
11889
12139
|
}
|
|
11890
12140
|
}, _callee15, this);
|
|
11891
12141
|
}));
|
|
@@ -11905,15 +12155,15 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11905
12155
|
options = {
|
|
11906
12156
|
method: "GET",
|
|
11907
12157
|
headers: {
|
|
11908
|
-
"content-type": "application/json"
|
|
12158
|
+
"content-type": "application/json",
|
|
12159
|
+
Authorization: "Bearer ".concat(token)
|
|
11909
12160
|
}
|
|
11910
12161
|
};
|
|
11911
12162
|
params = {
|
|
11912
|
-
token: token,
|
|
11913
12163
|
lang: this.lang
|
|
11914
12164
|
};
|
|
11915
12165
|
if (place_id) params.id = place_id;
|
|
11916
|
-
return _context16.a(2, this.fetchFromUrl(this.
|
|
12166
|
+
return _context16.a(2, this.fetchFromUrl(this.baseUrl + "category", params, options));
|
|
11917
12167
|
}
|
|
11918
12168
|
}, _callee16, this);
|
|
11919
12169
|
}));
|
|
@@ -11933,11 +12183,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11933
12183
|
options = {
|
|
11934
12184
|
method: "GET",
|
|
11935
12185
|
headers: {
|
|
11936
|
-
"content-type": "application/json"
|
|
12186
|
+
"content-type": "application/json",
|
|
12187
|
+
Authorization: "Bearer ".concat(token)
|
|
11937
12188
|
}
|
|
11938
12189
|
};
|
|
11939
12190
|
params = {
|
|
11940
|
-
token: token,
|
|
11941
12191
|
placeId: parentPlaceId,
|
|
11942
12192
|
fromPlace: fromPlaceId,
|
|
11943
12193
|
announceFormat: announceFormat,
|
|
@@ -11965,11 +12215,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11965
12215
|
options = {
|
|
11966
12216
|
method: "GET",
|
|
11967
12217
|
headers: {
|
|
11968
|
-
"content-type": "application/json"
|
|
12218
|
+
"content-type": "application/json",
|
|
12219
|
+
Authorization: "Bearer ".concat(token)
|
|
11969
12220
|
}
|
|
11970
12221
|
};
|
|
11971
12222
|
params = {
|
|
11972
|
-
token: token,
|
|
11973
12223
|
placeId: placeId
|
|
11974
12224
|
};
|
|
11975
12225
|
return _context18.a(2, this.fetchFromUrl(this.routeBaseUrl + "cache_timestamp", params, options));
|
|
@@ -11992,14 +12242,14 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11992
12242
|
options = {
|
|
11993
12243
|
method: "GET",
|
|
11994
12244
|
headers: {
|
|
11995
|
-
"content-type": "application/json"
|
|
12245
|
+
"content-type": "application/json",
|
|
12246
|
+
Authorization: "Bearer ".concat(token)
|
|
11996
12247
|
}
|
|
11997
12248
|
};
|
|
11998
12249
|
params = {
|
|
11999
|
-
token: token,
|
|
12000
12250
|
type: type
|
|
12001
12251
|
};
|
|
12002
|
-
return _context19.a(2, this.fetchFromUrl(this.
|
|
12252
|
+
return _context19.a(2, this.fetchFromUrl(this.baseUrl + "styles/customStyles", params, options));
|
|
12003
12253
|
}
|
|
12004
12254
|
}, _callee19, this);
|
|
12005
12255
|
}));
|
|
@@ -12022,14 +12272,13 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12022
12272
|
totemId: totemId,
|
|
12023
12273
|
status: status
|
|
12024
12274
|
});
|
|
12025
|
-
params = {
|
|
12026
|
-
token: token
|
|
12027
|
-
};
|
|
12275
|
+
params = {};
|
|
12028
12276
|
options = {
|
|
12029
12277
|
method: "POST",
|
|
12030
12278
|
headers: {
|
|
12031
12279
|
accept: "application/json",
|
|
12032
|
-
"Content-Type": "application/json"
|
|
12280
|
+
"Content-Type": "application/json",
|
|
12281
|
+
Authorization: "Bearer ".concat(token)
|
|
12033
12282
|
},
|
|
12034
12283
|
body: requestData
|
|
12035
12284
|
};
|
|
@@ -12109,7 +12358,6 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12109
12358
|
_this.token = token;
|
|
12110
12359
|
_this.currentLang = lang;
|
|
12111
12360
|
_this.requester = new Requester(lang, apiUrl, mapvxRequestContext);
|
|
12112
|
-
_this.lang = lang;
|
|
12113
12361
|
_this.cache = cache !== null && cache !== void 0 ? cache : new CacheManager();
|
|
12114
12362
|
return _this;
|
|
12115
12363
|
}
|
|
@@ -12316,7 +12564,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12316
12564
|
while (1) switch (_context4.p = _context4.n) {
|
|
12317
12565
|
case 0:
|
|
12318
12566
|
_context4.p = 0;
|
|
12319
|
-
cachedPlace = this.cache.getPlace(placeId, this.
|
|
12567
|
+
cachedPlace = this.cache.getPlace(placeId, this.currentLang);
|
|
12320
12568
|
if (!(cachedPlace != null)) {
|
|
12321
12569
|
_context4.n = 1;
|
|
12322
12570
|
break;
|
|
@@ -12345,9 +12593,9 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12345
12593
|
case 5:
|
|
12346
12594
|
responseData = _context4.v;
|
|
12347
12595
|
place = new place_MVXPlace(responseData);
|
|
12348
|
-
this.cache.setPlace(place.mapvxId, place, this.
|
|
12596
|
+
this.cache.setPlace(place.mapvxId, place, this.currentLang);
|
|
12349
12597
|
if (place.clientId != null) {
|
|
12350
|
-
this.cache.setPlace(place.clientId, place, this.
|
|
12598
|
+
this.cache.setPlace(place.clientId, place, this.currentLang);
|
|
12351
12599
|
}
|
|
12352
12600
|
this.logEvent("fetchAndParsePlaceDetail", {
|
|
12353
12601
|
cached: "false"
|
|
@@ -12376,7 +12624,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12376
12624
|
while (1) switch (_context5.p = _context5.n) {
|
|
12377
12625
|
case 0:
|
|
12378
12626
|
_context5.p = 0;
|
|
12379
|
-
cachedPlace = this.cache.getPlace(placeId, this.
|
|
12627
|
+
cachedPlace = this.cache.getPlace(placeId, this.currentLang);
|
|
12380
12628
|
if (!(cachedPlace != null)) {
|
|
12381
12629
|
_context5.n = 1;
|
|
12382
12630
|
break;
|
|
@@ -12405,9 +12653,9 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12405
12653
|
case 5:
|
|
12406
12654
|
responseData = _context5.v;
|
|
12407
12655
|
place = new place_MVXPlace(responseData);
|
|
12408
|
-
this.cache.setPlace(place.mapvxId, place, this.
|
|
12656
|
+
this.cache.setPlace(place.mapvxId, place, this.currentLang);
|
|
12409
12657
|
if (place.clientId != null) {
|
|
12410
|
-
this.cache.setPlace(place.clientId, place, this.
|
|
12658
|
+
this.cache.setPlace(place.clientId, place, this.currentLang);
|
|
12411
12659
|
}
|
|
12412
12660
|
this.logEvent("fetchAndParseAnyPlaceDetail", {
|
|
12413
12661
|
cached: "false"
|
|
@@ -12532,11 +12780,11 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12532
12780
|
});
|
|
12533
12781
|
this.logEvent("fetchAndParseAnySubPlaces");
|
|
12534
12782
|
subPlaces.forEach(function (place) {
|
|
12535
|
-
if (!_this3.cache.hasPlace(place.mapvxId, _this3.
|
|
12536
|
-
_this3.cache.setPlace(place.mapvxId, place, _this3.
|
|
12783
|
+
if (!_this3.cache.hasPlace(place.mapvxId, _this3.currentLang)) {
|
|
12784
|
+
_this3.cache.setPlace(place.mapvxId, place, _this3.currentLang);
|
|
12537
12785
|
}
|
|
12538
|
-
if (place.clientId != null && !_this3.cache.hasPlace(place.clientId, _this3.
|
|
12539
|
-
_this3.cache.setPlace(place.clientId, place, _this3.
|
|
12786
|
+
if (place.clientId != null && !_this3.cache.hasPlace(place.clientId, _this3.currentLang)) {
|
|
12787
|
+
_this3.cache.setPlace(place.clientId, place, _this3.currentLang);
|
|
12540
12788
|
}
|
|
12541
12789
|
});
|
|
12542
12790
|
return _context7.a(2, subPlaces);
|
|
@@ -12587,11 +12835,11 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12587
12835
|
});
|
|
12588
12836
|
this.logEvent("fetchAndParseAvailablePlaces");
|
|
12589
12837
|
data.forEach(function (place) {
|
|
12590
|
-
if (!_this4.cache.hasPlace(place.mapvxId, _this4.
|
|
12591
|
-
_this4.cache.setPlace(place.mapvxId, place, _this4.
|
|
12838
|
+
if (!_this4.cache.hasPlace(place.mapvxId, _this4.currentLang)) {
|
|
12839
|
+
_this4.cache.setPlace(place.mapvxId, place, _this4.currentLang);
|
|
12592
12840
|
}
|
|
12593
|
-
if (place.clientId != null && !_this4.cache.hasPlace(place.clientId, _this4.
|
|
12594
|
-
_this4.cache.setPlace(place.clientId, place, _this4.
|
|
12841
|
+
if (place.clientId != null && !_this4.cache.hasPlace(place.clientId, _this4.currentLang)) {
|
|
12842
|
+
_this4.cache.setPlace(place.clientId, place, _this4.currentLang);
|
|
12595
12843
|
}
|
|
12596
12844
|
});
|
|
12597
12845
|
return _context8.a(2, data);
|
|
@@ -12645,11 +12893,11 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12645
12893
|
});
|
|
12646
12894
|
this.logEvent("fetchAndParsePlacesFromInstitution");
|
|
12647
12895
|
data.forEach(function (place) {
|
|
12648
|
-
if (!_this5.cache.hasPlace(place.mapvxId, _this5.
|
|
12649
|
-
_this5.cache.setPlace(place.mapvxId, place, _this5.
|
|
12896
|
+
if (!_this5.cache.hasPlace(place.mapvxId, _this5.currentLang)) {
|
|
12897
|
+
_this5.cache.setPlace(place.mapvxId, place, _this5.currentLang);
|
|
12650
12898
|
}
|
|
12651
|
-
if (place.clientId != null && !_this5.cache.hasPlace(place.clientId, _this5.
|
|
12652
|
-
_this5.cache.setPlace(place.clientId, place, _this5.
|
|
12899
|
+
if (place.clientId != null && !_this5.cache.hasPlace(place.clientId, _this5.currentLang)) {
|
|
12900
|
+
_this5.cache.setPlace(place.clientId, place, _this5.currentLang);
|
|
12653
12901
|
}
|
|
12654
12902
|
});
|
|
12655
12903
|
return _context9.a(2, data);
|
|
@@ -12676,7 +12924,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12676
12924
|
var _this6 = this;
|
|
12677
12925
|
var places = [];
|
|
12678
12926
|
ids.forEach(function (id) {
|
|
12679
|
-
var place = _this6.cache.getPlace(id, _this6.
|
|
12927
|
+
var place = _this6.cache.getPlace(id, _this6.currentLang);
|
|
12680
12928
|
if (place != null) {
|
|
12681
12929
|
places.push(place);
|
|
12682
12930
|
}
|
|
@@ -12825,8 +13073,8 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12825
13073
|
while (1) switch (_context10.p = _context10.n) {
|
|
12826
13074
|
case 0:
|
|
12827
13075
|
_context10.p = 0;
|
|
12828
|
-
cachedResponse = this.cache.getVehicle(stopId, this.
|
|
12829
|
-
if (!(cachedResponse != null && (Date.now() - cachedResponse.timestamp < 60 *
|
|
13076
|
+
cachedResponse = this.cache.getVehicle(stopId, this.currentLang);
|
|
13077
|
+
if (!(cachedResponse != null && (Date.now() - cachedResponse.timestamp < 60 * 1000 || cachedResponse.data.routes.length === 0))) {
|
|
12830
13078
|
_context10.n = 1;
|
|
12831
13079
|
break;
|
|
12832
13080
|
}
|
|
@@ -12877,7 +13125,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12877
13125
|
this.cache.setVehicle(stopId, {
|
|
12878
13126
|
timestamp: Date.now(),
|
|
12879
13127
|
data: transport
|
|
12880
|
-
}, this.
|
|
13128
|
+
}, this.currentLang);
|
|
12881
13129
|
this.logEvent("fetchAndParseTransport", {
|
|
12882
13130
|
cached: "false"
|
|
12883
13131
|
});
|
|
@@ -12885,7 +13133,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12885
13133
|
case 8:
|
|
12886
13134
|
_context10.p = 8;
|
|
12887
13135
|
_t10 = _context10.v;
|
|
12888
|
-
_cachedResponse = this.cache.getVehicle(stopId, this.
|
|
13136
|
+
_cachedResponse = this.cache.getVehicle(stopId, this.currentLang);
|
|
12889
13137
|
if (!(_cachedResponse != null)) {
|
|
12890
13138
|
_context10.n = 9;
|
|
12891
13139
|
break;
|
|
@@ -12919,7 +13167,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12919
13167
|
while (1) switch (_context11.p = _context11.n) {
|
|
12920
13168
|
case 0:
|
|
12921
13169
|
_context11.p = 0;
|
|
12922
|
-
cachedResponse = this.cache.getStops(stopId + vehicleId, this.
|
|
13170
|
+
cachedResponse = this.cache.getStops(stopId + vehicleId, this.currentLang);
|
|
12923
13171
|
if (!(cachedResponse != null && Date.now() - cachedResponse.timestamp < 60 * 1000)) {
|
|
12924
13172
|
_context11.n = 1;
|
|
12925
13173
|
break;
|
|
@@ -12956,7 +13204,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12956
13204
|
this.cache.setStops(stopId + vehicleId, {
|
|
12957
13205
|
timestamp: Date.now(),
|
|
12958
13206
|
data: data
|
|
12959
|
-
}, this.
|
|
13207
|
+
}, this.currentLang);
|
|
12960
13208
|
this.logEvent("fetchAndParseStops", {
|
|
12961
13209
|
cached: "false"
|
|
12962
13210
|
});
|
|
@@ -13463,6 +13711,58 @@ function extractStepCoordinates(step) {
|
|
|
13463
13711
|
}
|
|
13464
13712
|
return coords;
|
|
13465
13713
|
}
|
|
13714
|
+
;// ./src/map/mapInteractionOptions.ts
|
|
13715
|
+
/**
|
|
13716
|
+
* Subset of MapLibre {@link MapOptions} that can be derived from the interaction
|
|
13717
|
+
* restriction flags on {@link MapConfig}.
|
|
13718
|
+
*
|
|
13719
|
+
* @internal
|
|
13720
|
+
*/
|
|
13721
|
+
|
|
13722
|
+
/**
|
|
13723
|
+
* Translates the interaction/rotation flags from {@link MapConfig} into the
|
|
13724
|
+
* matching MapLibre constructor options.
|
|
13725
|
+
*
|
|
13726
|
+
* Only keys that were explicitly provided are returned, so MapLibre's defaults
|
|
13727
|
+
* (every interaction enabled) are preserved for any flag left `undefined`. This
|
|
13728
|
+
* deliberately avoids writing `undefined` into the options object, which would
|
|
13729
|
+
* otherwise override MapLibre defaults with `NaN`/`undefined`.
|
|
13730
|
+
*
|
|
13731
|
+
* `rotateEnabled: false` disables drag- and pitch-rotation up front. Touch
|
|
13732
|
+
* rotation cannot be turned off via the constructor without also killing
|
|
13733
|
+
* pinch-to-zoom, so it is handled separately after construction — see
|
|
13734
|
+
* {@link shouldDisableTouchRotation}.
|
|
13735
|
+
*
|
|
13736
|
+
* @internal
|
|
13737
|
+
*/
|
|
13738
|
+
function buildInteractionOptions(mapConfig) {
|
|
13739
|
+
var options = {};
|
|
13740
|
+
if (mapConfig.bearing !== undefined) options.bearing = mapConfig.bearing;
|
|
13741
|
+
if (mapConfig.interactive !== undefined) options.interactive = mapConfig.interactive;
|
|
13742
|
+
if (mapConfig.dragPan !== undefined) options.dragPan = mapConfig.dragPan;
|
|
13743
|
+
if (mapConfig.scrollZoom !== undefined) options.scrollZoom = mapConfig.scrollZoom;
|
|
13744
|
+
if (mapConfig.doubleClickZoom !== undefined) options.doubleClickZoom = mapConfig.doubleClickZoom;
|
|
13745
|
+
if (mapConfig.touchZoomRotate !== undefined) options.touchZoomRotate = mapConfig.touchZoomRotate;
|
|
13746
|
+
if (mapConfig.keyboard !== undefined) options.keyboard = mapConfig.keyboard;
|
|
13747
|
+
if (mapConfig.rotateEnabled === false) {
|
|
13748
|
+
options.dragRotate = false;
|
|
13749
|
+
options.pitchWithRotate = false;
|
|
13750
|
+
}
|
|
13751
|
+
return options;
|
|
13752
|
+
}
|
|
13753
|
+
|
|
13754
|
+
/**
|
|
13755
|
+
* Whether two-finger touch rotation must be disabled after the map is created.
|
|
13756
|
+
*
|
|
13757
|
+
* `rotateEnabled: false` should keep pinch-to-zoom working, so the touch
|
|
13758
|
+
* rotation is disabled via `map.touchZoomRotate.disableRotation()` once the map
|
|
13759
|
+
* instance exists rather than through the constructor.
|
|
13760
|
+
*
|
|
13761
|
+
* @internal
|
|
13762
|
+
*/
|
|
13763
|
+
function shouldDisableTouchRotation(mapConfig) {
|
|
13764
|
+
return mapConfig.rotateEnabled === false;
|
|
13765
|
+
}
|
|
13466
13766
|
;// ./src/map/map.ts
|
|
13467
13767
|
function map_typeof(o) { "@babel/helpers - typeof"; return map_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; }, map_typeof(o); }
|
|
13468
13768
|
function map_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 map_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]())) : (map_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, map_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, map_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), map_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", map_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), map_regeneratorDefine2(u), map_regeneratorDefine2(u, o, "Generator"), map_regeneratorDefine2(u, n, function () { return this; }), map_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (map_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
@@ -13496,6 +13796,8 @@ function map_defineProperty(e, r, t) { return (r = map_toPropertyKey(r)) in e ?
|
|
|
13496
13796
|
function map_toPropertyKey(t) { var i = map_toPrimitive(t, "string"); return "symbol" == map_typeof(i) ? i : i + ""; }
|
|
13497
13797
|
function map_toPrimitive(t, r) { if ("object" != map_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != map_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13498
13798
|
|
|
13799
|
+
|
|
13800
|
+
|
|
13499
13801
|
/** Shared GeoJSON source holding every circle drawn through the circle API. */
|
|
13500
13802
|
var CIRCLE_SOURCE_ID = "mapvx-circles";
|
|
13501
13803
|
/** Fill layer rendering the translucent interior of the circles. */
|
|
@@ -13549,23 +13851,40 @@ function deepClone(obj) {
|
|
|
13549
13851
|
/**
|
|
13550
13852
|
* Register a custom protocol for cached tiles that routes requests through the main thread.
|
|
13551
13853
|
* This allows the service worker to intercept and cache tile requests.
|
|
13854
|
+
*
|
|
13855
|
+
* Wraps fetches in a {@link Semaphore} so tile CDN / WAFs are not hit with
|
|
13856
|
+
* unbounded parallel requests (same host as the service worker cache). The
|
|
13857
|
+
* semaphore is created once with the limit from the first map's config; later
|
|
13858
|
+
* calls are no-ops because the protocol can only be registered once globally
|
|
13859
|
+
* on MapLibre.
|
|
13860
|
+
*
|
|
13861
|
+
* @param maxConcurrentFetches - Maximum number of in-flight tile fetches.
|
|
13552
13862
|
*/
|
|
13553
|
-
function registerCachedTileProtocol() {
|
|
13863
|
+
function registerCachedTileProtocol(maxConcurrentFetches) {
|
|
13554
13864
|
if (cachedTileProtocolRegistered) return;
|
|
13865
|
+
var semaphore = new Semaphore(maxConcurrentFetches);
|
|
13555
13866
|
maplibre_gl_default().addProtocol("cached-tile", function (params, abortController) {
|
|
13556
|
-
// Convert cached-tile:// URL back to https://
|
|
13557
13867
|
var url = params.url.replace("cached-tile://", "https://");
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
return
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13868
|
+
|
|
13869
|
+
// Pass the abort signal to acquire() so a request cancelled while still
|
|
13870
|
+
// queued (e.g. during rapid zoom) drops out of the FIFO queue instead of
|
|
13871
|
+
// waiting for a slot just to bail. release() runs only inside this chain,
|
|
13872
|
+
// i.e. only after a slot was actually granted.
|
|
13873
|
+
return semaphore.acquire(abortController.signal).then(function () {
|
|
13874
|
+
return fetch(url, {
|
|
13875
|
+
signal: abortController.signal
|
|
13876
|
+
}).then(function (response) {
|
|
13877
|
+
if (!response.ok) {
|
|
13878
|
+
throw new Error("HTTP error! status: ".concat(response.status));
|
|
13879
|
+
}
|
|
13880
|
+
return response.arrayBuffer();
|
|
13881
|
+
}).then(function (data) {
|
|
13882
|
+
return {
|
|
13883
|
+
data: data
|
|
13884
|
+
};
|
|
13885
|
+
})["finally"](function () {
|
|
13886
|
+
semaphore.release();
|
|
13887
|
+
});
|
|
13569
13888
|
});
|
|
13570
13889
|
});
|
|
13571
13890
|
cachedTileProtocolRegistered = true;
|
|
@@ -13641,6 +13960,7 @@ function convertPaddingToPixels(padding, containerWidth, containerHeight) {
|
|
|
13641
13960
|
|
|
13642
13961
|
|
|
13643
13962
|
|
|
13963
|
+
|
|
13644
13964
|
/**
|
|
13645
13965
|
* @group Map
|
|
13646
13966
|
*/
|
|
@@ -13686,8 +14006,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13686
14006
|
_this.watchPositionID = undefined;
|
|
13687
14007
|
_this.onFloorChange = mapConfig.onFloorChange;
|
|
13688
14008
|
_this.onParentPlaceChange = mapConfig.onParentPlaceChange;
|
|
13689
|
-
|
|
13690
|
-
|
|
14009
|
+
_this.tileCacheConfig = function () {
|
|
14010
|
+
var merged = map_objectSpread(map_objectSpread({}, DEFAULT_TILE_CACHE_CONFIG), mapConfig.tileCache);
|
|
14011
|
+
merged.maxTiles = Math.min(merged.maxTiles, MAPLIBRE_MAX_TILE_CACHE_HARD_CAP);
|
|
14012
|
+
return merged;
|
|
14013
|
+
}();
|
|
13691
14014
|
if (mapConfig.parentPlaceId != null) {
|
|
13692
14015
|
_this.initialPlaceDetailSetUp(mapConfig.parentPlaceId, mapConfig.authToken);
|
|
13693
14016
|
}
|
|
@@ -13797,15 +14120,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13797
14120
|
_this6 = this;
|
|
13798
14121
|
// Determine if service worker caching should be enabled
|
|
13799
14122
|
var useServiceWorkerCaching = this.tileCacheConfig.enabled && this.tileCacheConfig.persistToServiceWorker;
|
|
13800
|
-
|
|
13801
|
-
// Register cached-tile protocol only if service worker caching is enabled
|
|
13802
14123
|
if (useServiceWorkerCaching) {
|
|
13803
|
-
registerCachedTileProtocol();
|
|
14124
|
+
registerCachedTileProtocol(this.tileCacheConfig.maxConcurrentTileFetches);
|
|
13804
14125
|
}
|
|
13805
14126
|
|
|
13806
14127
|
// Transform tile URLs only if service worker caching is enabled
|
|
13807
14128
|
var finalStyle = useServiceWorkerCaching ? this.transformStyleForCaching(style) : style;
|
|
13808
|
-
var mapOptions = {
|
|
14129
|
+
var mapOptions = map_objectSpread({
|
|
13809
14130
|
container: container,
|
|
13810
14131
|
style: finalStyle,
|
|
13811
14132
|
center: mapConfig.center,
|
|
@@ -13814,10 +14135,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13814
14135
|
attributionControl: false,
|
|
13815
14136
|
maplibreLogo: false,
|
|
13816
14137
|
bearingSnap: (_mapConfig$bearingSna = mapConfig.bearingSnap) !== null && _mapConfig$bearingSna !== void 0 ? _mapConfig$bearingSna : 0,
|
|
13817
|
-
cancelPendingTileRequestsWhileZooming:
|
|
14138
|
+
cancelPendingTileRequestsWhileZooming: true,
|
|
13818
14139
|
// Use configured maxTiles for MapLibre's memory cache
|
|
13819
14140
|
maxTileCacheSize: this.tileCacheConfig.maxTiles
|
|
13820
|
-
};
|
|
14141
|
+
}, buildInteractionOptions(mapConfig));
|
|
13821
14142
|
if (mapConfig.maxZoom) mapOptions.maxZoom = mapConfig.maxZoom;
|
|
13822
14143
|
if (mapConfig.minZoom) mapOptions.minZoom = mapConfig.minZoom;
|
|
13823
14144
|
if (mapConfig.maxBounds && mapConfig.maxBounds.length > 1) {
|
|
@@ -13825,6 +14146,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13825
14146
|
mapOptions.maxBounds = new maplibre_gl.LngLatBounds([boundingBox[0].lng, boundingBox[0].lat], [boundingBox[1].lng, boundingBox[1].lat]);
|
|
13826
14147
|
}
|
|
13827
14148
|
this.map = new maplibre_gl.Map(mapOptions);
|
|
14149
|
+
// When rotation is disabled we still want pinch-to-zoom to work, so the
|
|
14150
|
+
// two-finger rotation is turned off here instead of via the constructor.
|
|
14151
|
+
if (shouldDisableTouchRotation(mapConfig)) {
|
|
14152
|
+
var _this$map$touchZoomRo, _this$map$touchZoomRo2;
|
|
14153
|
+
(_this$map$touchZoomRo = this.map.touchZoomRotate) === null || _this$map$touchZoomRo === void 0 || (_this$map$touchZoomRo2 = _this$map$touchZoomRo.disableRotation) === null || _this$map$touchZoomRo2 === void 0 || _this$map$touchZoomRo2.call(_this$map$touchZoomRo);
|
|
14154
|
+
}
|
|
13828
14155
|
this.map.addControl(new maplibre_gl.NavigationControl({
|
|
13829
14156
|
showCompass: mapConfig.showCompass !== undefined ? mapConfig.showCompass : true,
|
|
13830
14157
|
showZoom: mapConfig.showZoom !== undefined ? mapConfig.showZoom : true
|
|
@@ -14048,7 +14375,22 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14048
14375
|
}, {
|
|
14049
14376
|
key: "setLang",
|
|
14050
14377
|
value: function setLang(lang) {
|
|
14378
|
+
var _this0 = this;
|
|
14051
14379
|
this.repository.setLang(lang);
|
|
14380
|
+
if (rtlLanguages.includes(lang)) {
|
|
14381
|
+
this.setRTLSupport();
|
|
14382
|
+
}
|
|
14383
|
+
// setLayersForLanguage reads this.map.getStyle()?.layers, which is empty
|
|
14384
|
+
// until the style finishes loading. If setLang is called right after
|
|
14385
|
+
// createMap (before the "load" event), apply it once the style is ready
|
|
14386
|
+
// so the language change is not silently dropped.
|
|
14387
|
+
if (this.map.isStyleLoaded()) {
|
|
14388
|
+
this.setLayersForLanguage(lang);
|
|
14389
|
+
} else {
|
|
14390
|
+
this.map.once("load", function () {
|
|
14391
|
+
return _this0.setLayersForLanguage(lang);
|
|
14392
|
+
});
|
|
14393
|
+
}
|
|
14052
14394
|
}
|
|
14053
14395
|
}, {
|
|
14054
14396
|
key: "setParentPlace",
|
|
@@ -14083,7 +14425,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14083
14425
|
}, {
|
|
14084
14426
|
key: "addMarker",
|
|
14085
14427
|
value: function addMarker(marker) {
|
|
14086
|
-
var
|
|
14428
|
+
var _this1 = this;
|
|
14087
14429
|
try {
|
|
14088
14430
|
var _this$innerFloors$fin4, _this$innerFloors$fin5;
|
|
14089
14431
|
// Check if a marker with the same ID already exists and remove it
|
|
@@ -14103,7 +14445,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14103
14445
|
}
|
|
14104
14446
|
var markerCreated = new MarkerAttribute(marker);
|
|
14105
14447
|
var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin4 = (_this$innerFloors$fin5 = this.innerFloors.find(function (floor) {
|
|
14106
|
-
return floor.key ===
|
|
14448
|
+
return floor.key === _this1.currentFloor;
|
|
14107
14449
|
})) === null || _this$innerFloors$fin5 === void 0 ? void 0 : _this$innerFloors$fin5.reachableFromGPS) !== null && _this$innerFloors$fin4 !== void 0 ? _this$innerFloors$fin4 : false);
|
|
14108
14450
|
markerCreated.changeFloor(this.currentFloor, this.map, isOutdoor);
|
|
14109
14451
|
this.markers.push(markerCreated);
|
|
@@ -14499,11 +14841,18 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14499
14841
|
// Always keep the default bucket alive so an empty map still renders
|
|
14500
14842
|
// newly added circles without a layer rebuild
|
|
14501
14843
|
ordersInUse.add("aboveBasemap");
|
|
14502
|
-
|
|
14844
|
+
|
|
14845
|
+
// Process buckets lowest-first (CIRCLE_RENDER_ORDERS is canonical):
|
|
14846
|
+
// when two buckets resolve to the same anchor, each addLayer/moveLayer
|
|
14847
|
+
// lands immediately before it, so a bucket processed later paints above
|
|
14848
|
+
// the ones processed earlier. Canonical order keeps
|
|
14849
|
+
// belowLabels < aboveBasemap < top regardless of circle insertion order.
|
|
14850
|
+
var _iterator = map_createForOfIteratorHelper(CIRCLE_RENDER_ORDERS),
|
|
14503
14851
|
_step;
|
|
14504
14852
|
try {
|
|
14505
14853
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
14506
14854
|
var order = _step.value;
|
|
14855
|
+
if (!ordersInUse.has(order)) continue;
|
|
14507
14856
|
var ids = circleLayerIdsFor(order);
|
|
14508
14857
|
var beforeId = this.circleBeforeIdFor(order);
|
|
14509
14858
|
var orderFilter = ["==", ["get", "renderOrder"], order];
|
|
@@ -14600,12 +14949,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14600
14949
|
value: function updateMarkersTo(floorId) {
|
|
14601
14950
|
var _this$innerFloors$fin8,
|
|
14602
14951
|
_this$innerFloors$fin9,
|
|
14603
|
-
|
|
14952
|
+
_this10 = this;
|
|
14604
14953
|
var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin8 = (_this$innerFloors$fin9 = this.innerFloors.find(function (floor) {
|
|
14605
14954
|
return floor.key === floorId;
|
|
14606
14955
|
})) === null || _this$innerFloors$fin9 === void 0 ? void 0 : _this$innerFloors$fin9.reachableFromGPS) !== null && _this$innerFloors$fin8 !== void 0 ? _this$innerFloors$fin8 : false);
|
|
14607
14956
|
this.markers.forEach(function (e) {
|
|
14608
|
-
e.changeFloor(floorId,
|
|
14957
|
+
e.changeFloor(floorId, _this10.map, isOutdoor);
|
|
14609
14958
|
});
|
|
14610
14959
|
}
|
|
14611
14960
|
}, {
|
|
@@ -14613,14 +14962,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14613
14962
|
value: function updateFiltersTo(floorId) {
|
|
14614
14963
|
var _this$map$getStyle$la3,
|
|
14615
14964
|
_this$map$getStyle3,
|
|
14616
|
-
|
|
14965
|
+
_this11 = this,
|
|
14617
14966
|
_this$innerFloors$fin0;
|
|
14618
14967
|
if (!this.map) return;
|
|
14619
14968
|
var layers = (_this$map$getStyle$la3 = (_this$map$getStyle3 = this.map.getStyle()) === null || _this$map$getStyle3 === void 0 ? void 0 : _this$map$getStyle3.layers) !== null && _this$map$getStyle$la3 !== void 0 ? _this$map$getStyle$la3 : [];
|
|
14620
14969
|
layers.filter(function (l) {
|
|
14621
14970
|
return l.id.startsWith("base-indoor-");
|
|
14622
14971
|
}).forEach(function (l) {
|
|
14623
|
-
|
|
14972
|
+
_this11.map.removeLayer(l.id);
|
|
14624
14973
|
});
|
|
14625
14974
|
var baseFloorId = (_this$innerFloors$fin0 = this.innerFloors.find(function (floor) {
|
|
14626
14975
|
return floor.key === floorId;
|
|
@@ -14636,13 +14985,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14636
14985
|
}).forEach(function (layer) {
|
|
14637
14986
|
var baseLayer = deepClone(layer);
|
|
14638
14987
|
baseLayer.id = "base-" + layer.id;
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14988
|
+
_this11.baseFilters[baseLayer.id] = _this11.baseFilters[layer.id];
|
|
14989
|
+
_this11.map.addLayer(baseLayer, firstLayerId);
|
|
14990
|
+
_this11.applyLayerFilters(baseLayer, baseFloorId);
|
|
14642
14991
|
});
|
|
14643
14992
|
}
|
|
14644
14993
|
indoorLayers.forEach(function (layer) {
|
|
14645
|
-
|
|
14994
|
+
_this11.applyLayerFilters(layer, floorId);
|
|
14646
14995
|
});
|
|
14647
14996
|
}
|
|
14648
14997
|
}, {
|
|
@@ -14689,18 +15038,69 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14689
15038
|
this.map.easeTo(map_objectSpread({}, newCamera));
|
|
14690
15039
|
}
|
|
14691
15040
|
}, {
|
|
14692
|
-
key: "setMaxZoom",
|
|
14693
|
-
value: function setMaxZoom(zoomLvl, options) {
|
|
14694
|
-
var _options$onComplete2;
|
|
14695
|
-
this.map.setMaxZoom(zoomLvl);
|
|
14696
|
-
options === null || options === void 0 || (_options$onComplete2 = options.onComplete) === null || _options$onComplete2 === void 0 || _options$onComplete2.call(options);
|
|
15041
|
+
key: "setMaxZoom",
|
|
15042
|
+
value: function setMaxZoom(zoomLvl, options) {
|
|
15043
|
+
var _options$onComplete2;
|
|
15044
|
+
this.map.setMaxZoom(zoomLvl);
|
|
15045
|
+
options === null || options === void 0 || (_options$onComplete2 = options.onComplete) === null || _options$onComplete2 === void 0 || _options$onComplete2.call(options);
|
|
15046
|
+
}
|
|
15047
|
+
}, {
|
|
15048
|
+
key: "setMinZoom",
|
|
15049
|
+
value: function setMinZoom(zoomLvl, options) {
|
|
15050
|
+
var _options$onComplete3;
|
|
15051
|
+
this.map.setMinZoom(zoomLvl);
|
|
15052
|
+
options === null || options === void 0 || (_options$onComplete3 = options.onComplete) === null || _options$onComplete3 === void 0 || _options$onComplete3.call(options);
|
|
15053
|
+
}
|
|
15054
|
+
}, {
|
|
15055
|
+
key: "setBearing",
|
|
15056
|
+
value: function setBearing(degrees, options) {
|
|
15057
|
+
var _options$onComplete4;
|
|
15058
|
+
if (!Number.isFinite(degrees)) return;
|
|
15059
|
+
if (options !== null && options !== void 0 && options.animate) {
|
|
15060
|
+
if (options.onComplete) void this.map.once("moveend", options.onComplete);
|
|
15061
|
+
this.map.rotateTo(degrees, {
|
|
15062
|
+
duration: 600
|
|
15063
|
+
});
|
|
15064
|
+
return;
|
|
15065
|
+
}
|
|
15066
|
+
this.map.setBearing(degrees);
|
|
15067
|
+
options === null || options === void 0 || (_options$onComplete4 = options.onComplete) === null || _options$onComplete4 === void 0 || _options$onComplete4.call(options);
|
|
15068
|
+
}
|
|
15069
|
+
}, {
|
|
15070
|
+
key: "setRotationEnabled",
|
|
15071
|
+
value: function setRotationEnabled(enabled) {
|
|
15072
|
+
if (enabled) {
|
|
15073
|
+
var _this$map$dragRotate, _this$map$dragRotate$, _this$map$touchZoomRo3, _this$map$touchZoomRo4, _this$map$keyboard, _this$map$keyboard$en;
|
|
15074
|
+
(_this$map$dragRotate = this.map.dragRotate) === null || _this$map$dragRotate === void 0 || (_this$map$dragRotate$ = _this$map$dragRotate.enable) === null || _this$map$dragRotate$ === void 0 || _this$map$dragRotate$.call(_this$map$dragRotate);
|
|
15075
|
+
(_this$map$touchZoomRo3 = this.map.touchZoomRotate) === null || _this$map$touchZoomRo3 === void 0 || (_this$map$touchZoomRo4 = _this$map$touchZoomRo3.enableRotation) === null || _this$map$touchZoomRo4 === void 0 || _this$map$touchZoomRo4.call(_this$map$touchZoomRo3);
|
|
15076
|
+
(_this$map$keyboard = this.map.keyboard) === null || _this$map$keyboard === void 0 || (_this$map$keyboard$en = _this$map$keyboard.enable) === null || _this$map$keyboard$en === void 0 || _this$map$keyboard$en.call(_this$map$keyboard);
|
|
15077
|
+
} else {
|
|
15078
|
+
var _this$map$dragRotate2, _this$map$dragRotate3, _this$map$touchZoomRo5, _this$map$touchZoomRo6;
|
|
15079
|
+
(_this$map$dragRotate2 = this.map.dragRotate) === null || _this$map$dragRotate2 === void 0 || (_this$map$dragRotate3 = _this$map$dragRotate2.disable) === null || _this$map$dragRotate3 === void 0 || _this$map$dragRotate3.call(_this$map$dragRotate2);
|
|
15080
|
+
(_this$map$touchZoomRo5 = this.map.touchZoomRotate) === null || _this$map$touchZoomRo5 === void 0 || (_this$map$touchZoomRo6 = _this$map$touchZoomRo5.disableRotation) === null || _this$map$touchZoomRo6 === void 0 || _this$map$touchZoomRo6.call(_this$map$touchZoomRo5);
|
|
15081
|
+
}
|
|
15082
|
+
}
|
|
15083
|
+
}, {
|
|
15084
|
+
key: "setPanEnabled",
|
|
15085
|
+
value: function setPanEnabled(enabled) {
|
|
15086
|
+
if (enabled) {
|
|
15087
|
+
var _this$map$dragPan, _this$map$dragPan$ena;
|
|
15088
|
+
(_this$map$dragPan = this.map.dragPan) === null || _this$map$dragPan === void 0 || (_this$map$dragPan$ena = _this$map$dragPan.enable) === null || _this$map$dragPan$ena === void 0 || _this$map$dragPan$ena.call(_this$map$dragPan);
|
|
15089
|
+
} else {
|
|
15090
|
+
var _this$map$dragPan2, _this$map$dragPan2$di;
|
|
15091
|
+
(_this$map$dragPan2 = this.map.dragPan) === null || _this$map$dragPan2 === void 0 || (_this$map$dragPan2$di = _this$map$dragPan2.disable) === null || _this$map$dragPan2$di === void 0 || _this$map$dragPan2$di.call(_this$map$dragPan2);
|
|
15092
|
+
}
|
|
14697
15093
|
}
|
|
14698
15094
|
}, {
|
|
14699
|
-
key: "
|
|
14700
|
-
value: function
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
15095
|
+
key: "setScrollZoomEnabled",
|
|
15096
|
+
value: function setScrollZoomEnabled(enabled) {
|
|
15097
|
+
if (enabled) {
|
|
15098
|
+
var _this$map$scrollZoom, _this$map$scrollZoom$;
|
|
15099
|
+
(_this$map$scrollZoom = this.map.scrollZoom) === null || _this$map$scrollZoom === void 0 || (_this$map$scrollZoom$ = _this$map$scrollZoom.enable) === null || _this$map$scrollZoom$ === void 0 || _this$map$scrollZoom$.call(_this$map$scrollZoom);
|
|
15100
|
+
} else {
|
|
15101
|
+
var _this$map$scrollZoom2, _this$map$scrollZoom3;
|
|
15102
|
+
(_this$map$scrollZoom2 = this.map.scrollZoom) === null || _this$map$scrollZoom2 === void 0 || (_this$map$scrollZoom3 = _this$map$scrollZoom2.disable) === null || _this$map$scrollZoom3 === void 0 || _this$map$scrollZoom3.call(_this$map$scrollZoom2);
|
|
15103
|
+
}
|
|
14704
15104
|
}
|
|
14705
15105
|
}, {
|
|
14706
15106
|
key: "isInsideBounds",
|
|
@@ -14714,12 +15114,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14714
15114
|
}, {
|
|
14715
15115
|
key: "setMaxBounds",
|
|
14716
15116
|
value: function setMaxBounds(coordinates, options) {
|
|
14717
|
-
var _options$
|
|
15117
|
+
var _options$onComplete5;
|
|
14718
15118
|
if (coordinates.length > 1) {
|
|
14719
15119
|
var boundingBox = getBoundingBox(coordinates);
|
|
14720
15120
|
this.map.setMaxBounds(new maplibre_gl.LngLatBounds([boundingBox[0].lng, boundingBox[0].lat], [boundingBox[1].lng, boundingBox[1].lat]));
|
|
14721
15121
|
}
|
|
14722
|
-
options === null || options === void 0 || (_options$
|
|
15122
|
+
options === null || options === void 0 || (_options$onComplete5 = options.onComplete) === null || _options$onComplete5 === void 0 || _options$onComplete5.call(options);
|
|
14723
15123
|
}
|
|
14724
15124
|
}, {
|
|
14725
15125
|
key: "fitCoordinates",
|
|
@@ -14810,13 +15210,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14810
15210
|
key: "updateFloor",
|
|
14811
15211
|
value: function updateFloor(floorId, options) {
|
|
14812
15212
|
try {
|
|
14813
|
-
var _this$onFloorChange2, _options$
|
|
15213
|
+
var _this$onFloorChange2, _options$onComplete6;
|
|
14814
15214
|
this.filterByFloorKey(floorId);
|
|
14815
15215
|
(_this$onFloorChange2 = this.onFloorChange) === null || _this$onFloorChange2 === void 0 || _this$onFloorChange2.call(this, floorId);
|
|
14816
15216
|
this.logEvent("updateFloor", {
|
|
14817
15217
|
floorId: floorId
|
|
14818
15218
|
});
|
|
14819
|
-
options === null || options === void 0 || (_options$
|
|
15219
|
+
options === null || options === void 0 || (_options$onComplete6 = options.onComplete) === null || _options$onComplete6 === void 0 || _options$onComplete6.call(options);
|
|
14820
15220
|
} catch (error) {
|
|
14821
15221
|
// Floor update may fail
|
|
14822
15222
|
}
|
|
@@ -14880,7 +15280,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14880
15280
|
value: function updateRouteProgress(routeId, position) {
|
|
14881
15281
|
var behindStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
14882
15282
|
type: "Solid",
|
|
14883
|
-
color: "#
|
|
15283
|
+
color: "#276EF1"
|
|
14884
15284
|
};
|
|
14885
15285
|
try {
|
|
14886
15286
|
var behindConfig = new InternalDrawRouteConfiguration({
|
|
@@ -14935,13 +15335,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14935
15335
|
return subplace.clientId === placeId || subplace.mapvxId === placeId;
|
|
14936
15336
|
});
|
|
14937
15337
|
if (pointedPlace !== undefined) {
|
|
14938
|
-
new (maplibre_gl_default()).Popup().setLngLat(pointedPlace.position).
|
|
15338
|
+
new (maplibre_gl_default()).Popup().setLngLat(pointedPlace.position).setText(pointedPlace.title).addTo(this.map);
|
|
14939
15339
|
}
|
|
14940
15340
|
}
|
|
14941
15341
|
return "";
|
|
14942
15342
|
}
|
|
14943
|
-
|
|
14944
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14945
15343
|
}, {
|
|
14946
15344
|
key: "removePopOver",
|
|
14947
15345
|
value: function removePopOver(id) {
|
|
@@ -14960,17 +15358,17 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14960
15358
|
}, {
|
|
14961
15359
|
key: "defaultClickListener",
|
|
14962
15360
|
value: function defaultClickListener() {
|
|
14963
|
-
var
|
|
15361
|
+
var _this12 = this;
|
|
14964
15362
|
this.map.on("click", /*#__PURE__*/function () {
|
|
14965
15363
|
var _ref4 = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee2(e) {
|
|
14966
15364
|
var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator3, _step3, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId, _t2;
|
|
14967
15365
|
return map_regenerator().w(function (_context2) {
|
|
14968
15366
|
while (1) switch (_context2.p = _context2.n) {
|
|
14969
15367
|
case 0:
|
|
14970
|
-
features =
|
|
15368
|
+
features = _this12.map.queryRenderedFeatures(e.point); // Filter room features by current floor
|
|
14971
15369
|
roomFeatures = features.filter(function (feature) {
|
|
14972
15370
|
var _feature$properties;
|
|
14973
|
-
return feature.properties["class"] === "room" && ((_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.floor_key) ===
|
|
15371
|
+
return feature.properties["class"] === "room" && ((_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.floor_key) === _this12.currentFloor;
|
|
14974
15372
|
});
|
|
14975
15373
|
touchedFeature = roomFeatures[0];
|
|
14976
15374
|
ref = touchedFeature === null || touchedFeature === void 0 ? void 0 : touchedFeature.properties.ref;
|
|
@@ -14981,14 +15379,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14981
15379
|
console.log("touchedFeature", ref);
|
|
14982
15380
|
|
|
14983
15381
|
// First, search in current subPlaces
|
|
14984
|
-
clickedPlace =
|
|
15382
|
+
clickedPlace = _this12.subPlaces.find(function (subPlace) {
|
|
14985
15383
|
return subPlace.mapvxId === ref;
|
|
14986
15384
|
}); // If not found, search in subplaces of potential parent places
|
|
14987
15385
|
if (!(clickedPlace === undefined)) {
|
|
14988
15386
|
_context2.n = 7;
|
|
14989
15387
|
break;
|
|
14990
15388
|
}
|
|
14991
|
-
_iterator3 = map_createForOfIteratorHelper(
|
|
15389
|
+
_iterator3 = map_createForOfIteratorHelper(_this12.potentialParentPlaces);
|
|
14992
15390
|
_context2.p = 1;
|
|
14993
15391
|
_iterator3.s();
|
|
14994
15392
|
case 2:
|
|
@@ -14997,7 +15395,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14997
15395
|
break;
|
|
14998
15396
|
}
|
|
14999
15397
|
potentialParentPlace = _step3.value;
|
|
15000
|
-
cachedSubPlaces =
|
|
15398
|
+
cachedSubPlaces = _this12.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
|
|
15001
15399
|
if (!cachedSubPlaces) {
|
|
15002
15400
|
_context2.n = 3;
|
|
15003
15401
|
break;
|
|
@@ -15029,14 +15427,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15029
15427
|
_context2.n = 10;
|
|
15030
15428
|
break;
|
|
15031
15429
|
}
|
|
15032
|
-
cachedPlaces =
|
|
15430
|
+
cachedPlaces = _this12.repository.getCachedPlaces([ref]);
|
|
15033
15431
|
if (!(cachedPlaces.length === 0)) {
|
|
15034
15432
|
_context2.n = 9;
|
|
15035
15433
|
break;
|
|
15036
15434
|
}
|
|
15037
15435
|
console.log("fetching place detail from server", ref);
|
|
15038
15436
|
_context2.n = 8;
|
|
15039
|
-
return
|
|
15437
|
+
return _this12.repository.fetchAndParsePlaceDetail(ref);
|
|
15040
15438
|
case 8:
|
|
15041
15439
|
clickedPlace = _context2.v;
|
|
15042
15440
|
_context2.n = 10;
|
|
@@ -15047,8 +15445,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15047
15445
|
case 10:
|
|
15048
15446
|
console.log("clickedPlace", (_clickedPlace = clickedPlace) === null || _clickedPlace === void 0 ? void 0 : _clickedPlace.title);
|
|
15049
15447
|
clickedPlaceId = (_ref5 = (_clickedPlace$mapvxId = (_clickedPlace2 = clickedPlace) === null || _clickedPlace2 === void 0 ? void 0 : _clickedPlace2.mapvxId) !== null && _clickedPlace$mapvxId !== void 0 ? _clickedPlace$mapvxId : (_clickedPlace3 = clickedPlace) === null || _clickedPlace3 === void 0 ? void 0 : _clickedPlace3.clientId) !== null && _ref5 !== void 0 ? _ref5 : "";
|
|
15050
|
-
if (clickedPlace !== undefined &&
|
|
15051
|
-
|
|
15448
|
+
if (clickedPlace !== undefined && _this12.clickCallback) {
|
|
15449
|
+
_this12.clickCallback(clickedPlaceId);
|
|
15052
15450
|
}
|
|
15053
15451
|
case 11:
|
|
15054
15452
|
return _context2.a(2);
|
|
@@ -15063,29 +15461,29 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15063
15461
|
}, {
|
|
15064
15462
|
key: "onHover",
|
|
15065
15463
|
value: function onHover() {
|
|
15066
|
-
var
|
|
15464
|
+
var _this13 = this;
|
|
15067
15465
|
if (!this.enableHover) return;
|
|
15068
15466
|
this.map.on("mousemove", "hoverable", function (e) {
|
|
15069
15467
|
var _e$features;
|
|
15070
15468
|
var feature = (_e$features = e.features) === null || _e$features === void 0 ? void 0 : _e$features.find(function (feature) {
|
|
15071
15469
|
var _feature$properties$r, _feature$properties2;
|
|
15072
|
-
return ((_feature$properties$r = feature.properties.ref) === null || _feature$properties$r === void 0 ? void 0 : _feature$properties$r.length) > 0 && ((_feature$properties2 = feature.properties) === null || _feature$properties2 === void 0 ? void 0 : _feature$properties2.floor_key) ===
|
|
15470
|
+
return ((_feature$properties$r = feature.properties.ref) === null || _feature$properties$r === void 0 ? void 0 : _feature$properties$r.length) > 0 && ((_feature$properties2 = feature.properties) === null || _feature$properties2 === void 0 ? void 0 : _feature$properties2.floor_key) === _this13.currentFloor;
|
|
15073
15471
|
});
|
|
15074
15472
|
var ref = feature === null || feature === void 0 ? void 0 : feature.properties.ref;
|
|
15075
15473
|
if (ref != null && typeof ref === "string" && ref.length > 0) {
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
} else if (ref === undefined &&
|
|
15079
|
-
|
|
15080
|
-
|
|
15474
|
+
_this13.hoveredId = ref;
|
|
15475
|
+
_this13.updateFiltersTo(_this13.currentFloor);
|
|
15476
|
+
} else if (ref === undefined && _this13.hoveredId !== "unselected") {
|
|
15477
|
+
_this13.hoveredId = "unselected";
|
|
15478
|
+
_this13.updateFiltersTo(_this13.currentFloor);
|
|
15081
15479
|
}
|
|
15082
15480
|
});
|
|
15083
15481
|
|
|
15084
15482
|
// When the mouse leaves the state-fill layer, update the feature state of the
|
|
15085
15483
|
// previously hovered feature.
|
|
15086
15484
|
this.map.on("mouseleave", "hoverable", function () {
|
|
15087
|
-
|
|
15088
|
-
|
|
15485
|
+
_this13.hoveredId = "unselected";
|
|
15486
|
+
_this13.updateFiltersTo(_this13.currentFloor);
|
|
15089
15487
|
});
|
|
15090
15488
|
}
|
|
15091
15489
|
}, {
|
|
@@ -15567,7 +15965,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15567
15965
|
key: "onWebGLContextLost",
|
|
15568
15966
|
value: function onWebGLContextLost(e) {
|
|
15569
15967
|
var _this$map,
|
|
15570
|
-
|
|
15968
|
+
_this14 = this;
|
|
15571
15969
|
e.originalEvent.preventDefault();
|
|
15572
15970
|
console.warn("Contexto WebGL perdido 😢");
|
|
15573
15971
|
|
|
@@ -15578,8 +15976,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15578
15976
|
var _ext$restoreContext;
|
|
15579
15977
|
canvas.addEventListener("webglcontextrestored", function () {
|
|
15580
15978
|
console.debug("Contexto WebGL restaurado, forzando re-render");
|
|
15581
|
-
|
|
15582
|
-
|
|
15979
|
+
_this14.map.triggerRepaint(); // forzar repaint
|
|
15980
|
+
_this14.failedTiles.clear();
|
|
15583
15981
|
}, {
|
|
15584
15982
|
once: true
|
|
15585
15983
|
});
|
|
@@ -15619,7 +16017,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15619
16017
|
}, {
|
|
15620
16018
|
key: "subscribeToFailedTiles",
|
|
15621
16019
|
value: function subscribeToFailedTiles() {
|
|
15622
|
-
var
|
|
16020
|
+
var _this15 = this;
|
|
15623
16021
|
if (this.retryTimer) return;
|
|
15624
16022
|
|
|
15625
16023
|
// Store bound functions for proper cleanup
|
|
@@ -15628,20 +16026,20 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15628
16026
|
this.boundOnWebGLContextLost = this.onWebGLContextLost.bind(this);
|
|
15629
16027
|
this.boundOnWebGLContextRestored = this.onWebGLContextRestored.bind(this);
|
|
15630
16028
|
this.retryTimer = setInterval(function () {
|
|
15631
|
-
if (!
|
|
15632
|
-
|
|
16029
|
+
if (!_this15.map.getSource("indoorequal")) {
|
|
16030
|
+
_this15.failedTiles.clear();
|
|
15633
16031
|
return;
|
|
15634
16032
|
}
|
|
15635
|
-
var source =
|
|
16033
|
+
var source = _this15.map.getSource("indoorequal");
|
|
15636
16034
|
if (!source || source.type !== "vector") {
|
|
15637
|
-
|
|
16035
|
+
_this15.failedTiles.clear();
|
|
15638
16036
|
return;
|
|
15639
16037
|
}
|
|
15640
16038
|
|
|
15641
16039
|
// Process tiles and remove invalid ones
|
|
15642
16040
|
var tilesToRetry = [];
|
|
15643
16041
|
var tilesToRemove = [];
|
|
15644
|
-
|
|
16042
|
+
_this15.failedTiles.forEach(function (tile) {
|
|
15645
16043
|
// Check if tile is still valid before attempting reload
|
|
15646
16044
|
if (!tile || tile.state === "unloaded" || tile.state === "loading") {
|
|
15647
16045
|
tilesToRemove.push(tile);
|
|
@@ -15659,7 +16057,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15659
16057
|
|
|
15660
16058
|
// Remove invalid tiles from the set
|
|
15661
16059
|
tilesToRemove.forEach(function (tile) {
|
|
15662
|
-
return
|
|
16060
|
+
return _this15.failedTiles["delete"](tile);
|
|
15663
16061
|
});
|
|
15664
16062
|
|
|
15665
16063
|
// Attempt to reload valid failed tiles
|
|
@@ -15671,7 +16069,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15671
16069
|
}
|
|
15672
16070
|
} catch (error) {
|
|
15673
16071
|
// If reload fails, remove tile from retry queue - this is expected
|
|
15674
|
-
|
|
16072
|
+
_this15.failedTiles["delete"](tile);
|
|
15675
16073
|
}
|
|
15676
16074
|
});
|
|
15677
16075
|
}, 1000);
|
|
@@ -15820,6 +16218,7 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15820
16218
|
var _this;
|
|
15821
16219
|
sdk_classCallCheck(this, InternalMapVXSDK);
|
|
15822
16220
|
_this = sdk_callSuper(this, InternalMapVXSDK);
|
|
16221
|
+
sdk_defineProperty(_this, "maps", []);
|
|
15823
16222
|
sdk_defineProperty(_this, "geoLocation", navigator.geolocation);
|
|
15824
16223
|
sdk_defineProperty(_this, "headingListeners", []);
|
|
15825
16224
|
_this.token = token;
|
|
@@ -15853,6 +16252,17 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15853
16252
|
value: function setSdkLang(lang) {
|
|
15854
16253
|
this.config.lang = lang;
|
|
15855
16254
|
this.repository.setLang(lang);
|
|
16255
|
+
this.maps.forEach(function (map) {
|
|
16256
|
+
return map.setLang(lang);
|
|
16257
|
+
});
|
|
16258
|
+
}
|
|
16259
|
+
}, {
|
|
16260
|
+
key: "unregisterMap",
|
|
16261
|
+
value: function unregisterMap(map) {
|
|
16262
|
+
var mapIndex = this.maps.indexOf(map);
|
|
16263
|
+
if (mapIndex >= 0) {
|
|
16264
|
+
this.maps.splice(mapIndex, 1);
|
|
16265
|
+
}
|
|
15856
16266
|
}
|
|
15857
16267
|
}, {
|
|
15858
16268
|
key: "getPlaceDetail",
|
|
@@ -15926,11 +16336,21 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15926
16336
|
}, {
|
|
15927
16337
|
key: "createMap",
|
|
15928
16338
|
value: function createMap(container, mapConfig) {
|
|
16339
|
+
var _this2 = this;
|
|
15929
16340
|
try {
|
|
15930
16341
|
mapConfig.lang = this.config.lang;
|
|
15931
16342
|
mapConfig.apiUrl = this.config.apiUrl;
|
|
15932
16343
|
mapConfig.mapvxRequestContext = this.config.mapvxRequestContext;
|
|
15933
16344
|
var map = new InternalMapVXMap(mapConfig, container, this.token);
|
|
16345
|
+
var originalDestroyMap = map.destroyMap.bind(map);
|
|
16346
|
+
map.destroyMap = function () {
|
|
16347
|
+
try {
|
|
16348
|
+
originalDestroyMap();
|
|
16349
|
+
} finally {
|
|
16350
|
+
_this2.unregisterMap(map);
|
|
16351
|
+
}
|
|
16352
|
+
};
|
|
16353
|
+
this.maps.push(map);
|
|
15934
16354
|
this.logEvent("createMap");
|
|
15935
16355
|
return map;
|
|
15936
16356
|
} catch (error) {
|
|
@@ -16327,7 +16747,7 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
16327
16747
|
return _searchPlacesByTags.apply(this, arguments);
|
|
16328
16748
|
}
|
|
16329
16749
|
return searchPlacesByTags;
|
|
16330
|
-
}()
|
|
16750
|
+
}()
|
|
16331
16751
|
}, {
|
|
16332
16752
|
key: "getPlacesByCategory",
|
|
16333
16753
|
value: function () {
|
|
@@ -16363,14 +16783,14 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
16363
16783
|
}, {
|
|
16364
16784
|
key: "getUserLocation",
|
|
16365
16785
|
value: function getUserLocation() {
|
|
16366
|
-
var
|
|
16786
|
+
var _this3 = this;
|
|
16367
16787
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
16368
16788
|
enableHighAccuracy: true,
|
|
16369
16789
|
timeout: 60 * 1000,
|
|
16370
16790
|
maximumAge: 10 * 1000
|
|
16371
16791
|
};
|
|
16372
16792
|
return new Promise(function (resolve, reject) {
|
|
16373
|
-
|
|
16793
|
+
_this3.geoLocation.getCurrentPosition(function (position) {
|
|
16374
16794
|
resolve(position);
|
|
16375
16795
|
}, function (error) {
|
|
16376
16796
|
reject(error);
|
|
@@ -16574,13 +16994,29 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
16574
16994
|
* @group Utils
|
|
16575
16995
|
*/
|
|
16576
16996
|
|
|
16997
|
+
/**
|
|
16998
|
+
* Represents a category containing a image url.
|
|
16999
|
+
* @group Utils
|
|
17000
|
+
*/
|
|
17001
|
+
|
|
16577
17002
|
/**
|
|
16578
17003
|
* Represents a category containing an icon.
|
|
16579
17004
|
* @group Utils
|
|
16580
17005
|
*/
|
|
16581
17006
|
|
|
16582
17007
|
/**
|
|
16583
|
-
*
|
|
17008
|
+
* Holds the basic information of a category: its `id`, `name` and an optional `description`.
|
|
17009
|
+
*
|
|
17010
|
+
* A category may optionally carry a graphical representation, but it is not required.
|
|
17011
|
+
* Depending on the available asset, a `BasicCategory` can be one of:
|
|
17012
|
+
*
|
|
17013
|
+
* - {@link BasicWithLogo} — the category provides a logo image (URL).
|
|
17014
|
+
* - {@link BasicWithIcon} — the category provides a Font Awesome icon name (and optional style).
|
|
17015
|
+
* - {@link BasicWithImageUrl} — the category provides an image URL for its icon.
|
|
17016
|
+
* - {@link Basic} — the category carries no graphical information at all.
|
|
17017
|
+
*
|
|
17018
|
+
* Use the {@link isBasicWithLogo}, {@link isBasicWithIcon} and {@link isBasicWithImageUrl}
|
|
17019
|
+
* type guards to narrow a `BasicCategory` and safely access its graphical asset.
|
|
16584
17020
|
* @group Utils
|
|
16585
17021
|
*/
|
|
16586
17022
|
|
|
@@ -16634,132 +17070,36 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
16634
17070
|
*/
|
|
16635
17071
|
|
|
16636
17072
|
/**
|
|
16637
|
-
* Checks if the category
|
|
16638
|
-
*
|
|
16639
|
-
* @param category
|
|
16640
|
-
* @returns
|
|
17073
|
+
* Checks if the category carries a logo image.
|
|
17074
|
+
* @group Utils
|
|
17075
|
+
* @param category - The category to inspect.
|
|
17076
|
+
* @returns `true` if the category exposes a non-empty `logo` URL, narrowing it to {@link BasicWithLogo}.
|
|
16641
17077
|
*/
|
|
16642
17078
|
function isBasicWithLogo(category) {
|
|
16643
|
-
|
|
17079
|
+
var input = category;
|
|
17080
|
+
return input.logo != null && input.logo !== "";
|
|
16644
17081
|
}
|
|
16645
17082
|
|
|
16646
17083
|
/**
|
|
16647
|
-
* Checks if the category
|
|
17084
|
+
* Checks if the category carries a Font Awesome icon.
|
|
16648
17085
|
* @group Utils
|
|
16649
|
-
* @param category
|
|
16650
|
-
* @returns
|
|
17086
|
+
* @param category - The category to inspect.
|
|
17087
|
+
* @returns `true` if the category exposes a non-empty `icon` name, narrowing it to {@link BasicWithIcon}.
|
|
16651
17088
|
*/
|
|
16652
17089
|
function isBasicWithIcon(category) {
|
|
16653
|
-
|
|
16654
|
-
|
|
16655
|
-
;// ./src/utils/update-css.ts
|
|
16656
|
-
function update_css_slicedToArray(r, e) { return update_css_arrayWithHoles(r) || update_css_iterableToArrayLimit(r, e) || update_css_unsupportedIterableToArray(r, e) || update_css_nonIterableRest(); }
|
|
16657
|
-
function update_css_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16658
|
-
function update_css_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return update_css_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) ? update_css_arrayLikeToArray(r, a) : void 0; } }
|
|
16659
|
-
function update_css_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; }
|
|
16660
|
-
function update_css_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16661
|
-
function update_css_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16662
|
-
/**
|
|
16663
|
-
* Load a CSS customization of a project.
|
|
16664
|
-
*
|
|
16665
|
-
* This function create a new HTML Style Element and add it to the current document.
|
|
16666
|
-
* Also activate the customization adding the first theme name to the body of the document.
|
|
16667
|
-
*
|
|
16668
|
-
* @group Utils
|
|
16669
|
-
* @param data The CSS customization data.
|
|
16670
|
-
*/
|
|
16671
|
-
function loadCustomization(data) {
|
|
16672
|
-
var style = document.createElement("style");
|
|
16673
|
-
style.textContent = "";
|
|
16674
|
-
for (var _i = 0, _Object$entries = Object.entries(data); _i < _Object$entries.length; _i++) {
|
|
16675
|
-
var _Object$entries$_i = update_css_slicedToArray(_Object$entries[_i], 2),
|
|
16676
|
-
themeName = _Object$entries$_i[0],
|
|
16677
|
-
themeData = _Object$entries$_i[1];
|
|
16678
|
-
var cssClass = loadTheme(themeName, themeData);
|
|
16679
|
-
style.textContent += cssClass;
|
|
16680
|
-
}
|
|
16681
|
-
document.head.appendChild(style);
|
|
16682
|
-
var firstThemeName = Object.keys(data).at(0);
|
|
16683
|
-
if (firstThemeName != null) {
|
|
16684
|
-
document.body.classList.add(firstThemeName);
|
|
16685
|
-
}
|
|
17090
|
+
var input = category;
|
|
17091
|
+
return input.icon != null && input.icon !== "";
|
|
16686
17092
|
}
|
|
16687
17093
|
|
|
16688
17094
|
/**
|
|
16689
|
-
*
|
|
16690
|
-
*
|
|
16691
|
-
* @group Utils
|
|
16692
|
-
* @param themeName The name of the Theme.
|
|
16693
|
-
* @param themeData The data of the Theme.
|
|
16694
|
-
* @returns A string with the processed theme to use on a CSS file.
|
|
16695
|
-
*/
|
|
16696
|
-
function loadTheme(themeName, themeData) {
|
|
16697
|
-
var cssClass = ".".concat(themeName, " {\n");
|
|
16698
|
-
var definitions = themeData.definitions;
|
|
16699
|
-
if (definitions != null) {
|
|
16700
|
-
cssClass = loadDefinitions(definitions, cssClass);
|
|
16701
|
-
}
|
|
16702
|
-
for (var _i2 = 0, _Object$entries2 = Object.entries((_themeData$screens = themeData.screens) !== null && _themeData$screens !== void 0 ? _themeData$screens : {}); _i2 < _Object$entries2.length; _i2++) {
|
|
16703
|
-
var _themeData$screens;
|
|
16704
|
-
var _Object$entries2$_i = update_css_slicedToArray(_Object$entries2[_i2], 2),
|
|
16705
|
-
screenName = _Object$entries2$_i[0],
|
|
16706
|
-
screenData = _Object$entries2$_i[1];
|
|
16707
|
-
for (var _i3 = 0, _Object$entries3 = Object.entries(screenData); _i3 < _Object$entries3.length; _i3++) {
|
|
16708
|
-
var _Object$entries3$_i = update_css_slicedToArray(_Object$entries3[_i3], 2),
|
|
16709
|
-
componentName = _Object$entries3$_i[0],
|
|
16710
|
-
componentData = _Object$entries3$_i[1];
|
|
16711
|
-
for (var _i4 = 0, _Object$entries4 = Object.entries(componentData); _i4 < _Object$entries4.length; _i4++) {
|
|
16712
|
-
var _Object$entries4$_i = update_css_slicedToArray(_Object$entries4[_i4], 2),
|
|
16713
|
-
elementName = _Object$entries4$_i[0],
|
|
16714
|
-
elementData = _Object$entries4$_i[1];
|
|
16715
|
-
for (var _i5 = 0, _Object$entries5 = Object.entries(elementData); _i5 < _Object$entries5.length; _i5++) {
|
|
16716
|
-
var _Object$entries5$_i = update_css_slicedToArray(_Object$entries5[_i5], 2),
|
|
16717
|
-
propertyName = _Object$entries5$_i[0],
|
|
16718
|
-
propertyValue = _Object$entries5$_i[1];
|
|
16719
|
-
cssClass += " --".concat(screenName, "-").concat(componentName, "-").concat(elementName, "-").concat(propertyName, ": ").concat(propertyValue, ";\n");
|
|
16720
|
-
}
|
|
16721
|
-
}
|
|
16722
|
-
}
|
|
16723
|
-
}
|
|
16724
|
-
cssClass += "}\n";
|
|
16725
|
-
return cssClass;
|
|
16726
|
-
}
|
|
16727
|
-
/**
|
|
16728
|
-
* Process the definitions of a theme.
|
|
16729
|
-
*
|
|
17095
|
+
* Checks if the category carries an image URL.
|
|
16730
17096
|
* @group Utils
|
|
16731
|
-
* @param
|
|
16732
|
-
* @
|
|
16733
|
-
* @returns The cssClass string mutated with the processed definitions.
|
|
17097
|
+
* @param category - The category to inspect.
|
|
17098
|
+
* @returns `true` if the category exposes a non-empty `imageUrl`, narrowing it to {@link BasicWithImageUrl}.
|
|
16734
17099
|
*/
|
|
16735
|
-
function
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
var _Object$entries6$_i = update_css_slicedToArray(_Object$entries6[_i6], 2),
|
|
16739
|
-
colorName = _Object$entries6$_i[0],
|
|
16740
|
-
colorData = _Object$entries6$_i[1];
|
|
16741
|
-
for (var _i7 = 0, _Object$entries7 = Object.entries(colorData); _i7 < _Object$entries7.length; _i7++) {
|
|
16742
|
-
var _Object$entries7$_i = update_css_slicedToArray(_Object$entries7[_i7], 2),
|
|
16743
|
-
colorIntensity = _Object$entries7$_i[0],
|
|
16744
|
-
colorValue = _Object$entries7$_i[1];
|
|
16745
|
-
cssClass += " --definitions-colors-".concat(colorName, "-").concat(colorIntensity, ": ").concat(colorValue, ";\n");
|
|
16746
|
-
}
|
|
16747
|
-
}
|
|
16748
|
-
for (var _i8 = 0, _Object$entries8 = Object.entries((_definitions$shadows = definitions.shadows) !== null && _definitions$shadows !== void 0 ? _definitions$shadows : {}); _i8 < _Object$entries8.length; _i8++) {
|
|
16749
|
-
var _definitions$shadows;
|
|
16750
|
-
var _Object$entries8$_i = update_css_slicedToArray(_Object$entries8[_i8], 2),
|
|
16751
|
-
shadowName = _Object$entries8$_i[0],
|
|
16752
|
-
shadowValue = _Object$entries8$_i[1];
|
|
16753
|
-
cssClass += " --definitions-shadows-".concat(shadowName, ": ").concat(shadowValue, ";\n");
|
|
16754
|
-
}
|
|
16755
|
-
for (var _i9 = 0, _Object$entries9 = Object.entries((_definitions$textFont = definitions.textFonts) !== null && _definitions$textFont !== void 0 ? _definitions$textFont : {}); _i9 < _Object$entries9.length; _i9++) {
|
|
16756
|
-
var _definitions$textFont;
|
|
16757
|
-
var _Object$entries9$_i = update_css_slicedToArray(_Object$entries9[_i9], 2),
|
|
16758
|
-
fontName = _Object$entries9$_i[0],
|
|
16759
|
-
fontValue = _Object$entries9$_i[1];
|
|
16760
|
-
cssClass += " --definitions-textFonts-".concat(fontName, ": ").concat(fontValue, ";\n");
|
|
16761
|
-
}
|
|
16762
|
-
return cssClass;
|
|
17100
|
+
function isBasicWithImageUrl(category) {
|
|
17101
|
+
var input = category;
|
|
17102
|
+
return input.imageUrl != null && input.imageUrl !== "";
|
|
16763
17103
|
}
|
|
16764
17104
|
;// ./src/utils/opening-hours-helper.ts
|
|
16765
17105
|
function opening_hours_helper_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = opening_hours_helper_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; } } }; }
|
|
@@ -17901,6 +18241,115 @@ function normalizeOrigin(raw) {
|
|
|
17901
18241
|
return null;
|
|
17902
18242
|
}
|
|
17903
18243
|
}
|
|
18244
|
+
;// ./src/utils/update-css.ts
|
|
18245
|
+
function update_css_slicedToArray(r, e) { return update_css_arrayWithHoles(r) || update_css_iterableToArrayLimit(r, e) || update_css_unsupportedIterableToArray(r, e) || update_css_nonIterableRest(); }
|
|
18246
|
+
function update_css_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18247
|
+
function update_css_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return update_css_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) ? update_css_arrayLikeToArray(r, a) : void 0; } }
|
|
18248
|
+
function update_css_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; }
|
|
18249
|
+
function update_css_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18250
|
+
function update_css_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18251
|
+
/**
|
|
18252
|
+
* Load a CSS customization of a project.
|
|
18253
|
+
*
|
|
18254
|
+
* This function create a new HTML Style Element and add it to the current document.
|
|
18255
|
+
* Also activate the customization adding the first theme name to the body of the document.
|
|
18256
|
+
*
|
|
18257
|
+
* @group Utils
|
|
18258
|
+
* @param data The CSS customization data.
|
|
18259
|
+
*/
|
|
18260
|
+
function loadCustomization(data) {
|
|
18261
|
+
var style = document.createElement("style");
|
|
18262
|
+
style.textContent = "";
|
|
18263
|
+
for (var _i = 0, _Object$entries = Object.entries(data); _i < _Object$entries.length; _i++) {
|
|
18264
|
+
var _Object$entries$_i = update_css_slicedToArray(_Object$entries[_i], 2),
|
|
18265
|
+
themeName = _Object$entries$_i[0],
|
|
18266
|
+
themeData = _Object$entries$_i[1];
|
|
18267
|
+
var cssClass = loadTheme(themeName, themeData);
|
|
18268
|
+
style.textContent += cssClass;
|
|
18269
|
+
}
|
|
18270
|
+
document.head.appendChild(style);
|
|
18271
|
+
var firstThemeName = Object.keys(data).at(0);
|
|
18272
|
+
if (firstThemeName != null) {
|
|
18273
|
+
document.body.classList.add(firstThemeName);
|
|
18274
|
+
}
|
|
18275
|
+
}
|
|
18276
|
+
|
|
18277
|
+
/**
|
|
18278
|
+
* Process a theme.
|
|
18279
|
+
*
|
|
18280
|
+
* @group Utils
|
|
18281
|
+
* @param themeName The name of the Theme.
|
|
18282
|
+
* @param themeData The data of the Theme.
|
|
18283
|
+
* @returns A string with the processed theme to use on a CSS file.
|
|
18284
|
+
*/
|
|
18285
|
+
function loadTheme(themeName, themeData) {
|
|
18286
|
+
var cssClass = ".".concat(themeName, " {\n");
|
|
18287
|
+
var definitions = themeData.definitions;
|
|
18288
|
+
if (definitions != null) {
|
|
18289
|
+
cssClass = loadDefinitions(definitions, cssClass);
|
|
18290
|
+
}
|
|
18291
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries((_themeData$screens = themeData.screens) !== null && _themeData$screens !== void 0 ? _themeData$screens : {}); _i2 < _Object$entries2.length; _i2++) {
|
|
18292
|
+
var _themeData$screens;
|
|
18293
|
+
var _Object$entries2$_i = update_css_slicedToArray(_Object$entries2[_i2], 2),
|
|
18294
|
+
screenName = _Object$entries2$_i[0],
|
|
18295
|
+
screenData = _Object$entries2$_i[1];
|
|
18296
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(screenData); _i3 < _Object$entries3.length; _i3++) {
|
|
18297
|
+
var _Object$entries3$_i = update_css_slicedToArray(_Object$entries3[_i3], 2),
|
|
18298
|
+
componentName = _Object$entries3$_i[0],
|
|
18299
|
+
componentData = _Object$entries3$_i[1];
|
|
18300
|
+
for (var _i4 = 0, _Object$entries4 = Object.entries(componentData); _i4 < _Object$entries4.length; _i4++) {
|
|
18301
|
+
var _Object$entries4$_i = update_css_slicedToArray(_Object$entries4[_i4], 2),
|
|
18302
|
+
elementName = _Object$entries4$_i[0],
|
|
18303
|
+
elementData = _Object$entries4$_i[1];
|
|
18304
|
+
for (var _i5 = 0, _Object$entries5 = Object.entries(elementData); _i5 < _Object$entries5.length; _i5++) {
|
|
18305
|
+
var _Object$entries5$_i = update_css_slicedToArray(_Object$entries5[_i5], 2),
|
|
18306
|
+
propertyName = _Object$entries5$_i[0],
|
|
18307
|
+
propertyValue = _Object$entries5$_i[1];
|
|
18308
|
+
cssClass += " --".concat(screenName, "-").concat(componentName, "-").concat(elementName, "-").concat(propertyName, ": ").concat(propertyValue, ";\n");
|
|
18309
|
+
}
|
|
18310
|
+
}
|
|
18311
|
+
}
|
|
18312
|
+
}
|
|
18313
|
+
cssClass += "}\n";
|
|
18314
|
+
return cssClass;
|
|
18315
|
+
}
|
|
18316
|
+
/**
|
|
18317
|
+
* Process the definitions of a theme.
|
|
18318
|
+
*
|
|
18319
|
+
* @group Utils
|
|
18320
|
+
* @param definitions The definitions of the theme.
|
|
18321
|
+
* @param cssClass The string object that will contain the processed theme
|
|
18322
|
+
* @returns The cssClass string mutated with the processed definitions.
|
|
18323
|
+
*/
|
|
18324
|
+
function loadDefinitions(definitions, cssClass) {
|
|
18325
|
+
for (var _i6 = 0, _Object$entries6 = Object.entries((_definitions$colors = definitions.colors) !== null && _definitions$colors !== void 0 ? _definitions$colors : {}); _i6 < _Object$entries6.length; _i6++) {
|
|
18326
|
+
var _definitions$colors;
|
|
18327
|
+
var _Object$entries6$_i = update_css_slicedToArray(_Object$entries6[_i6], 2),
|
|
18328
|
+
colorName = _Object$entries6$_i[0],
|
|
18329
|
+
colorData = _Object$entries6$_i[1];
|
|
18330
|
+
for (var _i7 = 0, _Object$entries7 = Object.entries(colorData); _i7 < _Object$entries7.length; _i7++) {
|
|
18331
|
+
var _Object$entries7$_i = update_css_slicedToArray(_Object$entries7[_i7], 2),
|
|
18332
|
+
colorIntensity = _Object$entries7$_i[0],
|
|
18333
|
+
colorValue = _Object$entries7$_i[1];
|
|
18334
|
+
cssClass += " --definitions-colors-".concat(colorName, "-").concat(colorIntensity, ": ").concat(colorValue, ";\n");
|
|
18335
|
+
}
|
|
18336
|
+
}
|
|
18337
|
+
for (var _i8 = 0, _Object$entries8 = Object.entries((_definitions$shadows = definitions.shadows) !== null && _definitions$shadows !== void 0 ? _definitions$shadows : {}); _i8 < _Object$entries8.length; _i8++) {
|
|
18338
|
+
var _definitions$shadows;
|
|
18339
|
+
var _Object$entries8$_i = update_css_slicedToArray(_Object$entries8[_i8], 2),
|
|
18340
|
+
shadowName = _Object$entries8$_i[0],
|
|
18341
|
+
shadowValue = _Object$entries8$_i[1];
|
|
18342
|
+
cssClass += " --definitions-shadows-".concat(shadowName, ": ").concat(shadowValue, ";\n");
|
|
18343
|
+
}
|
|
18344
|
+
for (var _i9 = 0, _Object$entries9 = Object.entries((_definitions$textFont = definitions.textFonts) !== null && _definitions$textFont !== void 0 ? _definitions$textFont : {}); _i9 < _Object$entries9.length; _i9++) {
|
|
18345
|
+
var _definitions$textFont;
|
|
18346
|
+
var _Object$entries9$_i = update_css_slicedToArray(_Object$entries9[_i9], 2),
|
|
18347
|
+
fontName = _Object$entries9$_i[0],
|
|
18348
|
+
fontValue = _Object$entries9$_i[1];
|
|
18349
|
+
cssClass += " --definitions-textFonts-".concat(fontName, ": ").concat(fontValue, ";\n");
|
|
18350
|
+
}
|
|
18351
|
+
return cssClass;
|
|
18352
|
+
}
|
|
17904
18353
|
;// ./src/index.ts
|
|
17905
18354
|
// ─── Domain Ports (interfaces) ───────────────────────────────────────────────
|
|
17906
18355
|
|