@mapvx/web-js 1.1.1 → 1.1.2-alpha.3
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/circle.js +253 -0
- package/dist/cjs/domain/models/circle.js.map +1 -0
- 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 +21 -10
- 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 +446 -28
- 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/circle.d.ts +222 -0
- package/dist/es/domain/models/circle.d.ts.map +1 -0
- package/dist/es/domain/models/circle.js +246 -0
- package/dist/es/domain/models/circle.js.map +1 -0
- 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 +14 -11
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +9 -5
- 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 +298 -0
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +447 -29
- 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 +1792 -657
- 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
|
@@ -5721,13 +5721,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5721
5721
|
__webpack_require__.d(__webpack_exports__, {
|
|
5722
5722
|
AnnounceFormat: () => (/* reexport */ AnnounceFormat),
|
|
5723
5723
|
Banner: () => (/* reexport */ Banner),
|
|
5724
|
+
CIRCLE_DEFAULTS: () => (/* reexport */ CIRCLE_DEFAULTS),
|
|
5724
5725
|
CacheManager: () => (/* reexport */ CacheManager),
|
|
5725
5726
|
CountlyLogger: () => (/* reexport */ CountlyLogger),
|
|
5726
5727
|
DEFAULT_CACHE_CONFIGS: () => (/* reexport */ DEFAULT_CACHE_CONFIGS),
|
|
5727
5728
|
DEFAULT_MAX_STORAGE_BYTES: () => (/* reexport */ DEFAULT_MAX_STORAGE_BYTES),
|
|
5729
|
+
DEFAULT_TILE_CACHE_CONFIG: () => (/* reexport */ DEFAULT_TILE_CACHE_CONFIG),
|
|
5728
5730
|
FetchHttpClient: () => (/* reexport */ FetchHttpClient),
|
|
5729
5731
|
Institution: () => (/* reexport */ Institution),
|
|
5730
5732
|
LRUCache: () => (/* reexport */ LRUCache),
|
|
5733
|
+
MAPLIBRE_MAX_TILE_CACHE_HARD_CAP: () => (/* reexport */ MAPLIBRE_MAX_TILE_CACHE_HARD_CAP),
|
|
5734
|
+
MAPVX_BRAND_COLOR: () => (/* reexport */ MAPVX_BRAND_COLOR),
|
|
5731
5735
|
MAPVX_DEFAULT_PRECONNECT_HOSTS: () => (/* reexport */ MAPVX_DEFAULT_PRECONNECT_HOSTS),
|
|
5732
5736
|
MVXPlace: () => (/* reexport */ place_MVXPlace),
|
|
5733
5737
|
MVXRoute: () => (/* reexport */ MVXRoute),
|
|
@@ -5739,18 +5743,119 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5739
5743
|
TextPosition: () => (/* reexport */ TextPosition),
|
|
5740
5744
|
TransportationMode: () => (/* reexport */ TransportationMode),
|
|
5741
5745
|
UnitSystem: () => (/* reexport */ UnitSystem),
|
|
5746
|
+
circleRing: () => (/* reexport */ circleRing),
|
|
5742
5747
|
createRouteAnimationIconDataUrl: () => (/* reexport */ createRouteAnimationIconDataUrl),
|
|
5743
5748
|
initializeSDK: () => (/* reexport */ initializeSDK),
|
|
5744
5749
|
injectPreconnects: () => (/* reexport */ injectPreconnects),
|
|
5745
5750
|
isBasicWithIcon: () => (/* reexport */ isBasicWithIcon),
|
|
5751
|
+
isBasicWithImageUrl: () => (/* reexport */ isBasicWithImageUrl),
|
|
5746
5752
|
isBasicWithLogo: () => (/* reexport */ isBasicWithLogo),
|
|
5747
5753
|
isMapVxRequestHostname: () => (/* reexport */ isMapVxRequestHostname),
|
|
5754
|
+
isValidCircleConfig: () => (/* reexport */ isValidCircleConfig),
|
|
5748
5755
|
loadCustomization: () => (/* reexport */ loadCustomization),
|
|
5749
5756
|
loadStyles: () => (/* binding */ loadStyles)
|
|
5750
5757
|
});
|
|
5751
5758
|
|
|
5752
|
-
;// ./src/infrastructure/cache/
|
|
5759
|
+
;// ./src/infrastructure/cache/cacheConfig.ts
|
|
5753
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); }
|
|
5754
5859
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
5755
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."); }
|
|
5756
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; } }
|
|
@@ -5759,11 +5864,11 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
5759
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; } }
|
|
5760
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; }
|
|
5761
5866
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5762
|
-
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); } }
|
|
5763
5868
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5764
|
-
function
|
|
5765
|
-
function
|
|
5766
|
-
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); }
|
|
5767
5872
|
/**
|
|
5768
5873
|
* Internal cache entry structure
|
|
5769
5874
|
*/
|
|
@@ -5790,10 +5895,10 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
5790
5895
|
function LRUCache(config) {
|
|
5791
5896
|
_classCallCheck(this, LRUCache);
|
|
5792
5897
|
// Hit rate tracking
|
|
5793
|
-
|
|
5794
|
-
|
|
5898
|
+
LRUCache_defineProperty(this, "hits", 0);
|
|
5899
|
+
LRUCache_defineProperty(this, "misses", 0);
|
|
5795
5900
|
// Monotonic counter for LRU ordering (avoids issues with same-millisecond operations)
|
|
5796
|
-
|
|
5901
|
+
LRUCache_defineProperty(this, "accessCounter", 0);
|
|
5797
5902
|
this.cache = new Map();
|
|
5798
5903
|
this.maxItems = config.maxItems;
|
|
5799
5904
|
this.ttlMs = config.ttlMs;
|
|
@@ -5961,104 +6066,6 @@ var LRUCache = /*#__PURE__*/function () {
|
|
|
5961
6066
|
}
|
|
5962
6067
|
}]);
|
|
5963
6068
|
}();
|
|
5964
|
-
;// ./src/infrastructure/cache/cacheConfig.ts
|
|
5965
|
-
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); }
|
|
5966
|
-
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; }
|
|
5967
|
-
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; }
|
|
5968
|
-
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; }
|
|
5969
|
-
function cacheConfig_toPropertyKey(t) { var i = cacheConfig_toPrimitive(t, "string"); return "symbol" == cacheConfig_typeof(i) ? i : i + ""; }
|
|
5970
|
-
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); }
|
|
5971
|
-
/**
|
|
5972
|
-
* Cache configuration types and defaults
|
|
5973
|
-
* Defines the configuration options for the caching system
|
|
5974
|
-
* @module cacheConfig
|
|
5975
|
-
*/
|
|
5976
|
-
|
|
5977
|
-
/**
|
|
5978
|
-
* Cache types available in the SDK
|
|
5979
|
-
* @group Configuration
|
|
5980
|
-
*/
|
|
5981
|
-
|
|
5982
|
-
/**
|
|
5983
|
-
* Configuration for a single cache instance
|
|
5984
|
-
* @group Configuration
|
|
5985
|
-
*/
|
|
5986
|
-
|
|
5987
|
-
/**
|
|
5988
|
-
* Configuration for the CacheManager
|
|
5989
|
-
* @group Configuration
|
|
5990
|
-
*/
|
|
5991
|
-
|
|
5992
|
-
/**
|
|
5993
|
-
* Default maximum storage size: 5MB
|
|
5994
|
-
*/
|
|
5995
|
-
var DEFAULT_MAX_STORAGE_BYTES = 5 * 1024 * 1024;
|
|
5996
|
-
|
|
5997
|
-
/**
|
|
5998
|
-
* Default cache configurations per type
|
|
5999
|
-
* These values balance memory usage with performance
|
|
6000
|
-
*/
|
|
6001
|
-
var DEFAULT_CACHE_CONFIGS = {
|
|
6002
|
-
places: {
|
|
6003
|
-
maxItems: 500,
|
|
6004
|
-
ttlMs: 30 * 60 * 1000,
|
|
6005
|
-
// 30 minutes
|
|
6006
|
-
persistenceKey: "mvx_places"
|
|
6007
|
-
},
|
|
6008
|
-
routes: {
|
|
6009
|
-
maxItems: 100,
|
|
6010
|
-
ttlMs: 5 * 60 * 1000,
|
|
6011
|
-
// 5 minutes
|
|
6012
|
-
persistenceKey: "mvx_routes"
|
|
6013
|
-
},
|
|
6014
|
-
accessibleRoutes: {
|
|
6015
|
-
maxItems: 100,
|
|
6016
|
-
ttlMs: 5 * 60 * 1000,
|
|
6017
|
-
// 5 minutes
|
|
6018
|
-
persistenceKey: "mvx_accessible_routes"
|
|
6019
|
-
},
|
|
6020
|
-
configurations: {
|
|
6021
|
-
maxItems: 10,
|
|
6022
|
-
ttlMs: 60 * 60 * 1000,
|
|
6023
|
-
// 1 hour
|
|
6024
|
-
persistenceKey: "mvx_configurations"
|
|
6025
|
-
},
|
|
6026
|
-
categories: {
|
|
6027
|
-
maxItems: 20,
|
|
6028
|
-
ttlMs: 60 * 60 * 1000,
|
|
6029
|
-
// 1 hour
|
|
6030
|
-
persistenceKey: "mvx_categories"
|
|
6031
|
-
},
|
|
6032
|
-
vehicles: {
|
|
6033
|
-
maxItems: 50,
|
|
6034
|
-
ttlMs: 60 * 1000,
|
|
6035
|
-
// 1 minute
|
|
6036
|
-
persistenceKey: "mvx_vehicles"
|
|
6037
|
-
},
|
|
6038
|
-
stops: {
|
|
6039
|
-
maxItems: 100,
|
|
6040
|
-
ttlMs: 60 * 1000,
|
|
6041
|
-
// 1 minute
|
|
6042
|
-
persistenceKey: "mvx_stops"
|
|
6043
|
-
},
|
|
6044
|
-
subPlaces: {
|
|
6045
|
-
maxItems: 200,
|
|
6046
|
-
ttlMs: 15 * 60 * 1000,
|
|
6047
|
-
// 15 minutes
|
|
6048
|
-
persistenceKey: "mvx_subplaces"
|
|
6049
|
-
}
|
|
6050
|
-
};
|
|
6051
|
-
|
|
6052
|
-
/**
|
|
6053
|
-
* Merges user config with defaults for a specific cache type
|
|
6054
|
-
* @param cacheType - The type of cache
|
|
6055
|
-
* @param userConfig - Optional user-provided configuration
|
|
6056
|
-
* @returns Complete cache configuration
|
|
6057
|
-
*/
|
|
6058
|
-
function getCacheConfig(cacheType, userConfig) {
|
|
6059
|
-
var defaultConfig = DEFAULT_CACHE_CONFIGS[cacheType];
|
|
6060
|
-
return _objectSpread(_objectSpread({}, defaultConfig), userConfig);
|
|
6061
|
-
}
|
|
6062
6069
|
;// ./src/infrastructure/cache/PersistentCache.ts
|
|
6063
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); }
|
|
6064
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; } } }; }
|
|
@@ -6786,13 +6793,16 @@ var countly_default = /*#__PURE__*/__webpack_require__.n(countly);
|
|
|
6786
6793
|
var rollbar_umd_min = __webpack_require__(916);
|
|
6787
6794
|
var rollbar_umd_min_default = /*#__PURE__*/__webpack_require__.n(rollbar_umd_min);
|
|
6788
6795
|
;// ./src/logger/rollbar.ts
|
|
6789
|
-
// VERSION
|
|
6790
|
-
// bundle. The tsc-built ES/CJS outputs keep
|
|
6791
|
-
// typeof
|
|
6792
|
-
// replaced with the package version by
|
|
6793
|
-
|
|
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.1.2-alpha.3" : 0;
|
|
6803
|
+
var ACCESS_TOKEN = false ? 0 : "28279d52df43411ebd138c2bee0ab1df";
|
|
6794
6804
|
var _rollbarConfig = {
|
|
6795
|
-
accessToken:
|
|
6805
|
+
accessToken: ACCESS_TOKEN,
|
|
6796
6806
|
// Only report what the SDK logs explicitly via logError. Capturing every
|
|
6797
6807
|
// uncaught error / unhandled rejection on the host page floods Rollbar
|
|
6798
6808
|
// with items from third-party code (e.g. Countly, the host app itself)
|
|
@@ -6828,17 +6838,20 @@ function logger_toPrimitive(t, r) { if ("object" != logger_typeof(t) || !t) retu
|
|
|
6828
6838
|
|
|
6829
6839
|
|
|
6830
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.1.2-alpha.3" : 0;
|
|
6850
|
+
var COUNTLY_API_KEY = false ? 0 : "f0c8d3b96d336e857a8628f49dd1baf7d7add0e9";
|
|
6831
6851
|
var logger_countly = {
|
|
6832
|
-
apiKey:
|
|
6852
|
+
apiKey: COUNTLY_API_KEY,
|
|
6833
6853
|
url: "https://countly.lazarillo.app"
|
|
6834
6854
|
};
|
|
6835
|
-
// DEBUG and VERSION are webpack DefinePlugin constants, substituted only in
|
|
6836
|
-
// the UMD bundle. The tsc-built ES/CJS outputs keep them as bare globals, so
|
|
6837
|
-
// reading them directly throws ReferenceError in consumers of those builds.
|
|
6838
|
-
// The typeof guards make the lookup safe everywhere; the version placeholder
|
|
6839
|
-
// is replaced with the package version by scripts/inject-build-defines.js.
|
|
6840
|
-
var IS_DEBUG = true ? false : 0;
|
|
6841
|
-
var logger_SDK_VERSION = true ? "1.1.1" : 0;
|
|
6842
6855
|
var Logger = /*#__PURE__*/function () {
|
|
6843
6856
|
function Logger() {
|
|
6844
6857
|
logger_classCallCheck(this, Logger);
|
|
@@ -7030,6 +7043,174 @@ var CountlyLogger = /*#__PURE__*/function () {
|
|
|
7030
7043
|
// EXTERNAL MODULE: ./node_modules/.pnpm/maplibre-gl@5.7.0/node_modules/maplibre-gl/dist/maplibre-gl.js
|
|
7031
7044
|
var maplibre_gl = __webpack_require__(997);
|
|
7032
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
|
+
}();
|
|
7033
7214
|
;// ./src/assets/icons.ts
|
|
7034
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";
|
|
7035
7216
|
|
|
@@ -7042,7 +7223,7 @@ var userLocationDataUrl = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w
|
|
|
7042
7223
|
* Generates a data URL for the route animation icon SVG with customizable appearance.
|
|
7043
7224
|
*
|
|
7044
7225
|
* @param config - Optional configuration for the icon appearance.
|
|
7045
|
-
* @param config.backgroundColor - The background color of the circle (default: "#
|
|
7226
|
+
* @param config.backgroundColor - The background color of the circle (default: "#276EF1").
|
|
7046
7227
|
* @param config.arrowColor - The color of the arrow (default: "#FFFFFF").
|
|
7047
7228
|
* @param config.arrowWidth - The stroke width of the arrow path in pixels (default: 0).
|
|
7048
7229
|
* @param config.borderWidth - The border width of the circle in pixels (default: 0).
|
|
@@ -7074,7 +7255,7 @@ var userLocationDataUrl = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w
|
|
|
7074
7255
|
*/
|
|
7075
7256
|
function createRouteAnimationIconDataUrl(config) {
|
|
7076
7257
|
var _config$backgroundCol, _config$arrowColor, _config$arrowWidth, _config$borderWidth, _config$borderColor, _config$blur;
|
|
7077
|
-
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";
|
|
7078
7259
|
var arrowColor = (_config$arrowColor = config === null || config === void 0 ? void 0 : config.arrowColor) !== null && _config$arrowColor !== void 0 ? _config$arrowColor : "#FFFFFF";
|
|
7079
7260
|
var arrowWidth = (_config$arrowWidth = config === null || config === void 0 ? void 0 : config.arrowWidth) !== null && _config$arrowWidth !== void 0 ? _config$arrowWidth : 0;
|
|
7080
7261
|
var borderWidth = (_config$borderWidth = config === null || config === void 0 ? void 0 : config.borderWidth) !== null && _config$borderWidth !== void 0 ? _config$borderWidth : 0;
|
|
@@ -7093,7 +7274,7 @@ function createRouteAnimationIconDataUrl(config) {
|
|
|
7093
7274
|
var filterId = blur > 0 ? "blurFilter" : "";
|
|
7094
7275
|
var filterDef = blur > 0 ? "<defs><filter id=\"".concat(filterId, "\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"").concat(blur, "\"/></filter></defs>") : "";
|
|
7095
7276
|
var filterAttr = blur > 0 ? "filter=\"url(#".concat(filterId, ")\"") : "";
|
|
7096
|
-
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>");
|
|
7097
7278
|
|
|
7098
7279
|
// Encode the SVG as a data URL
|
|
7099
7280
|
var encodedSvg = encodeURIComponent(svg);
|
|
@@ -7101,7 +7282,7 @@ function createRouteAnimationIconDataUrl(config) {
|
|
|
7101
7282
|
}
|
|
7102
7283
|
|
|
7103
7284
|
/**
|
|
7104
|
-
* Default route animation icon data URL with blue background (#
|
|
7285
|
+
* Default route animation icon data URL with blue background (#276EF1) and white arrow (#FFFFFF).
|
|
7105
7286
|
* This constant is maintained for backward compatibility.
|
|
7106
7287
|
*
|
|
7107
7288
|
* @example
|
|
@@ -7223,6 +7404,10 @@ function getBoundingBox(points) {
|
|
|
7223
7404
|
return [southwest, northeast];
|
|
7224
7405
|
}
|
|
7225
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); }
|
|
7226
7411
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7227
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); }
|
|
7228
7413
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
@@ -7231,6 +7416,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
7231
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); }
|
|
7232
7417
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
7233
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; }
|
|
7234
7422
|
function marker_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
7235
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); } }
|
|
7236
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; }
|
|
@@ -7334,82 +7522,104 @@ var MarkerUtils = /*#__PURE__*/function () {
|
|
|
7334
7522
|
* ```
|
|
7335
7523
|
*/
|
|
7336
7524
|
function createMarkerElement(marker) {
|
|
7337
|
-
var _marker$iconPropertie, _marker$iconPropertie2, _marker$iconPropertie3, _marker$iconPropertie4;
|
|
7338
7525
|
var markerContainer = document.createElement("div");
|
|
7339
|
-
|
|
7340
|
-
// Configure specific marker dimensions
|
|
7341
|
-
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;
|
|
7342
|
-
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;
|
|
7343
|
-
|
|
7344
|
-
// Apply base class
|
|
7345
7526
|
markerContainer.className = "mapvx-marker";
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
markerContainer.classList.add("text-column");
|
|
7354
|
-
markerContainer.style.width = "".concat(Math.max(iconWidth, 200), "px");
|
|
7355
|
-
markerContainer.style.height = "auto";
|
|
7356
|
-
break;
|
|
7357
|
-
case TextPosition.left:
|
|
7358
|
-
case TextPosition.right:
|
|
7359
|
-
default:
|
|
7360
|
-
markerContainer.classList.add("text-row");
|
|
7361
|
-
markerContainer.style.width = "auto";
|
|
7362
|
-
markerContainer.style.height = "".concat(iconHeight, "px");
|
|
7363
|
-
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);
|
|
7364
7534
|
}
|
|
7365
|
-
}
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
markerContainer.style.height = "".concat(iconHeight, "px");
|
|
7370
|
-
}
|
|
7371
|
-
markerContainer.addEventListener("click", function () {
|
|
7372
|
-
var _marker$onClick;
|
|
7373
|
-
(_marker$onClick = marker.onClick) === null || _marker$onClick === void 0 || _marker$onClick.call(marker);
|
|
7374
|
-
});
|
|
7375
|
-
if (marker.element) {
|
|
7376
|
-
markerContainer.appendChild(marker.element);
|
|
7377
|
-
return this.setAndCreateText(marker, markerContainer, "".concat(iconHeight, "px"), "".concat(iconWidth, "px"));
|
|
7535
|
+
} catch (err) {
|
|
7536
|
+
_iterator.e(err);
|
|
7537
|
+
} finally {
|
|
7538
|
+
_iterator.f();
|
|
7378
7539
|
}
|
|
7540
|
+
return markerContainer;
|
|
7541
|
+
}
|
|
7379
7542
|
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
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");
|
|
7383
7558
|
|
|
7384
|
-
//
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
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 = "";
|
|
7388
7565
|
} else {
|
|
7389
|
-
|
|
7390
|
-
|
|
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");
|
|
7391
7582
|
}
|
|
7392
|
-
return markerContainer;
|
|
7393
7583
|
}
|
|
7394
7584
|
|
|
7395
7585
|
/**
|
|
7396
|
-
*
|
|
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.
|
|
7397
7590
|
*
|
|
7398
|
-
* @param
|
|
7399
|
-
* @
|
|
7400
|
-
* @param iconHeight - Height of the icon for positioning calculations
|
|
7401
|
-
* @param iconWidth - Width of the icon for positioning calculations
|
|
7402
|
-
* @returns Container element with properly positioned text
|
|
7591
|
+
* @param marker - Marker configuration
|
|
7592
|
+
* @returns The child elements to append to the container
|
|
7403
7593
|
*/
|
|
7404
7594
|
}, {
|
|
7405
|
-
key: "
|
|
7406
|
-
value: function
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
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));
|
|
7411
7605
|
}
|
|
7412
|
-
|
|
7606
|
+
if (marker.text) {
|
|
7607
|
+
children.push(this.buildTextContainer(marker));
|
|
7608
|
+
}
|
|
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);
|
|
7413
7623
|
}
|
|
7414
7624
|
|
|
7415
7625
|
/**
|
|
@@ -7443,7 +7653,8 @@ var MarkerUtils = /*#__PURE__*/function () {
|
|
|
7443
7653
|
|
|
7444
7654
|
/**
|
|
7445
7655
|
* Creates a text container with proper positioning using CSS classes.
|
|
7446
|
-
*
|
|
7656
|
+
* The container is absolutely positioned (out of flow) so the label
|
|
7657
|
+
* never grows the marker's anchored box.
|
|
7447
7658
|
*
|
|
7448
7659
|
* @param textElement - The text element to contain
|
|
7449
7660
|
* @param textPosition - Desired position relative to the icon
|
|
@@ -7495,11 +7706,11 @@ var MarkerUtils = /*#__PURE__*/function () {
|
|
|
7495
7706
|
}, {
|
|
7496
7707
|
key: "createIcon",
|
|
7497
7708
|
value: function createIcon(marker) {
|
|
7498
|
-
var _marker$
|
|
7709
|
+
var _marker$iconPropertie9, _marker$iconPropertie0, _marker$iconPropertie1, _marker$iconPropertie10;
|
|
7499
7710
|
var image = document.createElement("img");
|
|
7500
7711
|
image.src = typeof marker.icon == "string" ? marker.icon : "";
|
|
7501
|
-
image.width = (_marker$
|
|
7502
|
-
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;
|
|
7503
7714
|
image.style.objectFit = "contain";
|
|
7504
7715
|
image.style.filter = "drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))";
|
|
7505
7716
|
return image;
|
|
@@ -7568,6 +7779,12 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
|
|
|
7568
7779
|
* Used for indoor navigation and floor-specific marker management.
|
|
7569
7780
|
*/
|
|
7570
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
|
+
|
|
7571
7788
|
/**
|
|
7572
7789
|
* Constructs a new `MarkerAttribute` object with the specified properties.
|
|
7573
7790
|
*
|
|
@@ -7593,6 +7810,14 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
|
|
|
7593
7810
|
anchor: (_markerConfig$anchor = markerConfig.anchor) !== null && _markerConfig$anchor !== void 0 ? _markerConfig$anchor : "center",
|
|
7594
7811
|
offset: [0, 0]
|
|
7595
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
|
+
});
|
|
7596
7821
|
_this.setLngLat([markerConfig.coordinate.lng, markerConfig.coordinate.lat]);
|
|
7597
7822
|
_this.setRotationAlignment((_markerConfig$rotatio = markerConfig.rotationAlignment) !== null && _markerConfig$rotatio !== void 0 ? _markerConfig$rotatio : "viewport");
|
|
7598
7823
|
_this.setPitchAlignment("viewport");
|
|
@@ -7640,19 +7865,16 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
|
|
|
7640
7865
|
}, {
|
|
7641
7866
|
key: "updateIcon",
|
|
7642
7867
|
value: function updateIcon(marker) {
|
|
7643
|
-
var _marker$rotationAlign;
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
oldMarkerContent === null || oldMarkerContent === void 0 || (_oldMarkerContent$par = oldMarkerContent.parentElement) === null || _oldMarkerContent$par === void 0 || _oldMarkerContent$par.replaceChild(newMarkerContent, oldMarkerContent);
|
|
7654
|
-
}
|
|
7655
|
-
}
|
|
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;
|
|
7656
7878
|
this.setRotationAlignment((_marker$rotationAlign = marker.rotationAlignment) !== null && _marker$rotationAlign !== void 0 ? _marker$rotationAlign : "viewport");
|
|
7657
7879
|
this.setPitchAlignment("viewport");
|
|
7658
7880
|
if (typeof marker.rotation === "number") {
|
|
@@ -7734,6 +7956,52 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
|
|
|
7734
7956
|
}
|
|
7735
7957
|
}]);
|
|
7736
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
|
+
}
|
|
7737
8005
|
;// ./src/utils/nav-functions.ts
|
|
7738
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); }
|
|
7739
8007
|
function nav_functions_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -7913,60 +8181,14 @@ var NavFunctions = /*#__PURE__*/function () {
|
|
|
7913
8181
|
* The radius of the Earth in meters.
|
|
7914
8182
|
*/
|
|
7915
8183
|
nav_functions_defineProperty(NavFunctions, "EARTH_RADIUS", 6378000);
|
|
7916
|
-
;// ./src/domain/models/routeInstance.ts
|
|
7917
|
-
/**
|
|
7918
|
-
* Represents the conditions for the step animation.
|
|
7919
|
-
* @group Routes
|
|
7920
|
-
*/
|
|
7921
|
-
|
|
7922
|
-
/**
|
|
7923
|
-
* Represents a single route instance on the map with its own
|
|
7924
|
-
* MapLibre sources/layers, GeoJSON data, animation state, and marker.
|
|
7925
|
-
* @group Routes
|
|
7926
|
-
*/
|
|
7927
|
-
|
|
7928
|
-
/**
|
|
7929
|
-
* Creates a new RouteInstance from a route.
|
|
7930
|
-
* Each instance gets unique MapLibre source/layer IDs based on the route's UUID.
|
|
7931
|
-
* @param route The route to create an instance for.
|
|
7932
|
-
* @returns A new RouteInstance with initialized GeoJSON data structures.
|
|
7933
|
-
* @group Routes
|
|
7934
|
-
*/
|
|
7935
|
-
function createRouteInstance(route) {
|
|
7936
|
-
return {
|
|
7937
|
-
id: route.id,
|
|
7938
|
-
route: route,
|
|
7939
|
-
aheadId: "AHEAD_".concat(route.id),
|
|
7940
|
-
behindId: "BEHIND_".concat(route.id),
|
|
7941
|
-
currentId: "CURRENT_".concat(route.id),
|
|
7942
|
-
aheadSourceData: {
|
|
7943
|
-
type: "FeatureCollection",
|
|
7944
|
-
features: []
|
|
7945
|
-
},
|
|
7946
|
-
behindSourceData: {
|
|
7947
|
-
type: "FeatureCollection",
|
|
7948
|
-
features: []
|
|
7949
|
-
},
|
|
7950
|
-
currentSourceData: {
|
|
7951
|
-
type: "Feature",
|
|
7952
|
-
properties: {},
|
|
7953
|
-
geometry: {
|
|
7954
|
-
type: "LineString",
|
|
7955
|
-
coordinates: []
|
|
7956
|
-
}
|
|
7957
|
-
},
|
|
7958
|
-
animationStatus: "NO_ROUTE",
|
|
7959
|
-
stepAnimationStatus: "NO_ROUTE"
|
|
7960
|
-
};
|
|
7961
|
-
}
|
|
7962
8184
|
;// ./src/controllers/routeController.ts
|
|
7963
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); }
|
|
7964
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; }
|
|
7965
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; }
|
|
7966
|
-
function
|
|
7967
|
-
function
|
|
7968
|
-
function
|
|
7969
|
-
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); }
|
|
7970
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; } } }; }
|
|
7971
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; } }
|
|
7972
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; }
|
|
@@ -8341,7 +8563,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
8341
8563
|
throw new Error("Error: position array has different length than colors array");
|
|
8342
8564
|
}
|
|
8343
8565
|
var stops = createStops(positionsToUse, colors);
|
|
8344
|
-
var gradient = ["interpolate", ["linear"], ["line-progress"]].concat(
|
|
8566
|
+
var gradient = ["interpolate", ["linear"], ["line-progress"]].concat(routeController_toConsumableArray(stops));
|
|
8345
8567
|
return {
|
|
8346
8568
|
"line-color": null,
|
|
8347
8569
|
"line-gradient": gradient,
|
|
@@ -8588,7 +8810,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
8588
8810
|
this.removeSourcesAndLayersForRoute(instance);
|
|
8589
8811
|
this.routes["delete"](instance.id);
|
|
8590
8812
|
if (this.lastAddedRouteId === instance.id) {
|
|
8591
|
-
var remaining =
|
|
8813
|
+
var remaining = routeController_toConsumableArray(this.routes.keys());
|
|
8592
8814
|
this.lastAddedRouteId = remaining.length > 0 ? remaining[remaining.length - 1] : undefined;
|
|
8593
8815
|
}
|
|
8594
8816
|
}
|
|
@@ -8623,7 +8845,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
8623
8845
|
}, {
|
|
8624
8846
|
key: "getRouteIds",
|
|
8625
8847
|
value: function getRouteIds() {
|
|
8626
|
-
return
|
|
8848
|
+
return routeController_toConsumableArray(this.routes.keys());
|
|
8627
8849
|
}
|
|
8628
8850
|
}, {
|
|
8629
8851
|
key: "internalPause",
|
|
@@ -9132,6 +9354,27 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
9132
9354
|
return;
|
|
9133
9355
|
}
|
|
9134
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
|
+
}
|
|
9135
9378
|
var distance = NavFunctions.distance(start, end);
|
|
9136
9379
|
var speed = Math.max(step.distance / stepTime, minimumSpeed !== null && minimumSpeed !== void 0 ? minimumSpeed : 0);
|
|
9137
9380
|
if (speed * progressInSeconds > distance) {
|
|
@@ -9157,26 +9400,6 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
9157
9400
|
return _this8.animateStep(time, instance);
|
|
9158
9401
|
});
|
|
9159
9402
|
return;
|
|
9160
|
-
} else if (step.startInsideFloor !== step.endInsideFloor) {
|
|
9161
|
-
if (waitStartTime == null) {
|
|
9162
|
-
instance.conditions.waitStartTime = timestamp;
|
|
9163
|
-
instance.conditions.animationId = requestAnimationFrame(function (time) {
|
|
9164
|
-
return _this8.animateStep(time, instance);
|
|
9165
|
-
});
|
|
9166
|
-
return;
|
|
9167
|
-
}
|
|
9168
|
-
if (timestamp - waitStartTime < changeFloorTime * 1000) {
|
|
9169
|
-
instance.conditions.animationId = requestAnimationFrame(function (time) {
|
|
9170
|
-
return _this8.animateStep(time, instance);
|
|
9171
|
-
});
|
|
9172
|
-
return;
|
|
9173
|
-
} else {
|
|
9174
|
-
this.updatePlaceFloorForRouting(instance, step.endInsidePlace, step.endInsideFloor);
|
|
9175
|
-
this.setMarkerLngLat(instance, step.endLocation);
|
|
9176
|
-
instance.conditions.waitStartTime = undefined;
|
|
9177
|
-
onFinish === null || onFinish === void 0 || onFinish(timestamp);
|
|
9178
|
-
return;
|
|
9179
|
-
}
|
|
9180
9403
|
} else {
|
|
9181
9404
|
onFinish === null || onFinish === void 0 || onFinish(timestamp);
|
|
9182
9405
|
return;
|
|
@@ -9310,9 +9533,10 @@ var InternalGetRouteConfiguration = /*#__PURE__*/routeConfiguration_createClass(
|
|
|
9310
9533
|
* @param language The language for the instructions.
|
|
9311
9534
|
* @param unitSystem The unit system used for the distance.
|
|
9312
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.
|
|
9313
9537
|
*/
|
|
9314
9538
|
function InternalGetRouteConfiguration(config) {
|
|
9315
|
-
var _config$preferAccessi, _config$language, _config$unitSystem, _config$announceForma;
|
|
9539
|
+
var _config$preferAccessi, _config$language, _config$unitSystem, _config$announceForma, _config$userBearing;
|
|
9316
9540
|
routeConfiguration_classCallCheck(this, InternalGetRouteConfiguration);
|
|
9317
9541
|
this.initialLocation = config.initialLocation;
|
|
9318
9542
|
this.finalLocation = config.finalLocation;
|
|
@@ -9320,6 +9544,7 @@ function InternalGetRouteConfiguration(config) {
|
|
|
9320
9544
|
this.language = (_config$language = config.language) !== null && _config$language !== void 0 ? _config$language : "en";
|
|
9321
9545
|
this.unitSystem = (_config$unitSystem = config.unitSystem) !== null && _config$unitSystem !== void 0 ? _config$unitSystem : UnitSystem.metric;
|
|
9322
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;
|
|
9323
9548
|
});
|
|
9324
9549
|
|
|
9325
9550
|
/**
|
|
@@ -9350,6 +9575,16 @@ function InternalDrawRouteConfiguration(config) {
|
|
|
9350
9575
|
/**
|
|
9351
9576
|
* Interface that represent a place with their id.
|
|
9352
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
|
+
* ```
|
|
9353
9588
|
*/
|
|
9354
9589
|
|
|
9355
9590
|
/**
|
|
@@ -9404,11 +9639,11 @@ var InternalAnimationDrawingConfig = /*#__PURE__*/function () {
|
|
|
9404
9639
|
animation_classCallCheck(this, InternalAnimationDrawingConfig);
|
|
9405
9640
|
this.aheadPathStyle = (_data$aheadPathStyle = data.aheadPathStyle) !== null && _data$aheadPathStyle !== void 0 ? _data$aheadPathStyle : {
|
|
9406
9641
|
type: "Solid",
|
|
9407
|
-
color: "#
|
|
9642
|
+
color: "#0C0C0C"
|
|
9408
9643
|
};
|
|
9409
9644
|
this.behindPathStyle = (_data$behindPathStyle = data.behindPathStyle) !== null && _data$behindPathStyle !== void 0 ? _data$behindPathStyle : {
|
|
9410
9645
|
type: "Solid",
|
|
9411
|
-
color: "#
|
|
9646
|
+
color: "#276EF1"
|
|
9412
9647
|
};
|
|
9413
9648
|
this.polylineWidth = (_data$polylineWidth = data.polylineWidth) !== null && _data$polylineWidth !== void 0 ? _data$polylineWidth : 10;
|
|
9414
9649
|
if (data.routeIcon != null) {
|
|
@@ -9562,7 +9797,8 @@ var Loggeable = /*#__PURE__*/function () {
|
|
|
9562
9797
|
* maxTiles: 500,
|
|
9563
9798
|
* ttlMs: 60 * 60 * 1000, // 1 hour
|
|
9564
9799
|
* persistToServiceWorker: true,
|
|
9565
|
-
* preloadAdjacentZooms: false
|
|
9800
|
+
* preloadAdjacentZooms: false,
|
|
9801
|
+
* maxConcurrentTileFetches: 6
|
|
9566
9802
|
* };
|
|
9567
9803
|
* ```
|
|
9568
9804
|
*
|
|
@@ -9579,9 +9815,19 @@ var DEFAULT_TILE_CACHE_CONFIG = {
|
|
|
9579
9815
|
ttlMs: 30 * 60 * 1000,
|
|
9580
9816
|
// 30 minutes
|
|
9581
9817
|
persistToServiceWorker: true,
|
|
9582
|
-
preloadAdjacentZooms: false
|
|
9818
|
+
preloadAdjacentZooms: false,
|
|
9819
|
+
maxConcurrentTileFetches: 6
|
|
9583
9820
|
};
|
|
9584
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
|
+
|
|
9585
9831
|
/**
|
|
9586
9832
|
* Basic configuration for the map.
|
|
9587
9833
|
* Provides essential settings for initializing and customizing map behavior.
|
|
@@ -9619,11 +9865,298 @@ var DEFAULT_TILE_CACHE_CONFIG = {
|
|
|
9619
9865
|
* @property showZoom - (Optional) Whether to display the zoom control.
|
|
9620
9866
|
* @property navigationPosition - (Optional) Position of the navigation controls on the map.
|
|
9621
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.
|
|
9622
9876
|
* @property institutionId - (Optional) The institution identifier for map context. Required for loading map related data from Portal.
|
|
9623
9877
|
* @property authToken - (Optional) Authentication token for accessing protected map resources. Required for loading map related data from Portal.
|
|
9624
9878
|
* @property apiUrl - (Optional) Injected by SDK when creating map; base API URL for map requests.
|
|
9625
9879
|
* @property mapvxRequestContext - (Optional) Injected by SDK when creating map; context sent as headers to public-api.mapvx.com.
|
|
9626
9880
|
*/
|
|
9881
|
+
;// ./src/domain/models/circle.ts
|
|
9882
|
+
function circle_typeof(o) { "@babel/helpers - typeof"; return circle_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; }, circle_typeof(o); }
|
|
9883
|
+
function circle_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; }
|
|
9884
|
+
function circle_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? circle_ownKeys(Object(t), !0).forEach(function (r) { circle_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : circle_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9885
|
+
function circle_defineProperty(e, r, t) { return (r = circle_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9886
|
+
function circle_toPropertyKey(t) { var i = circle_toPrimitive(t, "string"); return "symbol" == circle_typeof(i) ? i : i + ""; }
|
|
9887
|
+
function circle_toPrimitive(t, r) { if ("object" != circle_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != circle_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9888
|
+
|
|
9889
|
+
/**
|
|
9890
|
+
* MapVX brand color used as the default for circle styling and other
|
|
9891
|
+
* SDK-drawn overlays (colored places, borders).
|
|
9892
|
+
*
|
|
9893
|
+
* @group Circles
|
|
9894
|
+
*/
|
|
9895
|
+
var MAPVX_BRAND_COLOR = "#276EF1";
|
|
9896
|
+
|
|
9897
|
+
/**
|
|
9898
|
+
* Where a circle renders relative to the other map layers.
|
|
9899
|
+
*
|
|
9900
|
+
* - `"aboveBasemap"` (default): above every basemap geometry layer —
|
|
9901
|
+
* including indoor floor-plate and building polygons — but below the
|
|
9902
|
+
* labels that follow them. A circle is never occluded by basemap fills.
|
|
9903
|
+
* - `"belowLabels"`: below the first symbol (label) layer of the style.
|
|
9904
|
+
* On indoor styles, floor-plate polygons ordered after that layer will
|
|
9905
|
+
* paint over the circle.
|
|
9906
|
+
* - `"top"`: above everything, including labels and markers drawn in
|
|
9907
|
+
* style layers.
|
|
9908
|
+
*
|
|
9909
|
+
* @group Circles
|
|
9910
|
+
*/
|
|
9911
|
+
|
|
9912
|
+
/**
|
|
9913
|
+
* Valid values for {@link CircleRenderOrder}, in rendering order.
|
|
9914
|
+
* @internal
|
|
9915
|
+
*/
|
|
9916
|
+
var CIRCLE_RENDER_ORDERS = ["belowLabels", "aboveBasemap", "top"];
|
|
9917
|
+
|
|
9918
|
+
/**
|
|
9919
|
+
* Default styling values applied to a circle when the corresponding
|
|
9920
|
+
* {@link CircleConfig} fields are omitted.
|
|
9921
|
+
*
|
|
9922
|
+
* @group Circles
|
|
9923
|
+
*/
|
|
9924
|
+
var CIRCLE_DEFAULTS = {
|
|
9925
|
+
fillColor: MAPVX_BRAND_COLOR,
|
|
9926
|
+
fillOpacity: 0.14,
|
|
9927
|
+
strokeColor: MAPVX_BRAND_COLOR,
|
|
9928
|
+
strokeWidth: 2,
|
|
9929
|
+
strokeOpacity: 0.65,
|
|
9930
|
+
renderOrder: "aboveBasemap"
|
|
9931
|
+
};
|
|
9932
|
+
|
|
9933
|
+
/**
|
|
9934
|
+
* Represents the configuration for the creation of a metric radius circle on a map.
|
|
9935
|
+
* The radius is expressed in meters (geographic), so the drawn circle stays
|
|
9936
|
+
* metrically accurate at every zoom level.
|
|
9937
|
+
*
|
|
9938
|
+
* @example
|
|
9939
|
+
* ```typescript
|
|
9940
|
+
* const circleConfig: CircleConfig = {
|
|
9941
|
+
* id: "geofence-1",
|
|
9942
|
+
* coordinate: { lat: 40.7128, lng: -74.0060 },
|
|
9943
|
+
* radiusMeters: 150,
|
|
9944
|
+
* fillOpacity: 0.2,
|
|
9945
|
+
* };
|
|
9946
|
+
* ```
|
|
9947
|
+
*
|
|
9948
|
+
* @group Circles
|
|
9949
|
+
*/
|
|
9950
|
+
|
|
9951
|
+
/**
|
|
9952
|
+
* Internal resolved representation of a circle kept by the map.
|
|
9953
|
+
* Holds the full configuration with defaults applied, plus visibility state.
|
|
9954
|
+
*
|
|
9955
|
+
* Unlike markers, the hidden flag persists across floor changes and map
|
|
9956
|
+
* restyles: a circle hidden via `hideCircle` stays hidden until `showCircle`.
|
|
9957
|
+
*/
|
|
9958
|
+
|
|
9959
|
+
/**
|
|
9960
|
+
* Returns a deep copy of a {@link CircleRecord}, including the nested
|
|
9961
|
+
* coordinate. Used by the map accessors so callers can't mutate internal
|
|
9962
|
+
* circle state by writing to a returned record.
|
|
9963
|
+
*
|
|
9964
|
+
* @param record The circle record to clone.
|
|
9965
|
+
* @returns An independent copy of the record.
|
|
9966
|
+
*
|
|
9967
|
+
* @group Circles
|
|
9968
|
+
*/
|
|
9969
|
+
function cloneCircleRecord(record) {
|
|
9970
|
+
return circle_objectSpread(circle_objectSpread({}, record), {}, {
|
|
9971
|
+
coordinate: circle_objectSpread({}, record.coordinate)
|
|
9972
|
+
});
|
|
9973
|
+
}
|
|
9974
|
+
|
|
9975
|
+
/**
|
|
9976
|
+
* Validates that a radius in meters is positive and finite.
|
|
9977
|
+
* @param radius The radius value to validate.
|
|
9978
|
+
* @throws {Error} If radius is ≤ 0 or not finite (NaN/Infinity).
|
|
9979
|
+
* @internal
|
|
9980
|
+
*/
|
|
9981
|
+
function validateRadiusMeters(radius) {
|
|
9982
|
+
if (!Number.isFinite(radius) || radius <= 0) {
|
|
9983
|
+
throw new Error("Invalid radiusMeters: ".concat(radius, ". Must be a positive finite number."));
|
|
9984
|
+
}
|
|
9985
|
+
}
|
|
9986
|
+
|
|
9987
|
+
/**
|
|
9988
|
+
* Validates that a coordinate is within valid geographic bounds.
|
|
9989
|
+
* @param coord The coordinate to validate.
|
|
9990
|
+
* @throws {Error} If latitude is outside [-90, 90] or longitude outside [-180, 180], or not finite.
|
|
9991
|
+
* @internal
|
|
9992
|
+
*/
|
|
9993
|
+
function validateCoordinate(coord) {
|
|
9994
|
+
if (coord == null || circle_typeof(coord) !== "object") {
|
|
9995
|
+
throw new Error("Invalid coordinate: expected an object with lat and lng properties.");
|
|
9996
|
+
}
|
|
9997
|
+
if (!Number.isFinite(coord.lat) || !Number.isFinite(coord.lng) || coord.lat < -90 || coord.lat > 90 || coord.lng < -180 || coord.lng > 180) {
|
|
9998
|
+
throw new Error("Invalid coordinate: lat=".concat(coord.lat, ", lng=").concat(coord.lng, ". ") + "latitude must be in [-90, 90], longitude in [-180, 180], and both finite.");
|
|
9999
|
+
}
|
|
10000
|
+
}
|
|
10001
|
+
|
|
10002
|
+
/**
|
|
10003
|
+
* Clamps an opacity value to the valid range [0, 1].
|
|
10004
|
+
* @param opacity The opacity value to clamp.
|
|
10005
|
+
* @param defaultValue Value to use if opacity is not a finite number.
|
|
10006
|
+
* @returns The clamped opacity value.
|
|
10007
|
+
* @internal
|
|
10008
|
+
*/
|
|
10009
|
+
function clampOpacity(opacity, defaultValue) {
|
|
10010
|
+
if (!Number.isFinite(opacity)) return defaultValue;
|
|
10011
|
+
return Math.max(0, Math.min(1, opacity));
|
|
10012
|
+
}
|
|
10013
|
+
|
|
10014
|
+
/**
|
|
10015
|
+
* Type guard for validating circle configurations without throwing.
|
|
10016
|
+
* Returns true if the configuration is valid and can be added to the map.
|
|
10017
|
+
*
|
|
10018
|
+
* @param config Configuration to validate.
|
|
10019
|
+
* @returns True if config is a valid CircleConfig, false otherwise.
|
|
10020
|
+
*
|
|
10021
|
+
* @example
|
|
10022
|
+
* ```typescript
|
|
10023
|
+
* if (isValidCircleConfig(userInput)) {
|
|
10024
|
+
* map.addCircle(userInput);
|
|
10025
|
+
* } else {
|
|
10026
|
+
* console.error('Invalid circle configuration');
|
|
10027
|
+
* }
|
|
10028
|
+
* ```
|
|
10029
|
+
*
|
|
10030
|
+
* @group Circles
|
|
10031
|
+
*/
|
|
10032
|
+
function isValidCircleConfig(config) {
|
|
10033
|
+
if (config === null || config === undefined || circle_typeof(config) !== "object") {
|
|
10034
|
+
return false;
|
|
10035
|
+
}
|
|
10036
|
+
var c = config;
|
|
10037
|
+
if (circle_typeof(c.coordinate) !== "object" || c.coordinate === null) return false;
|
|
10038
|
+
var coord = c.coordinate;
|
|
10039
|
+
if (typeof coord.lat !== "number" || typeof coord.lng !== "number" || !Number.isFinite(coord.lat) || !Number.isFinite(coord.lng) || coord.lat < -90 || coord.lat > 90 || coord.lng < -180 || coord.lng > 180) {
|
|
10040
|
+
return false;
|
|
10041
|
+
}
|
|
10042
|
+
if (typeof c.radiusMeters !== "number" || !Number.isFinite(c.radiusMeters) || c.radiusMeters <= 0) {
|
|
10043
|
+
return false;
|
|
10044
|
+
}
|
|
10045
|
+
if (c.id !== undefined && typeof c.id !== "string") return false;
|
|
10046
|
+
if (c.fillColor !== undefined && typeof c.fillColor !== "string") return false;
|
|
10047
|
+
if (c.fillOpacity !== undefined) {
|
|
10048
|
+
if (typeof c.fillOpacity !== "number" || !Number.isFinite(c.fillOpacity)) return false;
|
|
10049
|
+
}
|
|
10050
|
+
if (c.strokeColor !== undefined && typeof c.strokeColor !== "string") return false;
|
|
10051
|
+
if (c.strokeWidth !== undefined) {
|
|
10052
|
+
if (typeof c.strokeWidth !== "number" || !Number.isFinite(c.strokeWidth)) return false;
|
|
10053
|
+
}
|
|
10054
|
+
if (c.strokeOpacity !== undefined) {
|
|
10055
|
+
if (typeof c.strokeOpacity !== "number" || !Number.isFinite(c.strokeOpacity)) return false;
|
|
10056
|
+
}
|
|
10057
|
+
if (c.floorId !== undefined && typeof c.floorId !== "string") return false;
|
|
10058
|
+
if (c.renderOrder !== undefined && !CIRCLE_RENDER_ORDERS.includes(c.renderOrder)) {
|
|
10059
|
+
return false;
|
|
10060
|
+
}
|
|
10061
|
+
return true;
|
|
10062
|
+
}
|
|
10063
|
+
|
|
10064
|
+
/**
|
|
10065
|
+
* Resolves a {@link CircleConfig} into a {@link CircleRecord}, applying
|
|
10066
|
+
* default styling, generating an id when one is not provided, and validating inputs.
|
|
10067
|
+
*
|
|
10068
|
+
* @param config Circle configuration provided by the SDK consumer.
|
|
10069
|
+
* @param hidden Initial hidden state, defaults to visible.
|
|
10070
|
+
* @returns The resolved circle record ready to be stored and rendered.
|
|
10071
|
+
* @throws {Error} If radiusMeters is ≤ 0, not finite, or coordinates are invalid.
|
|
10072
|
+
*
|
|
10073
|
+
* @group Circles
|
|
10074
|
+
*/
|
|
10075
|
+
function resolveCircleConfig(config) {
|
|
10076
|
+
var _config$id, _config$fillColor, _config$strokeColor, _config$strokeWidth, _config$renderOrder;
|
|
10077
|
+
var hidden = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
10078
|
+
validateRadiusMeters(config.radiusMeters);
|
|
10079
|
+
validateCoordinate(config.coordinate);
|
|
10080
|
+
if (config.renderOrder !== undefined && !CIRCLE_RENDER_ORDERS.includes(config.renderOrder)) {
|
|
10081
|
+
throw new Error("Invalid renderOrder: ".concat(String(config.renderOrder), ". ") + "Must be one of: ".concat(CIRCLE_RENDER_ORDERS.join(", "), "."));
|
|
10082
|
+
}
|
|
10083
|
+
return {
|
|
10084
|
+
id: (_config$id = config.id) !== null && _config$id !== void 0 ? _config$id : generateHexadecimalKey(),
|
|
10085
|
+
// Copy the coordinate so later mutations of the caller's object
|
|
10086
|
+
// can't change internal circle state
|
|
10087
|
+
coordinate: {
|
|
10088
|
+
lat: config.coordinate.lat,
|
|
10089
|
+
lng: config.coordinate.lng
|
|
10090
|
+
},
|
|
10091
|
+
radiusMeters: config.radiusMeters,
|
|
10092
|
+
fillColor: (_config$fillColor = config.fillColor) !== null && _config$fillColor !== void 0 ? _config$fillColor : CIRCLE_DEFAULTS.fillColor,
|
|
10093
|
+
fillOpacity: clampOpacity(config.fillOpacity, CIRCLE_DEFAULTS.fillOpacity),
|
|
10094
|
+
strokeColor: (_config$strokeColor = config.strokeColor) !== null && _config$strokeColor !== void 0 ? _config$strokeColor : CIRCLE_DEFAULTS.strokeColor,
|
|
10095
|
+
strokeWidth: (_config$strokeWidth = config.strokeWidth) !== null && _config$strokeWidth !== void 0 ? _config$strokeWidth : CIRCLE_DEFAULTS.strokeWidth,
|
|
10096
|
+
strokeOpacity: clampOpacity(config.strokeOpacity, CIRCLE_DEFAULTS.strokeOpacity),
|
|
10097
|
+
floorId: config.floorId,
|
|
10098
|
+
renderOrder: (_config$renderOrder = config.renderOrder) !== null && _config$renderOrder !== void 0 ? _config$renderOrder : CIRCLE_DEFAULTS.renderOrder,
|
|
10099
|
+
hidden: hidden
|
|
10100
|
+
};
|
|
10101
|
+
}
|
|
10102
|
+
|
|
10103
|
+
/**
|
|
10104
|
+
* Builds a closed GeoJSON polygon ring approximating a geographic circle.
|
|
10105
|
+
*
|
|
10106
|
+
* The ring is computed with an equirectangular approximation: meters are
|
|
10107
|
+
* converted to degrees independently per axis, with the longitude scale
|
|
10108
|
+
* corrected by the cosine of the latitude. For the radii the SDK works with
|
|
10109
|
+
* (tens to hundreds of meters) the metric error is negligible (≤1%) at any latitude
|
|
10110
|
+
* where the projection is defined. At extreme polar latitudes, the approximation
|
|
10111
|
+
* breaks down, so circles near poles (|lat| > 85°) should be used with caution.
|
|
10112
|
+
*
|
|
10113
|
+
* @param lng Longitude of the circle center in degrees.
|
|
10114
|
+
* @param lat Latitude of the circle center in degrees.
|
|
10115
|
+
* @param radiusMeters Radius of the circle in meters. Must be positive and finite.
|
|
10116
|
+
* @param points Number of segments in the ring. Defaults to 64. Non-integer
|
|
10117
|
+
* values are floored and the count is clamped to a minimum of 3,
|
|
10118
|
+
* the smallest valid GeoJSON linear ring; non-finite values fall
|
|
10119
|
+
* back to the default.
|
|
10120
|
+
* @returns A closed ring of `[lng, lat]` positions (first equals last).
|
|
10121
|
+
*
|
|
10122
|
+
* @example
|
|
10123
|
+
* ```typescript
|
|
10124
|
+
* import { circleRing } from '@mapvx/web-js';
|
|
10125
|
+
*
|
|
10126
|
+
* // Create a 150-meter radius circle ring
|
|
10127
|
+
* const ring = circleRing(-74.0060, 40.7128, 150);
|
|
10128
|
+
* const polygon = { type: "Polygon", coordinates: [ring] };
|
|
10129
|
+
*
|
|
10130
|
+
* // Custom segments (32 instead of 64) for lower resolution
|
|
10131
|
+
* const coarseRing = circleRing(-74.0060, 40.7128, 150, 32);
|
|
10132
|
+
* ```
|
|
10133
|
+
*
|
|
10134
|
+
* @note Equirectangular approximation is accurate for radii up to ~500 km and
|
|
10135
|
+
* latitudes between approximately ±80°. Beyond these limits, visual
|
|
10136
|
+
* distortion may occur near the poles.
|
|
10137
|
+
* @note Generated rings do not account for geographic obstacles, walls, or
|
|
10138
|
+
* buildings. For complex geofencing, consider server-side validation.
|
|
10139
|
+
*
|
|
10140
|
+
* @group Circles
|
|
10141
|
+
*/
|
|
10142
|
+
function circleRing(lng, lat, radiusMeters) {
|
|
10143
|
+
var points = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 64;
|
|
10144
|
+
// A linear ring needs at least 3 distinct positions to be valid GeoJSON
|
|
10145
|
+
var segments = Number.isFinite(points) ? Math.max(3, Math.floor(points)) : 64;
|
|
10146
|
+
var ring = [];
|
|
10147
|
+
var latRad = lat * Math.PI / 180;
|
|
10148
|
+
var metersPerDegLat = 110574;
|
|
10149
|
+
var metersPerDegLng = 111320 * Math.cos(latRad || 0.000001);
|
|
10150
|
+
var latR = radiusMeters / metersPerDegLat;
|
|
10151
|
+
var lngR = radiusMeters / (metersPerDegLng || 1);
|
|
10152
|
+
for (var i = 0; i < segments; i += 1) {
|
|
10153
|
+
var a = i / segments * Math.PI * 2;
|
|
10154
|
+
ring.push([lng + lngR * Math.cos(a), lat + latR * Math.sin(a)]);
|
|
10155
|
+
}
|
|
10156
|
+
// Close the ring with an exact copy of the first position, as GeoJSON requires
|
|
10157
|
+
ring.push([ring[0][0], ring[0][1]]);
|
|
10158
|
+
return ring;
|
|
10159
|
+
}
|
|
9627
10160
|
;// ./node_modules/.pnpm/@googlemaps+polyline-codec@1.0.28/node_modules/@googlemaps/polyline-codec/dist/index.esm.js
|
|
9628
10161
|
/**
|
|
9629
10162
|
* Copyright 2020 Google LLC
|
|
@@ -10821,11 +11354,9 @@ var Requester = /*#__PURE__*/function () {
|
|
|
10821
11354
|
// Ensure we have an absolute URL (required for new URL() in fetchFromUrl)
|
|
10822
11355
|
var withProtocol = apiUrl.startsWith("http://") || apiUrl.startsWith("https://") ? apiUrl : "https://".concat(apiUrl);
|
|
10823
11356
|
var cleanApiUrl = withProtocol.endsWith("/") ? withProtocol.slice(0, -1) : withProtocol;
|
|
10824
|
-
this.baseUrl = "".concat(cleanApiUrl, "/api/sdk/");
|
|
10825
|
-
this.baseUrlV2 = "".concat(cleanApiUrl, "/api/sdk/v2/");
|
|
10826
|
-
this.baseUrlApi = "".concat(cleanApiUrl, "/api/");
|
|
11357
|
+
this.baseUrl = "".concat(cleanApiUrl, "/api/sdk/v2/");
|
|
10827
11358
|
this.baseUrlPortal = "".concat(cleanApiUrl, "/api/portal/");
|
|
10828
|
-
this.baseUrlHealth = "https://api.mapvx.com/api/health
|
|
11359
|
+
this.baseUrlHealth = "https://api.mapvx.com/api/sdk/v2/health";
|
|
10829
11360
|
this.oldBaseUrl = "https://api.mapvx.com/api/sdk/";
|
|
10830
11361
|
this.routeBaseUrl = "https://api.mapvx.com/sdk/";
|
|
10831
11362
|
}
|
|
@@ -10918,11 +11449,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
10918
11449
|
options = {
|
|
10919
11450
|
method: "GET",
|
|
10920
11451
|
headers: {
|
|
10921
|
-
"content-type": "application/json"
|
|
11452
|
+
"content-type": "application/json",
|
|
11453
|
+
Authorization: "Bearer ".concat(token)
|
|
10922
11454
|
}
|
|
10923
11455
|
};
|
|
10924
11456
|
params = {
|
|
10925
|
-
token: token,
|
|
10926
11457
|
stopId: stopId,
|
|
10927
11458
|
lang: this.lang
|
|
10928
11459
|
};
|
|
@@ -10954,11 +11485,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
10954
11485
|
options = {
|
|
10955
11486
|
method: "GET",
|
|
10956
11487
|
headers: {
|
|
10957
|
-
"content-type": "application/json"
|
|
11488
|
+
"content-type": "application/json",
|
|
11489
|
+
Authorization: "Bearer ".concat(token)
|
|
10958
11490
|
}
|
|
10959
11491
|
};
|
|
10960
11492
|
params = {
|
|
10961
|
-
token: token,
|
|
10962
11493
|
stopId: stopId,
|
|
10963
11494
|
vehicleId: vehicleId,
|
|
10964
11495
|
lang: this.lang
|
|
@@ -10990,11 +11521,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
10990
11521
|
options = {
|
|
10991
11522
|
method: "GET",
|
|
10992
11523
|
headers: {
|
|
10993
|
-
"content-type": "application/json"
|
|
11524
|
+
"content-type": "application/json",
|
|
11525
|
+
Authorization: "Bearer ".concat(token)
|
|
10994
11526
|
}
|
|
10995
11527
|
};
|
|
10996
11528
|
params = {
|
|
10997
|
-
token: token,
|
|
10998
11529
|
lang: this.lang
|
|
10999
11530
|
};
|
|
11000
11531
|
if (placeId != null) {
|
|
@@ -11067,11 +11598,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11067
11598
|
options = {
|
|
11068
11599
|
method: "GET",
|
|
11069
11600
|
headers: {
|
|
11070
|
-
"content-type": "application/json"
|
|
11601
|
+
"content-type": "application/json",
|
|
11602
|
+
Authorization: "Bearer ".concat(token)
|
|
11071
11603
|
}
|
|
11072
11604
|
};
|
|
11073
11605
|
params = {
|
|
11074
|
-
token: token,
|
|
11075
11606
|
lang: this.lang
|
|
11076
11607
|
};
|
|
11077
11608
|
return _context6.a(2, this.fetchFromUrl(this.baseUrl + "availablePlaces", params, options));
|
|
@@ -11140,11 +11671,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11140
11671
|
options = {
|
|
11141
11672
|
method: "GET",
|
|
11142
11673
|
headers: {
|
|
11143
|
-
"content-type": "application/json"
|
|
11674
|
+
"content-type": "application/json",
|
|
11675
|
+
Authorization: "Bearer ".concat(token)
|
|
11144
11676
|
}
|
|
11145
11677
|
};
|
|
11146
11678
|
params = {
|
|
11147
|
-
token: token,
|
|
11148
11679
|
place_id: placeId,
|
|
11149
11680
|
lang: this.lang
|
|
11150
11681
|
};
|
|
@@ -11214,11 +11745,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11214
11745
|
options = {
|
|
11215
11746
|
method: "GET",
|
|
11216
11747
|
headers: {
|
|
11217
|
-
"content-type": "application/json"
|
|
11748
|
+
"content-type": "application/json",
|
|
11749
|
+
Authorization: "Bearer ".concat(token)
|
|
11218
11750
|
}
|
|
11219
11751
|
};
|
|
11220
11752
|
params = {
|
|
11221
|
-
token: token,
|
|
11222
11753
|
targetPlace: targetPlaceId,
|
|
11223
11754
|
lang: this.lang
|
|
11224
11755
|
};
|
|
@@ -11272,72 +11803,118 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11272
11803
|
}
|
|
11273
11804
|
return fetchAnySubPlaces;
|
|
11274
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
|
+
|
|
11275
11897
|
/**
|
|
11276
11898
|
* To obtain the route
|
|
11277
11899
|
* @param routeConfig
|
|
11278
11900
|
* @returns
|
|
11279
11901
|
*/
|
|
11280
|
-
)
|
|
11281
11902
|
}, {
|
|
11282
11903
|
key: "fetchRoute",
|
|
11283
11904
|
value: (function () {
|
|
11284
11905
|
var _fetchRoute = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee10(routeConfig, token) {
|
|
11285
|
-
var options,
|
|
11906
|
+
var options, cleanParams;
|
|
11286
11907
|
return requester_regenerator().w(function (_context10) {
|
|
11287
11908
|
while (1) switch (_context10.n) {
|
|
11288
11909
|
case 0:
|
|
11289
11910
|
options = {
|
|
11290
11911
|
method: "GET",
|
|
11291
11912
|
headers: {
|
|
11292
|
-
"content-type": "application/json"
|
|
11913
|
+
"content-type": "application/json",
|
|
11914
|
+
Authorization: "Bearer ".concat(token)
|
|
11293
11915
|
}
|
|
11294
11916
|
};
|
|
11295
|
-
|
|
11296
|
-
fromLatLng: undefined,
|
|
11297
|
-
fromBuilding: undefined,
|
|
11298
|
-
fromFloor: undefined,
|
|
11299
|
-
toLatLng: undefined,
|
|
11300
|
-
toBuilding: undefined,
|
|
11301
|
-
toFloor: undefined,
|
|
11302
|
-
fromPlaceId: undefined,
|
|
11303
|
-
toPlaceId: undefined,
|
|
11304
|
-
travelMode: TransportationMode.walking,
|
|
11305
|
-
reducedMobility: routeConfig.preferAccessibleRoute ? 1 : 0,
|
|
11306
|
-
announceFormat: routeConfig.announceFormat,
|
|
11307
|
-
userBearing: 0,
|
|
11308
|
-
lang: this.lang,
|
|
11309
|
-
unitSystem: routeConfig.unitSystem,
|
|
11310
|
-
token: token
|
|
11311
|
-
};
|
|
11312
|
-
if ("id" in routeConfig.initialLocation) {
|
|
11313
|
-
params.fromPlaceId = routeConfig.initialLocation.id;
|
|
11314
|
-
if (routeConfig.initialLocation.level !== undefined) {
|
|
11315
|
-
params.fromFloor = routeConfig.initialLocation.level;
|
|
11316
|
-
}
|
|
11317
|
-
} else {
|
|
11318
|
-
_routeConfig$initialL = routeConfig.initialLocation, lat = _routeConfig$initialL.lat, lng = _routeConfig$initialL.lng, floorId = _routeConfig$initialL.floorId, placeId = _routeConfig$initialL.placeId;
|
|
11319
|
-
params.fromLatLng = "".concat(lat, ",").concat(lng);
|
|
11320
|
-
params.fromFloor = floorId;
|
|
11321
|
-
params.fromBuilding = placeId;
|
|
11322
|
-
}
|
|
11323
|
-
if ("id" in routeConfig.finalLocation) {
|
|
11324
|
-
params.toPlaceId = routeConfig.finalLocation.id;
|
|
11325
|
-
if (routeConfig.finalLocation.level !== undefined) {
|
|
11326
|
-
params.toFloor = routeConfig.finalLocation.level;
|
|
11327
|
-
}
|
|
11328
|
-
} else {
|
|
11329
|
-
_routeConfig$finalLoc = routeConfig.finalLocation, _lat = _routeConfig$finalLoc.lat, _lng = _routeConfig$finalLoc.lng, _floorId = _routeConfig$finalLoc.floorId, _placeId = _routeConfig$finalLoc.placeId;
|
|
11330
|
-
params.toLatLng = "".concat(_lat, ",").concat(_lng);
|
|
11331
|
-
params.toFloor = _floorId;
|
|
11332
|
-
params.toBuilding = _placeId;
|
|
11333
|
-
}
|
|
11334
|
-
cleanParams = {};
|
|
11335
|
-
for (key in params) {
|
|
11336
|
-
value = params[key];
|
|
11337
|
-
if (value != null) {
|
|
11338
|
-
cleanParams[key] = value;
|
|
11339
|
-
}
|
|
11340
|
-
}
|
|
11917
|
+
cleanParams = this.buildRouteParams(routeConfig);
|
|
11341
11918
|
return _context10.a(2, this.fetchFromUrl(this.routeBaseUrl + "route", cleanParams, options));
|
|
11342
11919
|
}
|
|
11343
11920
|
}, _callee10, this);
|
|
@@ -11357,62 +11934,18 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11357
11934
|
key: "fetchRouteV2",
|
|
11358
11935
|
value: (function () {
|
|
11359
11936
|
var _fetchRouteV = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee11(routeConfig, token) {
|
|
11360
|
-
var options,
|
|
11937
|
+
var options, cleanParams;
|
|
11361
11938
|
return requester_regenerator().w(function (_context11) {
|
|
11362
11939
|
while (1) switch (_context11.n) {
|
|
11363
11940
|
case 0:
|
|
11364
11941
|
options = {
|
|
11365
11942
|
method: "GET",
|
|
11366
11943
|
headers: {
|
|
11367
|
-
"content-type": "application/json"
|
|
11944
|
+
"content-type": "application/json",
|
|
11945
|
+
Authorization: "Bearer ".concat(token)
|
|
11368
11946
|
}
|
|
11369
11947
|
};
|
|
11370
|
-
|
|
11371
|
-
fromLatLng: undefined,
|
|
11372
|
-
fromBuilding: undefined,
|
|
11373
|
-
fromFloor: undefined,
|
|
11374
|
-
toLatLng: undefined,
|
|
11375
|
-
toBuilding: undefined,
|
|
11376
|
-
toFloor: undefined,
|
|
11377
|
-
fromPlaceId: undefined,
|
|
11378
|
-
toPlaceId: undefined,
|
|
11379
|
-
travelMode: TransportationMode.walking,
|
|
11380
|
-
reducedMobility: routeConfig.preferAccessibleRoute ? 1 : 0,
|
|
11381
|
-
announceFormat: routeConfig.announceFormat,
|
|
11382
|
-
userBearing: 0,
|
|
11383
|
-
lang: this.lang,
|
|
11384
|
-
unitSystem: routeConfig.unitSystem,
|
|
11385
|
-
token: token
|
|
11386
|
-
};
|
|
11387
|
-
if ("id" in routeConfig.initialLocation) {
|
|
11388
|
-
params.fromPlaceId = routeConfig.initialLocation.id;
|
|
11389
|
-
if (routeConfig.initialLocation.level !== undefined) {
|
|
11390
|
-
params.fromFloor = routeConfig.initialLocation.level;
|
|
11391
|
-
}
|
|
11392
|
-
} else {
|
|
11393
|
-
_routeConfig$initialL2 = routeConfig.initialLocation, lat = _routeConfig$initialL2.lat, lng = _routeConfig$initialL2.lng, floorId = _routeConfig$initialL2.floorId, placeId = _routeConfig$initialL2.placeId;
|
|
11394
|
-
params.fromLatLng = "".concat(lat, ",").concat(lng);
|
|
11395
|
-
params.fromFloor = floorId;
|
|
11396
|
-
params.fromBuilding = placeId;
|
|
11397
|
-
}
|
|
11398
|
-
if ("id" in routeConfig.finalLocation) {
|
|
11399
|
-
params.toPlaceId = routeConfig.finalLocation.id;
|
|
11400
|
-
if (routeConfig.finalLocation.level !== undefined) {
|
|
11401
|
-
params.toFloor = routeConfig.finalLocation.level;
|
|
11402
|
-
}
|
|
11403
|
-
} else {
|
|
11404
|
-
_routeConfig$finalLoc2 = routeConfig.finalLocation, _lat2 = _routeConfig$finalLoc2.lat, _lng2 = _routeConfig$finalLoc2.lng, _floorId2 = _routeConfig$finalLoc2.floorId, _placeId2 = _routeConfig$finalLoc2.placeId;
|
|
11405
|
-
params.toLatLng = "".concat(_lat2, ",").concat(_lng2);
|
|
11406
|
-
params.toFloor = _floorId2;
|
|
11407
|
-
params.toBuilding = _placeId2;
|
|
11408
|
-
}
|
|
11409
|
-
cleanParams = {};
|
|
11410
|
-
for (key in params) {
|
|
11411
|
-
value = params[key];
|
|
11412
|
-
if (value != null) {
|
|
11413
|
-
cleanParams[key] = value;
|
|
11414
|
-
}
|
|
11415
|
-
}
|
|
11948
|
+
cleanParams = this.buildRouteParams(routeConfig);
|
|
11416
11949
|
return _context11.a(2, this.fetchFromUrl(this.routeBaseUrl + "v2/route", cleanParams, options));
|
|
11417
11950
|
}
|
|
11418
11951
|
}, _callee11, this);
|
|
@@ -11441,11 +11974,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11441
11974
|
options = {
|
|
11442
11975
|
method: "GET",
|
|
11443
11976
|
headers: {
|
|
11444
|
-
"content-type": "application/json"
|
|
11977
|
+
"content-type": "application/json",
|
|
11978
|
+
Authorization: "Bearer ".concat(token)
|
|
11445
11979
|
}
|
|
11446
11980
|
};
|
|
11447
11981
|
params = {
|
|
11448
|
-
token: token,
|
|
11449
11982
|
lang: this.lang
|
|
11450
11983
|
};
|
|
11451
11984
|
return _context12.a(2, this.fetchFromUrl(this.baseUrl + "institution", params, options));
|
|
@@ -11481,14 +12014,14 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11481
12014
|
options = {
|
|
11482
12015
|
method: "GET",
|
|
11483
12016
|
headers: {
|
|
11484
|
-
"content-type": "application/json"
|
|
12017
|
+
"content-type": "application/json",
|
|
12018
|
+
Authorization: "Bearer ".concat(token)
|
|
11485
12019
|
}
|
|
11486
12020
|
};
|
|
11487
12021
|
params = {
|
|
11488
12022
|
institution_id: institutionId,
|
|
11489
12023
|
input: input,
|
|
11490
|
-
lang: this.lang
|
|
11491
|
-
token: token
|
|
12024
|
+
lang: this.lang
|
|
11492
12025
|
};
|
|
11493
12026
|
if (parentIds) {
|
|
11494
12027
|
params.parentPlaces = requester_toConsumableArray(parentIds);
|
|
@@ -11541,7 +12074,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11541
12074
|
return requester_regenerator().w(function (_context14) {
|
|
11542
12075
|
while (1) switch (_context14.n) {
|
|
11543
12076
|
case 0:
|
|
11544
|
-
// The v2
|
|
12077
|
+
// The v2 endpoints authenticate via the Authorization header (Bearer),
|
|
11545
12078
|
// not via a `token` query parameter like the legacy /api/sdk/* routes.
|
|
11546
12079
|
options = {
|
|
11547
12080
|
method: "GET",
|
|
@@ -11573,7 +12106,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11573
12106
|
if (floor) {
|
|
11574
12107
|
params.floor = floor;
|
|
11575
12108
|
}
|
|
11576
|
-
return _context14.a(2, this.fetchFromUrl(this.
|
|
12109
|
+
return _context14.a(2, this.fetchFromUrl(this.baseUrl + "searchPlacesByTags", params, options));
|
|
11577
12110
|
}
|
|
11578
12111
|
}, _callee14, this);
|
|
11579
12112
|
}));
|
|
@@ -11593,16 +12126,16 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11593
12126
|
options = {
|
|
11594
12127
|
method: "GET",
|
|
11595
12128
|
headers: {
|
|
11596
|
-
"content-type": "application/json"
|
|
12129
|
+
"content-type": "application/json",
|
|
12130
|
+
Authorization: "Bearer ".concat(token)
|
|
11597
12131
|
}
|
|
11598
12132
|
};
|
|
11599
12133
|
params = {
|
|
11600
|
-
token: token,
|
|
11601
12134
|
lang: this.lang
|
|
11602
12135
|
};
|
|
11603
12136
|
if (place_id) params.place_id = place_id;
|
|
11604
12137
|
if (product) params.product = product;
|
|
11605
|
-
return _context15.a(2, this.fetchFromUrl(this.
|
|
12138
|
+
return _context15.a(2, this.fetchFromUrl(this.baseUrl + "configuration", params, options));
|
|
11606
12139
|
}
|
|
11607
12140
|
}, _callee15, this);
|
|
11608
12141
|
}));
|
|
@@ -11622,15 +12155,15 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11622
12155
|
options = {
|
|
11623
12156
|
method: "GET",
|
|
11624
12157
|
headers: {
|
|
11625
|
-
"content-type": "application/json"
|
|
12158
|
+
"content-type": "application/json",
|
|
12159
|
+
Authorization: "Bearer ".concat(token)
|
|
11626
12160
|
}
|
|
11627
12161
|
};
|
|
11628
12162
|
params = {
|
|
11629
|
-
token: token,
|
|
11630
12163
|
lang: this.lang
|
|
11631
12164
|
};
|
|
11632
12165
|
if (place_id) params.id = place_id;
|
|
11633
|
-
return _context16.a(2, this.fetchFromUrl(this.
|
|
12166
|
+
return _context16.a(2, this.fetchFromUrl(this.baseUrl + "category", params, options));
|
|
11634
12167
|
}
|
|
11635
12168
|
}, _callee16, this);
|
|
11636
12169
|
}));
|
|
@@ -11650,11 +12183,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11650
12183
|
options = {
|
|
11651
12184
|
method: "GET",
|
|
11652
12185
|
headers: {
|
|
11653
|
-
"content-type": "application/json"
|
|
12186
|
+
"content-type": "application/json",
|
|
12187
|
+
Authorization: "Bearer ".concat(token)
|
|
11654
12188
|
}
|
|
11655
12189
|
};
|
|
11656
12190
|
params = {
|
|
11657
|
-
token: token,
|
|
11658
12191
|
placeId: parentPlaceId,
|
|
11659
12192
|
fromPlace: fromPlaceId,
|
|
11660
12193
|
announceFormat: announceFormat,
|
|
@@ -11682,11 +12215,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11682
12215
|
options = {
|
|
11683
12216
|
method: "GET",
|
|
11684
12217
|
headers: {
|
|
11685
|
-
"content-type": "application/json"
|
|
12218
|
+
"content-type": "application/json",
|
|
12219
|
+
Authorization: "Bearer ".concat(token)
|
|
11686
12220
|
}
|
|
11687
12221
|
};
|
|
11688
12222
|
params = {
|
|
11689
|
-
token: token,
|
|
11690
12223
|
placeId: placeId
|
|
11691
12224
|
};
|
|
11692
12225
|
return _context18.a(2, this.fetchFromUrl(this.routeBaseUrl + "cache_timestamp", params, options));
|
|
@@ -11709,14 +12242,14 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11709
12242
|
options = {
|
|
11710
12243
|
method: "GET",
|
|
11711
12244
|
headers: {
|
|
11712
|
-
"content-type": "application/json"
|
|
12245
|
+
"content-type": "application/json",
|
|
12246
|
+
Authorization: "Bearer ".concat(token)
|
|
11713
12247
|
}
|
|
11714
12248
|
};
|
|
11715
12249
|
params = {
|
|
11716
|
-
token: token,
|
|
11717
12250
|
type: type
|
|
11718
12251
|
};
|
|
11719
|
-
return _context19.a(2, this.fetchFromUrl(this.
|
|
12252
|
+
return _context19.a(2, this.fetchFromUrl(this.baseUrl + "styles/customStyles", params, options));
|
|
11720
12253
|
}
|
|
11721
12254
|
}, _callee19, this);
|
|
11722
12255
|
}));
|
|
@@ -11739,14 +12272,13 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11739
12272
|
totemId: totemId,
|
|
11740
12273
|
status: status
|
|
11741
12274
|
});
|
|
11742
|
-
params = {
|
|
11743
|
-
token: token
|
|
11744
|
-
};
|
|
12275
|
+
params = {};
|
|
11745
12276
|
options = {
|
|
11746
12277
|
method: "POST",
|
|
11747
12278
|
headers: {
|
|
11748
12279
|
accept: "application/json",
|
|
11749
|
-
"Content-Type": "application/json"
|
|
12280
|
+
"Content-Type": "application/json",
|
|
12281
|
+
Authorization: "Bearer ".concat(token)
|
|
11750
12282
|
},
|
|
11751
12283
|
body: requestData
|
|
11752
12284
|
};
|
|
@@ -11826,7 +12358,6 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
11826
12358
|
_this.token = token;
|
|
11827
12359
|
_this.currentLang = lang;
|
|
11828
12360
|
_this.requester = new Requester(lang, apiUrl, mapvxRequestContext);
|
|
11829
|
-
_this.lang = lang;
|
|
11830
12361
|
_this.cache = cache !== null && cache !== void 0 ? cache : new CacheManager();
|
|
11831
12362
|
return _this;
|
|
11832
12363
|
}
|
|
@@ -12033,7 +12564,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12033
12564
|
while (1) switch (_context4.p = _context4.n) {
|
|
12034
12565
|
case 0:
|
|
12035
12566
|
_context4.p = 0;
|
|
12036
|
-
cachedPlace = this.cache.getPlace(placeId, this.
|
|
12567
|
+
cachedPlace = this.cache.getPlace(placeId, this.currentLang);
|
|
12037
12568
|
if (!(cachedPlace != null)) {
|
|
12038
12569
|
_context4.n = 1;
|
|
12039
12570
|
break;
|
|
@@ -12062,9 +12593,9 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12062
12593
|
case 5:
|
|
12063
12594
|
responseData = _context4.v;
|
|
12064
12595
|
place = new place_MVXPlace(responseData);
|
|
12065
|
-
this.cache.setPlace(place.mapvxId, place, this.
|
|
12596
|
+
this.cache.setPlace(place.mapvxId, place, this.currentLang);
|
|
12066
12597
|
if (place.clientId != null) {
|
|
12067
|
-
this.cache.setPlace(place.clientId, place, this.
|
|
12598
|
+
this.cache.setPlace(place.clientId, place, this.currentLang);
|
|
12068
12599
|
}
|
|
12069
12600
|
this.logEvent("fetchAndParsePlaceDetail", {
|
|
12070
12601
|
cached: "false"
|
|
@@ -12093,7 +12624,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12093
12624
|
while (1) switch (_context5.p = _context5.n) {
|
|
12094
12625
|
case 0:
|
|
12095
12626
|
_context5.p = 0;
|
|
12096
|
-
cachedPlace = this.cache.getPlace(placeId, this.
|
|
12627
|
+
cachedPlace = this.cache.getPlace(placeId, this.currentLang);
|
|
12097
12628
|
if (!(cachedPlace != null)) {
|
|
12098
12629
|
_context5.n = 1;
|
|
12099
12630
|
break;
|
|
@@ -12122,9 +12653,9 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12122
12653
|
case 5:
|
|
12123
12654
|
responseData = _context5.v;
|
|
12124
12655
|
place = new place_MVXPlace(responseData);
|
|
12125
|
-
this.cache.setPlace(place.mapvxId, place, this.
|
|
12656
|
+
this.cache.setPlace(place.mapvxId, place, this.currentLang);
|
|
12126
12657
|
if (place.clientId != null) {
|
|
12127
|
-
this.cache.setPlace(place.clientId, place, this.
|
|
12658
|
+
this.cache.setPlace(place.clientId, place, this.currentLang);
|
|
12128
12659
|
}
|
|
12129
12660
|
this.logEvent("fetchAndParseAnyPlaceDetail", {
|
|
12130
12661
|
cached: "false"
|
|
@@ -12249,11 +12780,11 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12249
12780
|
});
|
|
12250
12781
|
this.logEvent("fetchAndParseAnySubPlaces");
|
|
12251
12782
|
subPlaces.forEach(function (place) {
|
|
12252
|
-
if (!_this3.cache.hasPlace(place.mapvxId, _this3.
|
|
12253
|
-
_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);
|
|
12254
12785
|
}
|
|
12255
|
-
if (place.clientId != null && !_this3.cache.hasPlace(place.clientId, _this3.
|
|
12256
|
-
_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);
|
|
12257
12788
|
}
|
|
12258
12789
|
});
|
|
12259
12790
|
return _context7.a(2, subPlaces);
|
|
@@ -12304,11 +12835,11 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12304
12835
|
});
|
|
12305
12836
|
this.logEvent("fetchAndParseAvailablePlaces");
|
|
12306
12837
|
data.forEach(function (place) {
|
|
12307
|
-
if (!_this4.cache.hasPlace(place.mapvxId, _this4.
|
|
12308
|
-
_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);
|
|
12309
12840
|
}
|
|
12310
|
-
if (place.clientId != null && !_this4.cache.hasPlace(place.clientId, _this4.
|
|
12311
|
-
_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);
|
|
12312
12843
|
}
|
|
12313
12844
|
});
|
|
12314
12845
|
return _context8.a(2, data);
|
|
@@ -12362,11 +12893,11 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12362
12893
|
});
|
|
12363
12894
|
this.logEvent("fetchAndParsePlacesFromInstitution");
|
|
12364
12895
|
data.forEach(function (place) {
|
|
12365
|
-
if (!_this5.cache.hasPlace(place.mapvxId, _this5.
|
|
12366
|
-
_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);
|
|
12367
12898
|
}
|
|
12368
|
-
if (place.clientId != null && !_this5.cache.hasPlace(place.clientId, _this5.
|
|
12369
|
-
_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);
|
|
12370
12901
|
}
|
|
12371
12902
|
});
|
|
12372
12903
|
return _context9.a(2, data);
|
|
@@ -12393,7 +12924,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12393
12924
|
var _this6 = this;
|
|
12394
12925
|
var places = [];
|
|
12395
12926
|
ids.forEach(function (id) {
|
|
12396
|
-
var place = _this6.cache.getPlace(id, _this6.
|
|
12927
|
+
var place = _this6.cache.getPlace(id, _this6.currentLang);
|
|
12397
12928
|
if (place != null) {
|
|
12398
12929
|
places.push(place);
|
|
12399
12930
|
}
|
|
@@ -12542,8 +13073,8 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12542
13073
|
while (1) switch (_context10.p = _context10.n) {
|
|
12543
13074
|
case 0:
|
|
12544
13075
|
_context10.p = 0;
|
|
12545
|
-
cachedResponse = this.cache.getVehicle(stopId, this.
|
|
12546
|
-
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))) {
|
|
12547
13078
|
_context10.n = 1;
|
|
12548
13079
|
break;
|
|
12549
13080
|
}
|
|
@@ -12594,7 +13125,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12594
13125
|
this.cache.setVehicle(stopId, {
|
|
12595
13126
|
timestamp: Date.now(),
|
|
12596
13127
|
data: transport
|
|
12597
|
-
}, this.
|
|
13128
|
+
}, this.currentLang);
|
|
12598
13129
|
this.logEvent("fetchAndParseTransport", {
|
|
12599
13130
|
cached: "false"
|
|
12600
13131
|
});
|
|
@@ -12602,7 +13133,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12602
13133
|
case 8:
|
|
12603
13134
|
_context10.p = 8;
|
|
12604
13135
|
_t10 = _context10.v;
|
|
12605
|
-
_cachedResponse = this.cache.getVehicle(stopId, this.
|
|
13136
|
+
_cachedResponse = this.cache.getVehicle(stopId, this.currentLang);
|
|
12606
13137
|
if (!(_cachedResponse != null)) {
|
|
12607
13138
|
_context10.n = 9;
|
|
12608
13139
|
break;
|
|
@@ -12636,7 +13167,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12636
13167
|
while (1) switch (_context11.p = _context11.n) {
|
|
12637
13168
|
case 0:
|
|
12638
13169
|
_context11.p = 0;
|
|
12639
|
-
cachedResponse = this.cache.getStops(stopId + vehicleId, this.
|
|
13170
|
+
cachedResponse = this.cache.getStops(stopId + vehicleId, this.currentLang);
|
|
12640
13171
|
if (!(cachedResponse != null && Date.now() - cachedResponse.timestamp < 60 * 1000)) {
|
|
12641
13172
|
_context11.n = 1;
|
|
12642
13173
|
break;
|
|
@@ -12673,7 +13204,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12673
13204
|
this.cache.setStops(stopId + vehicleId, {
|
|
12674
13205
|
timestamp: Date.now(),
|
|
12675
13206
|
data: data
|
|
12676
|
-
}, this.
|
|
13207
|
+
}, this.currentLang);
|
|
12677
13208
|
this.logEvent("fetchAndParseStops", {
|
|
12678
13209
|
cached: "false"
|
|
12679
13210
|
});
|
|
@@ -13180,17 +13711,69 @@ function extractStepCoordinates(step) {
|
|
|
13180
13711
|
}
|
|
13181
13712
|
return coords;
|
|
13182
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
|
+
}
|
|
13183
13766
|
;// ./src/map/map.ts
|
|
13184
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); }
|
|
13185
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 }; })(); }
|
|
13186
13769
|
function map_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } map_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { map_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, map_regeneratorDefine2(e, r, n, t); }
|
|
13187
13770
|
function map_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
13188
13771
|
function map_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { map_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { map_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
13189
|
-
function map_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = map_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; } } }; }
|
|
13190
13772
|
function map_slicedToArray(r, e) { return map_arrayWithHoles(r) || map_iterableToArrayLimit(r, e) || map_unsupportedIterableToArray(r, e) || map_nonIterableRest(); }
|
|
13191
13773
|
function map_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."); }
|
|
13192
13774
|
function map_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; } }
|
|
13193
13775
|
function map_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13776
|
+
function map_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = map_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; } } }; }
|
|
13194
13777
|
function map_toConsumableArray(r) { return map_arrayWithoutHoles(r) || map_iterableToArray(r) || map_unsupportedIterableToArray(r) || map_nonIterableSpread(); }
|
|
13195
13778
|
function map_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."); }
|
|
13196
13779
|
function map_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return map_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) ? map_arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -13214,6 +13797,38 @@ function map_toPropertyKey(t) { var i = map_toPrimitive(t, "string"); return "sy
|
|
|
13214
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); }
|
|
13215
13798
|
|
|
13216
13799
|
|
|
13800
|
+
|
|
13801
|
+
/** Shared GeoJSON source holding every circle drawn through the circle API. */
|
|
13802
|
+
var CIRCLE_SOURCE_ID = "mapvx-circles";
|
|
13803
|
+
/** Fill layer rendering the translucent interior of the circles. */
|
|
13804
|
+
var CIRCLE_FILL_LAYER_ID = "mapvx-circles-fill";
|
|
13805
|
+
/** Line layer rendering the circle outlines. */
|
|
13806
|
+
var CIRCLE_LINE_LAYER_ID = "mapvx-circles-line";
|
|
13807
|
+
|
|
13808
|
+
/**
|
|
13809
|
+
* Layer-id suffix per circle render order. The default placement keeps the
|
|
13810
|
+
* unsuffixed ids so existing consumers referencing them keep working.
|
|
13811
|
+
*/
|
|
13812
|
+
var CIRCLE_LAYER_SUFFIXES = {
|
|
13813
|
+
aboveBasemap: "",
|
|
13814
|
+
belowLabels: "-below-labels",
|
|
13815
|
+
top: "-top"
|
|
13816
|
+
};
|
|
13817
|
+
|
|
13818
|
+
/** Fill/line layer ids for one circle render-order bucket. */
|
|
13819
|
+
function circleLayerIdsFor(order) {
|
|
13820
|
+
var suffix = CIRCLE_LAYER_SUFFIXES[order];
|
|
13821
|
+
return {
|
|
13822
|
+
fill: CIRCLE_FILL_LAYER_ID + suffix,
|
|
13823
|
+
line: CIRCLE_LINE_LAYER_ID + suffix
|
|
13824
|
+
};
|
|
13825
|
+
}
|
|
13826
|
+
|
|
13827
|
+
/** True for the layer ids owned by the circle API, regardless of bucket. */
|
|
13828
|
+
function isCircleLayerId(id) {
|
|
13829
|
+
return id.startsWith(CIRCLE_FILL_LAYER_ID) || id.startsWith(CIRCLE_LINE_LAYER_ID);
|
|
13830
|
+
}
|
|
13831
|
+
|
|
13217
13832
|
// Flag to track if cached-tile protocol has been registered
|
|
13218
13833
|
var cachedTileProtocolRegistered = false;
|
|
13219
13834
|
|
|
@@ -13236,23 +13851,40 @@ function deepClone(obj) {
|
|
|
13236
13851
|
/**
|
|
13237
13852
|
* Register a custom protocol for cached tiles that routes requests through the main thread.
|
|
13238
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.
|
|
13239
13862
|
*/
|
|
13240
|
-
function registerCachedTileProtocol() {
|
|
13863
|
+
function registerCachedTileProtocol(maxConcurrentFetches) {
|
|
13241
13864
|
if (cachedTileProtocolRegistered) return;
|
|
13865
|
+
var semaphore = new Semaphore(maxConcurrentFetches);
|
|
13242
13866
|
maplibre_gl_default().addProtocol("cached-tile", function (params, abortController) {
|
|
13243
|
-
// Convert cached-tile:// URL back to https://
|
|
13244
13867
|
var url = params.url.replace("cached-tile://", "https://");
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
return
|
|
13252
|
-
|
|
13253
|
-
|
|
13254
|
-
|
|
13255
|
-
|
|
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
|
+
});
|
|
13256
13888
|
});
|
|
13257
13889
|
});
|
|
13258
13890
|
cachedTileProtocolRegistered = true;
|
|
@@ -13327,6 +13959,8 @@ function convertPaddingToPixels(padding, containerWidth, containerHeight) {
|
|
|
13327
13959
|
|
|
13328
13960
|
|
|
13329
13961
|
|
|
13962
|
+
|
|
13963
|
+
|
|
13330
13964
|
/**
|
|
13331
13965
|
* @group Map
|
|
13332
13966
|
*/
|
|
@@ -13356,6 +13990,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13356
13990
|
map_defineProperty(_this, "currentFloor", "");
|
|
13357
13991
|
map_defineProperty(_this, "baseFilters", {});
|
|
13358
13992
|
map_defineProperty(_this, "markers", []);
|
|
13993
|
+
map_defineProperty(_this, "circles", []);
|
|
13359
13994
|
map_defineProperty(_this, "enableHover", false);
|
|
13360
13995
|
map_defineProperty(_this, "hoveredId", "unselected");
|
|
13361
13996
|
map_defineProperty(_this, "failedTiles", new Set());
|
|
@@ -13371,8 +14006,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13371
14006
|
_this.watchPositionID = undefined;
|
|
13372
14007
|
_this.onFloorChange = mapConfig.onFloorChange;
|
|
13373
14008
|
_this.onParentPlaceChange = mapConfig.onParentPlaceChange;
|
|
13374
|
-
|
|
13375
|
-
|
|
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
|
+
}();
|
|
13376
14014
|
if (mapConfig.parentPlaceId != null) {
|
|
13377
14015
|
_this.initialPlaceDetailSetUp(mapConfig.parentPlaceId, mapConfig.authToken);
|
|
13378
14016
|
}
|
|
@@ -13482,15 +14120,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13482
14120
|
_this6 = this;
|
|
13483
14121
|
// Determine if service worker caching should be enabled
|
|
13484
14122
|
var useServiceWorkerCaching = this.tileCacheConfig.enabled && this.tileCacheConfig.persistToServiceWorker;
|
|
13485
|
-
|
|
13486
|
-
// Register cached-tile protocol only if service worker caching is enabled
|
|
13487
14123
|
if (useServiceWorkerCaching) {
|
|
13488
|
-
registerCachedTileProtocol();
|
|
14124
|
+
registerCachedTileProtocol(this.tileCacheConfig.maxConcurrentTileFetches);
|
|
13489
14125
|
}
|
|
13490
14126
|
|
|
13491
14127
|
// Transform tile URLs only if service worker caching is enabled
|
|
13492
14128
|
var finalStyle = useServiceWorkerCaching ? this.transformStyleForCaching(style) : style;
|
|
13493
|
-
var mapOptions = {
|
|
14129
|
+
var mapOptions = map_objectSpread({
|
|
13494
14130
|
container: container,
|
|
13495
14131
|
style: finalStyle,
|
|
13496
14132
|
center: mapConfig.center,
|
|
@@ -13499,10 +14135,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13499
14135
|
attributionControl: false,
|
|
13500
14136
|
maplibreLogo: false,
|
|
13501
14137
|
bearingSnap: (_mapConfig$bearingSna = mapConfig.bearingSnap) !== null && _mapConfig$bearingSna !== void 0 ? _mapConfig$bearingSna : 0,
|
|
13502
|
-
cancelPendingTileRequestsWhileZooming:
|
|
14138
|
+
cancelPendingTileRequestsWhileZooming: true,
|
|
13503
14139
|
// Use configured maxTiles for MapLibre's memory cache
|
|
13504
14140
|
maxTileCacheSize: this.tileCacheConfig.maxTiles
|
|
13505
|
-
};
|
|
14141
|
+
}, buildInteractionOptions(mapConfig));
|
|
13506
14142
|
if (mapConfig.maxZoom) mapOptions.maxZoom = mapConfig.maxZoom;
|
|
13507
14143
|
if (mapConfig.minZoom) mapOptions.minZoom = mapConfig.minZoom;
|
|
13508
14144
|
if (mapConfig.maxBounds && mapConfig.maxBounds.length > 1) {
|
|
@@ -13510,6 +14146,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13510
14146
|
mapOptions.maxBounds = new maplibre_gl.LngLatBounds([boundingBox[0].lng, boundingBox[0].lat], [boundingBox[1].lng, boundingBox[1].lat]);
|
|
13511
14147
|
}
|
|
13512
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
|
+
}
|
|
13513
14155
|
this.map.addControl(new maplibre_gl.NavigationControl({
|
|
13514
14156
|
showCompass: mapConfig.showCompass !== undefined ? mapConfig.showCompass : true,
|
|
13515
14157
|
showZoom: mapConfig.showZoom !== undefined ? mapConfig.showZoom : true
|
|
@@ -13522,6 +14164,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13522
14164
|
_this6.onHover();
|
|
13523
14165
|
_this6.subscribeToFailedTiles();
|
|
13524
14166
|
});
|
|
14167
|
+
// Self-healing for circles: a full style reload wipes custom sources and
|
|
14168
|
+
// layers, and not every restyle path goes through whenStyleUpdates.
|
|
14169
|
+
this.map.on("styledata", function () {
|
|
14170
|
+
if (_this6.circles.length > 0) _this6.ensureCircleLayers();
|
|
14171
|
+
});
|
|
13525
14172
|
this.map.on("zoomend", function () {
|
|
13526
14173
|
var _mapConfig$onZoomEnd;
|
|
13527
14174
|
(_mapConfig$onZoomEnd = mapConfig.onZoomEnd) === null || _mapConfig$onZoomEnd === void 0 || _mapConfig$onZoomEnd.call(mapConfig, _this6.getZoomLevel());
|
|
@@ -13619,6 +14266,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13619
14266
|
}, {
|
|
13620
14267
|
key: "destroyMap",
|
|
13621
14268
|
value: function destroyMap() {
|
|
14269
|
+
this.circles = [];
|
|
13622
14270
|
this.map.remove();
|
|
13623
14271
|
this.unsubscribeFromFailedTiles();
|
|
13624
14272
|
}
|
|
@@ -13727,7 +14375,22 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13727
14375
|
}, {
|
|
13728
14376
|
key: "setLang",
|
|
13729
14377
|
value: function setLang(lang) {
|
|
14378
|
+
var _this0 = this;
|
|
13730
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
|
+
}
|
|
13731
14394
|
}
|
|
13732
14395
|
}, {
|
|
13733
14396
|
key: "setParentPlace",
|
|
@@ -13756,12 +14419,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13756
14419
|
this.setBaseFilters(newStyle);
|
|
13757
14420
|
}
|
|
13758
14421
|
this.routeController.addSourcesAndLayers();
|
|
14422
|
+
this.refreshCircles();
|
|
13759
14423
|
this.filterByFloorKey(this.currentFloor);
|
|
13760
14424
|
}
|
|
13761
14425
|
}, {
|
|
13762
14426
|
key: "addMarker",
|
|
13763
14427
|
value: function addMarker(marker) {
|
|
13764
|
-
var
|
|
14428
|
+
var _this1 = this;
|
|
13765
14429
|
try {
|
|
13766
14430
|
var _this$innerFloors$fin4, _this$innerFloors$fin5;
|
|
13767
14431
|
// Check if a marker with the same ID already exists and remove it
|
|
@@ -13781,7 +14445,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13781
14445
|
}
|
|
13782
14446
|
var markerCreated = new MarkerAttribute(marker);
|
|
13783
14447
|
var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin4 = (_this$innerFloors$fin5 = this.innerFloors.find(function (floor) {
|
|
13784
|
-
return floor.key ===
|
|
14448
|
+
return floor.key === _this1.currentFloor;
|
|
13785
14449
|
})) === null || _this$innerFloors$fin5 === void 0 ? void 0 : _this$innerFloors$fin5.reachableFromGPS) !== null && _this$innerFloors$fin4 !== void 0 ? _this$innerFloors$fin4 : false);
|
|
13786
14450
|
markerCreated.changeFloor(this.currentFloor, this.map, isOutdoor);
|
|
13787
14451
|
this.markers.push(markerCreated);
|
|
@@ -13884,6 +14548,374 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13884
14548
|
throw new Error("Failed to remove all markers");
|
|
13885
14549
|
}
|
|
13886
14550
|
}
|
|
14551
|
+
}, {
|
|
14552
|
+
key: "addCircle",
|
|
14553
|
+
value: function addCircle(circle) {
|
|
14554
|
+
try {
|
|
14555
|
+
// Check if a circle with the same ID already exists and replace it
|
|
14556
|
+
if (circle.id) {
|
|
14557
|
+
this.circles = this.circles.filter(function (c) {
|
|
14558
|
+
return c.id !== circle.id;
|
|
14559
|
+
});
|
|
14560
|
+
}
|
|
14561
|
+
// resolveCircleConfig validates radiusMeters and coordinates
|
|
14562
|
+
var record = resolveCircleConfig(circle);
|
|
14563
|
+
this.circles.push(record);
|
|
14564
|
+
this.refreshCircles();
|
|
14565
|
+
this.logEvent("addCircle");
|
|
14566
|
+
return record.id;
|
|
14567
|
+
} catch (error) {
|
|
14568
|
+
throw new Error("Failed to add circle: ".concat(error instanceof Error ? error.message : String(error)));
|
|
14569
|
+
}
|
|
14570
|
+
}
|
|
14571
|
+
}, {
|
|
14572
|
+
key: "updateCircle",
|
|
14573
|
+
value: function updateCircle(circleConfig) {
|
|
14574
|
+
try {
|
|
14575
|
+
var index = this.circles.findIndex(function (c) {
|
|
14576
|
+
return c.id === circleConfig.id;
|
|
14577
|
+
});
|
|
14578
|
+
if (index === -1) return null;
|
|
14579
|
+
|
|
14580
|
+
// resolveCircleConfig validates radiusMeters and coordinates
|
|
14581
|
+
this.circles[index] = resolveCircleConfig(circleConfig, this.circles[index].hidden);
|
|
14582
|
+
this.refreshCircles();
|
|
14583
|
+
this.logEvent("updateCircle");
|
|
14584
|
+
return this.circles[index].id;
|
|
14585
|
+
} catch (error) {
|
|
14586
|
+
throw new Error("Failed to update circle: ".concat(error instanceof Error ? error.message : String(error)));
|
|
14587
|
+
}
|
|
14588
|
+
}
|
|
14589
|
+
}, {
|
|
14590
|
+
key: "getCircle",
|
|
14591
|
+
value: function getCircle(circleId) {
|
|
14592
|
+
var circle = this.circles.find(function (c) {
|
|
14593
|
+
return c.id === circleId;
|
|
14594
|
+
});
|
|
14595
|
+
return circle ? cloneCircleRecord(circle) : undefined;
|
|
14596
|
+
}
|
|
14597
|
+
}, {
|
|
14598
|
+
key: "getCircles",
|
|
14599
|
+
value: function getCircles() {
|
|
14600
|
+
return this.circles.map(cloneCircleRecord);
|
|
14601
|
+
}
|
|
14602
|
+
}, {
|
|
14603
|
+
key: "hasCircle",
|
|
14604
|
+
value: function hasCircle(circleId) {
|
|
14605
|
+
return this.circles.some(function (c) {
|
|
14606
|
+
return c.id === circleId;
|
|
14607
|
+
});
|
|
14608
|
+
}
|
|
14609
|
+
}, {
|
|
14610
|
+
key: "updateCirclePosition",
|
|
14611
|
+
value: function updateCirclePosition(circleId, center, radiusMeters) {
|
|
14612
|
+
try {
|
|
14613
|
+
var _circle = this.circles.find(function (c) {
|
|
14614
|
+
return c.id === circleId;
|
|
14615
|
+
});
|
|
14616
|
+
if (_circle === undefined) return false;
|
|
14617
|
+
|
|
14618
|
+
// Validate inputs before modifying
|
|
14619
|
+
if (!center) {
|
|
14620
|
+
throw new Error("Circle center is required");
|
|
14621
|
+
}
|
|
14622
|
+
var lat = center.lat,
|
|
14623
|
+
lng = center.lng;
|
|
14624
|
+
if (!Number.isFinite(lat) || lat < -90 || lat > 90) {
|
|
14625
|
+
throw new Error("Invalid latitude: ".concat(lat, ". Must be between -90 and 90."));
|
|
14626
|
+
}
|
|
14627
|
+
if (!Number.isFinite(lng) || lng < -180 || lng > 180) {
|
|
14628
|
+
throw new Error("Invalid longitude: ".concat(lng, ". Must be between -180 and 180."));
|
|
14629
|
+
}
|
|
14630
|
+
if (radiusMeters !== undefined) {
|
|
14631
|
+
if (!Number.isFinite(radiusMeters) || radiusMeters <= 0) {
|
|
14632
|
+
throw new Error("Invalid radiusMeters: ".concat(radiusMeters, ". Must be a positive finite number."));
|
|
14633
|
+
}
|
|
14634
|
+
}
|
|
14635
|
+
_circle.coordinate = {
|
|
14636
|
+
lat: center.lat,
|
|
14637
|
+
lng: center.lng
|
|
14638
|
+
};
|
|
14639
|
+
if (radiusMeters !== undefined) {
|
|
14640
|
+
_circle.radiusMeters = radiusMeters;
|
|
14641
|
+
}
|
|
14642
|
+
this.refreshCircles();
|
|
14643
|
+
this.logEvent("updateCirclePosition");
|
|
14644
|
+
return true;
|
|
14645
|
+
} catch (error) {
|
|
14646
|
+
throw new Error("Failed to update circle position: ".concat(error instanceof Error ? error.message : String(error)));
|
|
14647
|
+
}
|
|
14648
|
+
}
|
|
14649
|
+
}, {
|
|
14650
|
+
key: "updateCircleStyle",
|
|
14651
|
+
value: function updateCircleStyle(circleId, style) {
|
|
14652
|
+
try {
|
|
14653
|
+
var _circle2 = this.circles.find(function (c) {
|
|
14654
|
+
return c.id === circleId;
|
|
14655
|
+
});
|
|
14656
|
+
if (_circle2 === undefined) return false;
|
|
14657
|
+
|
|
14658
|
+
// Update only style properties, clamp opacities
|
|
14659
|
+
if (style.fillColor !== undefined) _circle2.fillColor = style.fillColor;
|
|
14660
|
+
if (style.fillOpacity !== undefined) _circle2.fillOpacity = Math.max(0, Math.min(1, style.fillOpacity));
|
|
14661
|
+
if (style.strokeColor !== undefined) _circle2.strokeColor = style.strokeColor;
|
|
14662
|
+
if (style.strokeWidth !== undefined) _circle2.strokeWidth = style.strokeWidth;
|
|
14663
|
+
if (style.strokeOpacity !== undefined) _circle2.strokeOpacity = Math.max(0, Math.min(1, style.strokeOpacity));
|
|
14664
|
+
this.refreshCircles();
|
|
14665
|
+
this.logEvent("updateCircleStyle");
|
|
14666
|
+
return true;
|
|
14667
|
+
} catch (error) {
|
|
14668
|
+
throw new Error("Failed to update circle style: ".concat(error instanceof Error ? error.message : String(error)));
|
|
14669
|
+
}
|
|
14670
|
+
}
|
|
14671
|
+
}, {
|
|
14672
|
+
key: "removeCircle",
|
|
14673
|
+
value: function removeCircle(circleId) {
|
|
14674
|
+
try {
|
|
14675
|
+
this.circles = this.circles.filter(function (c) {
|
|
14676
|
+
return c.id !== circleId;
|
|
14677
|
+
});
|
|
14678
|
+
this.refreshCircles();
|
|
14679
|
+
this.logEvent("removeCircle");
|
|
14680
|
+
} catch (error) {
|
|
14681
|
+
throw new Error("Failed to remove circle");
|
|
14682
|
+
}
|
|
14683
|
+
}
|
|
14684
|
+
}, {
|
|
14685
|
+
key: "removeAllCircles",
|
|
14686
|
+
value: function removeAllCircles() {
|
|
14687
|
+
try {
|
|
14688
|
+
this.circles = [];
|
|
14689
|
+
this.refreshCircles();
|
|
14690
|
+
this.logEvent("removeAllCircles");
|
|
14691
|
+
} catch (error) {
|
|
14692
|
+
throw new Error("Failed to remove all circles");
|
|
14693
|
+
}
|
|
14694
|
+
}
|
|
14695
|
+
}, {
|
|
14696
|
+
key: "showCircle",
|
|
14697
|
+
value: function showCircle(circleId) {
|
|
14698
|
+
try {
|
|
14699
|
+
var _circle3 = this.circles.find(function (c) {
|
|
14700
|
+
return c.id === circleId;
|
|
14701
|
+
});
|
|
14702
|
+
if (_circle3 === undefined) {
|
|
14703
|
+
return false;
|
|
14704
|
+
}
|
|
14705
|
+
_circle3.hidden = false;
|
|
14706
|
+
this.refreshCircles();
|
|
14707
|
+
this.logEvent("showCircle");
|
|
14708
|
+
return true;
|
|
14709
|
+
} catch (error) {
|
|
14710
|
+
return false;
|
|
14711
|
+
}
|
|
14712
|
+
}
|
|
14713
|
+
}, {
|
|
14714
|
+
key: "hideCircle",
|
|
14715
|
+
value: function hideCircle(circleId) {
|
|
14716
|
+
try {
|
|
14717
|
+
var _circle4 = this.circles.find(function (c) {
|
|
14718
|
+
return c.id === circleId;
|
|
14719
|
+
});
|
|
14720
|
+
if (_circle4 === undefined) {
|
|
14721
|
+
return false;
|
|
14722
|
+
}
|
|
14723
|
+
_circle4.hidden = true;
|
|
14724
|
+
this.refreshCircles();
|
|
14725
|
+
this.logEvent("hideCircle");
|
|
14726
|
+
return true;
|
|
14727
|
+
} catch (error) {
|
|
14728
|
+
return false;
|
|
14729
|
+
}
|
|
14730
|
+
}
|
|
14731
|
+
|
|
14732
|
+
/**
|
|
14733
|
+
* Builds the GeoJSON FeatureCollection for every currently visible circle.
|
|
14734
|
+
* Visibility mirrors marker semantics: a circle with a floor is shown only
|
|
14735
|
+
* while that floor is displayed, and a circle without a floor is shown only
|
|
14736
|
+
* in outdoor contexts. Hidden circles are always omitted.
|
|
14737
|
+
*/
|
|
14738
|
+
}, {
|
|
14739
|
+
key: "circleFeatureCollection",
|
|
14740
|
+
value: function circleFeatureCollection() {
|
|
14741
|
+
var _this$currentFloor3, _this$innerFloors$fin6, _this$innerFloors$fin7;
|
|
14742
|
+
var floorId = (_this$currentFloor3 = this.currentFloor) !== null && _this$currentFloor3 !== void 0 ? _this$currentFloor3 : "";
|
|
14743
|
+
var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin6 = (_this$innerFloors$fin7 = this.innerFloors.find(function (floor) {
|
|
14744
|
+
return floor.key === floorId;
|
|
14745
|
+
})) === null || _this$innerFloors$fin7 === void 0 ? void 0 : _this$innerFloors$fin7.reachableFromGPS) !== null && _this$innerFloors$fin6 !== void 0 ? _this$innerFloors$fin6 : false);
|
|
14746
|
+
var features = this.circles.filter(function (circle) {
|
|
14747
|
+
var _circle$floorId;
|
|
14748
|
+
if (circle.hidden) return false;
|
|
14749
|
+
var circleFloor = (_circle$floorId = circle.floorId) !== null && _circle$floorId !== void 0 ? _circle$floorId : "";
|
|
14750
|
+
return circleFloor === floorId || isOutdoor && circleFloor === "";
|
|
14751
|
+
}).map(function (circle) {
|
|
14752
|
+
return {
|
|
14753
|
+
type: "Feature",
|
|
14754
|
+
properties: {
|
|
14755
|
+
id: circle.id,
|
|
14756
|
+
fillColor: circle.fillColor,
|
|
14757
|
+
fillOpacity: circle.fillOpacity,
|
|
14758
|
+
strokeColor: circle.strokeColor,
|
|
14759
|
+
strokeWidth: circle.strokeWidth,
|
|
14760
|
+
strokeOpacity: circle.strokeOpacity,
|
|
14761
|
+
renderOrder: circle.renderOrder
|
|
14762
|
+
},
|
|
14763
|
+
geometry: {
|
|
14764
|
+
type: "Polygon",
|
|
14765
|
+
coordinates: [circleRing(circle.coordinate.lng, circle.coordinate.lat, circle.radiusMeters)]
|
|
14766
|
+
}
|
|
14767
|
+
};
|
|
14768
|
+
});
|
|
14769
|
+
return {
|
|
14770
|
+
type: "FeatureCollection",
|
|
14771
|
+
features: features
|
|
14772
|
+
};
|
|
14773
|
+
}
|
|
14774
|
+
|
|
14775
|
+
/**
|
|
14776
|
+
* Idempotently adds the shared circle source and its fill/line layers.
|
|
14777
|
+
* Layers are inserted below the first symbol layer so place labels and
|
|
14778
|
+
* markers stay readable above the translucent fill. Safe to call at any
|
|
14779
|
+
* time: a style that is still loading simply rejects the calls, and the
|
|
14780
|
+
* styledata listener retries once the style is ready.
|
|
14781
|
+
*/
|
|
14782
|
+
/**
|
|
14783
|
+
* Resolves the layer id to insert circle layers before, for one render
|
|
14784
|
+
* order. `undefined` means "append on top".
|
|
14785
|
+
*
|
|
14786
|
+
* `aboveBasemap` finds the topmost non-symbol layer of the style and
|
|
14787
|
+
* inserts before the first symbol layer that follows it. On indoor styles
|
|
14788
|
+
* the floor-plate and building polygons are ordered after the first symbol
|
|
14789
|
+
* layer, so anchoring on the topmost geometry layer — instead of the first
|
|
14790
|
+
* symbol layer — guarantees circles are never occluded by basemap fills
|
|
14791
|
+
* while still rendering below the labels that follow them.
|
|
14792
|
+
*/
|
|
14793
|
+
}, {
|
|
14794
|
+
key: "circleBeforeIdFor",
|
|
14795
|
+
value: function circleBeforeIdFor(order) {
|
|
14796
|
+
var _this$map$getStyle$la2, _this$map$getStyle2, _layers$slice$find;
|
|
14797
|
+
if (order === "top") return undefined;
|
|
14798
|
+
var layers = ((_this$map$getStyle$la2 = (_this$map$getStyle2 = this.map.getStyle()) === null || _this$map$getStyle2 === void 0 ? void 0 : _this$map$getStyle2.layers) !== null && _this$map$getStyle$la2 !== void 0 ? _this$map$getStyle$la2 : []).filter(function (layer) {
|
|
14799
|
+
return !isCircleLayerId(layer.id);
|
|
14800
|
+
});
|
|
14801
|
+
if (order === "belowLabels") {
|
|
14802
|
+
var _layers$find;
|
|
14803
|
+
return (_layers$find = layers.find(function (layer) {
|
|
14804
|
+
return layer.type === "symbol";
|
|
14805
|
+
})) === null || _layers$find === void 0 ? void 0 : _layers$find.id;
|
|
14806
|
+
}
|
|
14807
|
+
|
|
14808
|
+
// aboveBasemap
|
|
14809
|
+
var lastNonSymbolIndex = -1;
|
|
14810
|
+
layers.forEach(function (layer, index) {
|
|
14811
|
+
if (layer.type !== "symbol") lastNonSymbolIndex = index;
|
|
14812
|
+
});
|
|
14813
|
+
return (_layers$slice$find = layers.slice(lastNonSymbolIndex + 1).find(function (layer) {
|
|
14814
|
+
return layer.type === "symbol";
|
|
14815
|
+
})) === null || _layers$slice$find === void 0 ? void 0 : _layers$slice$find.id;
|
|
14816
|
+
}
|
|
14817
|
+
|
|
14818
|
+
/**
|
|
14819
|
+
* Idempotently ensures the shared circle source and one fill/line layer
|
|
14820
|
+
* pair per render order in use, at the placement that order requires.
|
|
14821
|
+
* Placement is recomputed and re-asserted (via moveLayer) on every call,
|
|
14822
|
+
* so circles regain their correct z-order after any style reload or
|
|
14823
|
+
* floor/parent-place change. Safe to call at any time: a style that is
|
|
14824
|
+
* still loading simply rejects the calls, and the styledata listener
|
|
14825
|
+
* retries once the style is ready.
|
|
14826
|
+
*/
|
|
14827
|
+
}, {
|
|
14828
|
+
key: "ensureCircleLayers",
|
|
14829
|
+
value: function ensureCircleLayers() {
|
|
14830
|
+
if (!this.map) return;
|
|
14831
|
+
try {
|
|
14832
|
+
if (!this.map.getSource(CIRCLE_SOURCE_ID)) {
|
|
14833
|
+
this.map.addSource(CIRCLE_SOURCE_ID, {
|
|
14834
|
+
type: "geojson",
|
|
14835
|
+
data: this.circleFeatureCollection()
|
|
14836
|
+
});
|
|
14837
|
+
}
|
|
14838
|
+
var ordersInUse = new Set(this.circles.map(function (c) {
|
|
14839
|
+
return c.renderOrder;
|
|
14840
|
+
}));
|
|
14841
|
+
// Always keep the default bucket alive so an empty map still renders
|
|
14842
|
+
// newly added circles without a layer rebuild
|
|
14843
|
+
ordersInUse.add("aboveBasemap");
|
|
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),
|
|
14851
|
+
_step;
|
|
14852
|
+
try {
|
|
14853
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
14854
|
+
var order = _step.value;
|
|
14855
|
+
if (!ordersInUse.has(order)) continue;
|
|
14856
|
+
var ids = circleLayerIdsFor(order);
|
|
14857
|
+
var beforeId = this.circleBeforeIdFor(order);
|
|
14858
|
+
var orderFilter = ["==", ["get", "renderOrder"], order];
|
|
14859
|
+
if (!this.map.getLayer(ids.fill)) {
|
|
14860
|
+
var fillLayer = {
|
|
14861
|
+
id: ids.fill,
|
|
14862
|
+
type: "fill",
|
|
14863
|
+
source: CIRCLE_SOURCE_ID,
|
|
14864
|
+
filter: orderFilter,
|
|
14865
|
+
paint: {
|
|
14866
|
+
"fill-color": ["get", "fillColor"],
|
|
14867
|
+
"fill-opacity": ["get", "fillOpacity"]
|
|
14868
|
+
}
|
|
14869
|
+
};
|
|
14870
|
+
this.map.addLayer(fillLayer, beforeId);
|
|
14871
|
+
} else {
|
|
14872
|
+
this.map.moveLayer(ids.fill, beforeId);
|
|
14873
|
+
}
|
|
14874
|
+
if (!this.map.getLayer(ids.line)) {
|
|
14875
|
+
var lineLayer = {
|
|
14876
|
+
id: ids.line,
|
|
14877
|
+
type: "line",
|
|
14878
|
+
source: CIRCLE_SOURCE_ID,
|
|
14879
|
+
filter: orderFilter,
|
|
14880
|
+
paint: {
|
|
14881
|
+
"line-color": ["get", "strokeColor"],
|
|
14882
|
+
"line-width": ["get", "strokeWidth"],
|
|
14883
|
+
"line-opacity": ["get", "strokeOpacity"]
|
|
14884
|
+
}
|
|
14885
|
+
};
|
|
14886
|
+
this.map.addLayer(lineLayer, beforeId);
|
|
14887
|
+
} else {
|
|
14888
|
+
this.map.moveLayer(ids.line, beforeId);
|
|
14889
|
+
}
|
|
14890
|
+
}
|
|
14891
|
+
} catch (err) {
|
|
14892
|
+
_iterator.e(err);
|
|
14893
|
+
} finally {
|
|
14894
|
+
_iterator.f();
|
|
14895
|
+
}
|
|
14896
|
+
} catch (error) {
|
|
14897
|
+
// Style may not be loaded yet; the styledata listener re-adds the layers
|
|
14898
|
+
}
|
|
14899
|
+
}
|
|
14900
|
+
|
|
14901
|
+
/**
|
|
14902
|
+
* Re-renders all circles: ensures the source and layers exist, then pushes
|
|
14903
|
+
* the current FeatureCollection. Called after every mutation of the circle
|
|
14904
|
+
* list, on floor changes, and when the map style reloads.
|
|
14905
|
+
*/
|
|
14906
|
+
}, {
|
|
14907
|
+
key: "refreshCircles",
|
|
14908
|
+
value: function refreshCircles() {
|
|
14909
|
+
if (!this.map) return;
|
|
14910
|
+
if (this.circles.length === 0 && !this.map.getSource(CIRCLE_SOURCE_ID)) return;
|
|
14911
|
+
this.ensureCircleLayers();
|
|
14912
|
+
try {
|
|
14913
|
+
var source = this.map.getSource(CIRCLE_SOURCE_ID);
|
|
14914
|
+
source === null || source === void 0 || source.setData(this.circleFeatureCollection());
|
|
14915
|
+
} catch (error) {
|
|
14916
|
+
// Source may not exist while a new style is loading
|
|
14917
|
+
}
|
|
14918
|
+
}
|
|
13887
14919
|
|
|
13888
14920
|
/**
|
|
13889
14921
|
* Use it to change the current layer
|
|
@@ -13903,6 +14935,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13903
14935
|
}
|
|
13904
14936
|
this.updateFiltersTo(floorKeyString);
|
|
13905
14937
|
this.updateMarkersTo(floorKeyString);
|
|
14938
|
+
this.refreshCircles();
|
|
13906
14939
|
this.routeController.updateRouteLayers(floorKeyString);
|
|
13907
14940
|
this.routeController.updateRouteMarkerVisibility(floorKeyString);
|
|
13908
14941
|
}
|
|
@@ -13914,33 +14947,33 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13914
14947
|
}, {
|
|
13915
14948
|
key: "updateMarkersTo",
|
|
13916
14949
|
value: function updateMarkersTo(floorId) {
|
|
13917
|
-
var _this$innerFloors$
|
|
13918
|
-
_this$innerFloors$
|
|
13919
|
-
|
|
13920
|
-
var isOutdoor = !this.parentPlace || ((_this$innerFloors$
|
|
14950
|
+
var _this$innerFloors$fin8,
|
|
14951
|
+
_this$innerFloors$fin9,
|
|
14952
|
+
_this10 = this;
|
|
14953
|
+
var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin8 = (_this$innerFloors$fin9 = this.innerFloors.find(function (floor) {
|
|
13921
14954
|
return floor.key === floorId;
|
|
13922
|
-
})) === null || _this$innerFloors$
|
|
14955
|
+
})) === null || _this$innerFloors$fin9 === void 0 ? void 0 : _this$innerFloors$fin9.reachableFromGPS) !== null && _this$innerFloors$fin8 !== void 0 ? _this$innerFloors$fin8 : false);
|
|
13923
14956
|
this.markers.forEach(function (e) {
|
|
13924
|
-
e.changeFloor(floorId,
|
|
14957
|
+
e.changeFloor(floorId, _this10.map, isOutdoor);
|
|
13925
14958
|
});
|
|
13926
14959
|
}
|
|
13927
14960
|
}, {
|
|
13928
14961
|
key: "updateFiltersTo",
|
|
13929
14962
|
value: function updateFiltersTo(floorId) {
|
|
13930
|
-
var _this$map$getStyle$
|
|
13931
|
-
_this$map$
|
|
13932
|
-
|
|
13933
|
-
_this$innerFloors$
|
|
14963
|
+
var _this$map$getStyle$la3,
|
|
14964
|
+
_this$map$getStyle3,
|
|
14965
|
+
_this11 = this,
|
|
14966
|
+
_this$innerFloors$fin0;
|
|
13934
14967
|
if (!this.map) return;
|
|
13935
|
-
var layers = (_this$map$getStyle$
|
|
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 : [];
|
|
13936
14969
|
layers.filter(function (l) {
|
|
13937
14970
|
return l.id.startsWith("base-indoor-");
|
|
13938
14971
|
}).forEach(function (l) {
|
|
13939
|
-
|
|
14972
|
+
_this11.map.removeLayer(l.id);
|
|
13940
14973
|
});
|
|
13941
|
-
var baseFloorId = (_this$innerFloors$
|
|
14974
|
+
var baseFloorId = (_this$innerFloors$fin0 = this.innerFloors.find(function (floor) {
|
|
13942
14975
|
return floor.key === floorId;
|
|
13943
|
-
})) === null || _this$innerFloors$
|
|
14976
|
+
})) === null || _this$innerFloors$fin0 === void 0 ? void 0 : _this$innerFloors$fin0.baseFloor;
|
|
13944
14977
|
var indoorLayers = layers.filter(function (layer) {
|
|
13945
14978
|
return layer.id.startsWith("indoor-");
|
|
13946
14979
|
});
|
|
@@ -13952,13 +14985,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
13952
14985
|
}).forEach(function (layer) {
|
|
13953
14986
|
var baseLayer = deepClone(layer);
|
|
13954
14987
|
baseLayer.id = "base-" + layer.id;
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
|
|
14988
|
+
_this11.baseFilters[baseLayer.id] = _this11.baseFilters[layer.id];
|
|
14989
|
+
_this11.map.addLayer(baseLayer, firstLayerId);
|
|
14990
|
+
_this11.applyLayerFilters(baseLayer, baseFloorId);
|
|
13958
14991
|
});
|
|
13959
14992
|
}
|
|
13960
14993
|
indoorLayers.forEach(function (layer) {
|
|
13961
|
-
|
|
14994
|
+
_this11.applyLayerFilters(layer, floorId);
|
|
13962
14995
|
});
|
|
13963
14996
|
}
|
|
13964
14997
|
}, {
|
|
@@ -14018,6 +15051,57 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14018
15051
|
this.map.setMinZoom(zoomLvl);
|
|
14019
15052
|
options === null || options === void 0 || (_options$onComplete3 = options.onComplete) === null || _options$onComplete3 === void 0 || _options$onComplete3.call(options);
|
|
14020
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
|
+
}
|
|
15093
|
+
}
|
|
15094
|
+
}, {
|
|
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
|
+
}
|
|
15104
|
+
}
|
|
14021
15105
|
}, {
|
|
14022
15106
|
key: "isInsideBounds",
|
|
14023
15107
|
value: function isInsideBounds(point) {
|
|
@@ -14030,12 +15114,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14030
15114
|
}, {
|
|
14031
15115
|
key: "setMaxBounds",
|
|
14032
15116
|
value: function setMaxBounds(coordinates, options) {
|
|
14033
|
-
var _options$
|
|
15117
|
+
var _options$onComplete5;
|
|
14034
15118
|
if (coordinates.length > 1) {
|
|
14035
15119
|
var boundingBox = getBoundingBox(coordinates);
|
|
14036
15120
|
this.map.setMaxBounds(new maplibre_gl.LngLatBounds([boundingBox[0].lng, boundingBox[0].lat], [boundingBox[1].lng, boundingBox[1].lat]));
|
|
14037
15121
|
}
|
|
14038
|
-
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);
|
|
14039
15123
|
}
|
|
14040
15124
|
}, {
|
|
14041
15125
|
key: "fitCoordinates",
|
|
@@ -14059,11 +15143,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14059
15143
|
var minLng;
|
|
14060
15144
|
var maxLat;
|
|
14061
15145
|
var maxLng;
|
|
14062
|
-
var
|
|
14063
|
-
|
|
15146
|
+
var _iterator2 = map_createForOfIteratorHelper(coordinates),
|
|
15147
|
+
_step2;
|
|
14064
15148
|
try {
|
|
14065
|
-
for (
|
|
14066
|
-
var _coord =
|
|
15149
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
15150
|
+
var _coord = _step2.value;
|
|
14067
15151
|
var lat = _coord.lat,
|
|
14068
15152
|
lng = _coord.lng;
|
|
14069
15153
|
minLat = minLat === undefined ? lat : Math.min(minLat, lat);
|
|
@@ -14072,9 +15156,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14072
15156
|
maxLng = maxLng === undefined ? lng : Math.max(maxLng, lng);
|
|
14073
15157
|
}
|
|
14074
15158
|
} catch (err) {
|
|
14075
|
-
|
|
15159
|
+
_iterator2.e(err);
|
|
14076
15160
|
} finally {
|
|
14077
|
-
|
|
15161
|
+
_iterator2.f();
|
|
14078
15162
|
}
|
|
14079
15163
|
var bounds = [minLng !== null && minLng !== void 0 ? minLng : 0, minLat !== null && minLat !== void 0 ? minLat : 0, maxLng !== null && maxLng !== void 0 ? maxLng : 0, maxLat !== null && maxLat !== void 0 ? maxLat : 0];
|
|
14080
15164
|
|
|
@@ -14126,13 +15210,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14126
15210
|
key: "updateFloor",
|
|
14127
15211
|
value: function updateFloor(floorId, options) {
|
|
14128
15212
|
try {
|
|
14129
|
-
var _this$onFloorChange2, _options$
|
|
15213
|
+
var _this$onFloorChange2, _options$onComplete6;
|
|
14130
15214
|
this.filterByFloorKey(floorId);
|
|
14131
15215
|
(_this$onFloorChange2 = this.onFloorChange) === null || _this$onFloorChange2 === void 0 || _this$onFloorChange2.call(this, floorId);
|
|
14132
15216
|
this.logEvent("updateFloor", {
|
|
14133
15217
|
floorId: floorId
|
|
14134
15218
|
});
|
|
14135
|
-
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);
|
|
14136
15220
|
} catch (error) {
|
|
14137
15221
|
// Floor update may fail
|
|
14138
15222
|
}
|
|
@@ -14196,7 +15280,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14196
15280
|
value: function updateRouteProgress(routeId, position) {
|
|
14197
15281
|
var behindStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
14198
15282
|
type: "Solid",
|
|
14199
|
-
color: "#
|
|
15283
|
+
color: "#276EF1"
|
|
14200
15284
|
};
|
|
14201
15285
|
try {
|
|
14202
15286
|
var behindConfig = new InternalDrawRouteConfiguration({
|
|
@@ -14251,13 +15335,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14251
15335
|
return subplace.clientId === placeId || subplace.mapvxId === placeId;
|
|
14252
15336
|
});
|
|
14253
15337
|
if (pointedPlace !== undefined) {
|
|
14254
|
-
new (maplibre_gl_default()).Popup().setLngLat(pointedPlace.position).
|
|
15338
|
+
new (maplibre_gl_default()).Popup().setLngLat(pointedPlace.position).setText(pointedPlace.title).addTo(this.map);
|
|
14255
15339
|
}
|
|
14256
15340
|
}
|
|
14257
15341
|
return "";
|
|
14258
15342
|
}
|
|
14259
|
-
|
|
14260
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14261
15343
|
}, {
|
|
14262
15344
|
key: "removePopOver",
|
|
14263
15345
|
value: function removePopOver(id) {
|
|
@@ -14276,17 +15358,17 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14276
15358
|
}, {
|
|
14277
15359
|
key: "defaultClickListener",
|
|
14278
15360
|
value: function defaultClickListener() {
|
|
14279
|
-
var
|
|
15361
|
+
var _this12 = this;
|
|
14280
15362
|
this.map.on("click", /*#__PURE__*/function () {
|
|
14281
15363
|
var _ref4 = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee2(e) {
|
|
14282
|
-
var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace,
|
|
15364
|
+
var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator3, _step3, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId, _t2;
|
|
14283
15365
|
return map_regenerator().w(function (_context2) {
|
|
14284
15366
|
while (1) switch (_context2.p = _context2.n) {
|
|
14285
15367
|
case 0:
|
|
14286
|
-
features =
|
|
15368
|
+
features = _this12.map.queryRenderedFeatures(e.point); // Filter room features by current floor
|
|
14287
15369
|
roomFeatures = features.filter(function (feature) {
|
|
14288
15370
|
var _feature$properties;
|
|
14289
|
-
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;
|
|
14290
15372
|
});
|
|
14291
15373
|
touchedFeature = roomFeatures[0];
|
|
14292
15374
|
ref = touchedFeature === null || touchedFeature === void 0 ? void 0 : touchedFeature.properties.ref;
|
|
@@ -14297,23 +15379,23 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14297
15379
|
console.log("touchedFeature", ref);
|
|
14298
15380
|
|
|
14299
15381
|
// First, search in current subPlaces
|
|
14300
|
-
clickedPlace =
|
|
15382
|
+
clickedPlace = _this12.subPlaces.find(function (subPlace) {
|
|
14301
15383
|
return subPlace.mapvxId === ref;
|
|
14302
15384
|
}); // If not found, search in subplaces of potential parent places
|
|
14303
15385
|
if (!(clickedPlace === undefined)) {
|
|
14304
15386
|
_context2.n = 7;
|
|
14305
15387
|
break;
|
|
14306
15388
|
}
|
|
14307
|
-
|
|
15389
|
+
_iterator3 = map_createForOfIteratorHelper(_this12.potentialParentPlaces);
|
|
14308
15390
|
_context2.p = 1;
|
|
14309
|
-
|
|
15391
|
+
_iterator3.s();
|
|
14310
15392
|
case 2:
|
|
14311
|
-
if ((
|
|
15393
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
14312
15394
|
_context2.n = 4;
|
|
14313
15395
|
break;
|
|
14314
15396
|
}
|
|
14315
|
-
potentialParentPlace =
|
|
14316
|
-
cachedSubPlaces =
|
|
15397
|
+
potentialParentPlace = _step3.value;
|
|
15398
|
+
cachedSubPlaces = _this12.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
|
|
14317
15399
|
if (!cachedSubPlaces) {
|
|
14318
15400
|
_context2.n = 3;
|
|
14319
15401
|
break;
|
|
@@ -14335,24 +15417,24 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14335
15417
|
case 5:
|
|
14336
15418
|
_context2.p = 5;
|
|
14337
15419
|
_t2 = _context2.v;
|
|
14338
|
-
|
|
15420
|
+
_iterator3.e(_t2);
|
|
14339
15421
|
case 6:
|
|
14340
15422
|
_context2.p = 6;
|
|
14341
|
-
|
|
15423
|
+
_iterator3.f();
|
|
14342
15424
|
return _context2.f(6);
|
|
14343
15425
|
case 7:
|
|
14344
15426
|
if (!(clickedPlace === undefined)) {
|
|
14345
15427
|
_context2.n = 10;
|
|
14346
15428
|
break;
|
|
14347
15429
|
}
|
|
14348
|
-
cachedPlaces =
|
|
15430
|
+
cachedPlaces = _this12.repository.getCachedPlaces([ref]);
|
|
14349
15431
|
if (!(cachedPlaces.length === 0)) {
|
|
14350
15432
|
_context2.n = 9;
|
|
14351
15433
|
break;
|
|
14352
15434
|
}
|
|
14353
15435
|
console.log("fetching place detail from server", ref);
|
|
14354
15436
|
_context2.n = 8;
|
|
14355
|
-
return
|
|
15437
|
+
return _this12.repository.fetchAndParsePlaceDetail(ref);
|
|
14356
15438
|
case 8:
|
|
14357
15439
|
clickedPlace = _context2.v;
|
|
14358
15440
|
_context2.n = 10;
|
|
@@ -14363,8 +15445,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14363
15445
|
case 10:
|
|
14364
15446
|
console.log("clickedPlace", (_clickedPlace = clickedPlace) === null || _clickedPlace === void 0 ? void 0 : _clickedPlace.title);
|
|
14365
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 : "";
|
|
14366
|
-
if (clickedPlace !== undefined &&
|
|
14367
|
-
|
|
15448
|
+
if (clickedPlace !== undefined && _this12.clickCallback) {
|
|
15449
|
+
_this12.clickCallback(clickedPlaceId);
|
|
14368
15450
|
}
|
|
14369
15451
|
case 11:
|
|
14370
15452
|
return _context2.a(2);
|
|
@@ -14379,29 +15461,29 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14379
15461
|
}, {
|
|
14380
15462
|
key: "onHover",
|
|
14381
15463
|
value: function onHover() {
|
|
14382
|
-
var
|
|
15464
|
+
var _this13 = this;
|
|
14383
15465
|
if (!this.enableHover) return;
|
|
14384
15466
|
this.map.on("mousemove", "hoverable", function (e) {
|
|
14385
15467
|
var _e$features;
|
|
14386
15468
|
var feature = (_e$features = e.features) === null || _e$features === void 0 ? void 0 : _e$features.find(function (feature) {
|
|
14387
15469
|
var _feature$properties$r, _feature$properties2;
|
|
14388
|
-
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;
|
|
14389
15471
|
});
|
|
14390
15472
|
var ref = feature === null || feature === void 0 ? void 0 : feature.properties.ref;
|
|
14391
15473
|
if (ref != null && typeof ref === "string" && ref.length > 0) {
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
} else if (ref === undefined &&
|
|
14395
|
-
|
|
14396
|
-
|
|
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);
|
|
14397
15479
|
}
|
|
14398
15480
|
});
|
|
14399
15481
|
|
|
14400
15482
|
// When the mouse leaves the state-fill layer, update the feature state of the
|
|
14401
15483
|
// previously hovered feature.
|
|
14402
15484
|
this.map.on("mouseleave", "hoverable", function () {
|
|
14403
|
-
|
|
14404
|
-
|
|
15485
|
+
_this13.hoveredId = "unselected";
|
|
15486
|
+
_this13.updateFiltersTo(_this13.currentFloor);
|
|
14405
15487
|
});
|
|
14406
15488
|
}
|
|
14407
15489
|
}, {
|
|
@@ -14457,7 +15539,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14457
15539
|
filter: ["all", ["has", "ref"], ["==", ["get", "ref"], "unselected"]],
|
|
14458
15540
|
paint: {
|
|
14459
15541
|
"fill-extrusion-height": 2.5,
|
|
14460
|
-
"fill-extrusion-color":
|
|
15542
|
+
"fill-extrusion-color": MAPVX_BRAND_COLOR,
|
|
14461
15543
|
"fill-extrusion-opacity": 0.8
|
|
14462
15544
|
}
|
|
14463
15545
|
};
|
|
@@ -14470,7 +15552,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14470
15552
|
"source-layer": "area",
|
|
14471
15553
|
filter: ["all", ["has", "ref"], ["==", ["get", "ref"], "unselected"]],
|
|
14472
15554
|
paint: {
|
|
14473
|
-
"fill-color":
|
|
15555
|
+
"fill-color": MAPVX_BRAND_COLOR
|
|
14474
15556
|
}
|
|
14475
15557
|
};
|
|
14476
15558
|
this.map.addLayer(_layer);
|
|
@@ -14479,10 +15561,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14479
15561
|
}, {
|
|
14480
15562
|
key: "createBasicFilters",
|
|
14481
15563
|
value: function createBasicFilters() {
|
|
14482
|
-
var _this$parentPlaceId3, _this$
|
|
15564
|
+
var _this$parentPlaceId3, _this$currentFloor4;
|
|
14483
15565
|
var publicPlaceFilter = ["==", ["get", "public_place"], true];
|
|
14484
15566
|
var subPlaceFilter = ["!", ["in", (_this$parentPlaceId3 = this.parentPlaceId) !== null && _this$parentPlaceId3 !== void 0 ? _this$parentPlaceId3 : "noRef", ["get", "is_subplace"]]];
|
|
14485
|
-
var floorId = (_this$
|
|
15567
|
+
var floorId = (_this$currentFloor4 = this.currentFloor) !== null && _this$currentFloor4 !== void 0 ? _this$currentFloor4 : "noRef";
|
|
14486
15568
|
var floorFilter = ["in", floorId, ["get", "floor_key"]];
|
|
14487
15569
|
var showInFloorFilter = ["in", floorId, ["get", "show_in_floor"]];
|
|
14488
15570
|
var basicFilters = publicPlaceFilter;
|
|
@@ -14864,7 +15946,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14864
15946
|
"source-layer": "area",
|
|
14865
15947
|
filter: ["all", ["has", "ref"], ["==", ["get", "ref"], "unselected"]],
|
|
14866
15948
|
paint: {
|
|
14867
|
-
"line-color":
|
|
15949
|
+
"line-color": MAPVX_BRAND_COLOR,
|
|
14868
15950
|
"line-width": 4
|
|
14869
15951
|
}
|
|
14870
15952
|
};
|
|
@@ -14883,7 +15965,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14883
15965
|
key: "onWebGLContextLost",
|
|
14884
15966
|
value: function onWebGLContextLost(e) {
|
|
14885
15967
|
var _this$map,
|
|
14886
|
-
|
|
15968
|
+
_this14 = this;
|
|
14887
15969
|
e.originalEvent.preventDefault();
|
|
14888
15970
|
console.warn("Contexto WebGL perdido 😢");
|
|
14889
15971
|
|
|
@@ -14894,8 +15976,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14894
15976
|
var _ext$restoreContext;
|
|
14895
15977
|
canvas.addEventListener("webglcontextrestored", function () {
|
|
14896
15978
|
console.debug("Contexto WebGL restaurado, forzando re-render");
|
|
14897
|
-
|
|
14898
|
-
|
|
15979
|
+
_this14.map.triggerRepaint(); // forzar repaint
|
|
15980
|
+
_this14.failedTiles.clear();
|
|
14899
15981
|
}, {
|
|
14900
15982
|
once: true
|
|
14901
15983
|
});
|
|
@@ -14935,7 +16017,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14935
16017
|
}, {
|
|
14936
16018
|
key: "subscribeToFailedTiles",
|
|
14937
16019
|
value: function subscribeToFailedTiles() {
|
|
14938
|
-
var
|
|
16020
|
+
var _this15 = this;
|
|
14939
16021
|
if (this.retryTimer) return;
|
|
14940
16022
|
|
|
14941
16023
|
// Store bound functions for proper cleanup
|
|
@@ -14944,20 +16026,20 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14944
16026
|
this.boundOnWebGLContextLost = this.onWebGLContextLost.bind(this);
|
|
14945
16027
|
this.boundOnWebGLContextRestored = this.onWebGLContextRestored.bind(this);
|
|
14946
16028
|
this.retryTimer = setInterval(function () {
|
|
14947
|
-
if (!
|
|
14948
|
-
|
|
16029
|
+
if (!_this15.map.getSource("indoorequal")) {
|
|
16030
|
+
_this15.failedTiles.clear();
|
|
14949
16031
|
return;
|
|
14950
16032
|
}
|
|
14951
|
-
var source =
|
|
16033
|
+
var source = _this15.map.getSource("indoorequal");
|
|
14952
16034
|
if (!source || source.type !== "vector") {
|
|
14953
|
-
|
|
16035
|
+
_this15.failedTiles.clear();
|
|
14954
16036
|
return;
|
|
14955
16037
|
}
|
|
14956
16038
|
|
|
14957
16039
|
// Process tiles and remove invalid ones
|
|
14958
16040
|
var tilesToRetry = [];
|
|
14959
16041
|
var tilesToRemove = [];
|
|
14960
|
-
|
|
16042
|
+
_this15.failedTiles.forEach(function (tile) {
|
|
14961
16043
|
// Check if tile is still valid before attempting reload
|
|
14962
16044
|
if (!tile || tile.state === "unloaded" || tile.state === "loading") {
|
|
14963
16045
|
tilesToRemove.push(tile);
|
|
@@ -14975,7 +16057,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14975
16057
|
|
|
14976
16058
|
// Remove invalid tiles from the set
|
|
14977
16059
|
tilesToRemove.forEach(function (tile) {
|
|
14978
|
-
return
|
|
16060
|
+
return _this15.failedTiles["delete"](tile);
|
|
14979
16061
|
});
|
|
14980
16062
|
|
|
14981
16063
|
// Attempt to reload valid failed tiles
|
|
@@ -14987,7 +16069,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14987
16069
|
}
|
|
14988
16070
|
} catch (error) {
|
|
14989
16071
|
// If reload fails, remove tile from retry queue - this is expected
|
|
14990
|
-
|
|
16072
|
+
_this15.failedTiles["delete"](tile);
|
|
14991
16073
|
}
|
|
14992
16074
|
});
|
|
14993
16075
|
}, 1000);
|
|
@@ -15136,6 +16218,7 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15136
16218
|
var _this;
|
|
15137
16219
|
sdk_classCallCheck(this, InternalMapVXSDK);
|
|
15138
16220
|
_this = sdk_callSuper(this, InternalMapVXSDK);
|
|
16221
|
+
sdk_defineProperty(_this, "maps", []);
|
|
15139
16222
|
sdk_defineProperty(_this, "geoLocation", navigator.geolocation);
|
|
15140
16223
|
sdk_defineProperty(_this, "headingListeners", []);
|
|
15141
16224
|
_this.token = token;
|
|
@@ -15169,6 +16252,17 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15169
16252
|
value: function setSdkLang(lang) {
|
|
15170
16253
|
this.config.lang = lang;
|
|
15171
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
|
+
}
|
|
15172
16266
|
}
|
|
15173
16267
|
}, {
|
|
15174
16268
|
key: "getPlaceDetail",
|
|
@@ -15242,11 +16336,21 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15242
16336
|
}, {
|
|
15243
16337
|
key: "createMap",
|
|
15244
16338
|
value: function createMap(container, mapConfig) {
|
|
16339
|
+
var _this2 = this;
|
|
15245
16340
|
try {
|
|
15246
16341
|
mapConfig.lang = this.config.lang;
|
|
15247
16342
|
mapConfig.apiUrl = this.config.apiUrl;
|
|
15248
16343
|
mapConfig.mapvxRequestContext = this.config.mapvxRequestContext;
|
|
15249
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);
|
|
15250
16354
|
this.logEvent("createMap");
|
|
15251
16355
|
return map;
|
|
15252
16356
|
} catch (error) {
|
|
@@ -15643,7 +16747,7 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15643
16747
|
return _searchPlacesByTags.apply(this, arguments);
|
|
15644
16748
|
}
|
|
15645
16749
|
return searchPlacesByTags;
|
|
15646
|
-
}()
|
|
16750
|
+
}()
|
|
15647
16751
|
}, {
|
|
15648
16752
|
key: "getPlacesByCategory",
|
|
15649
16753
|
value: function () {
|
|
@@ -15679,14 +16783,14 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15679
16783
|
}, {
|
|
15680
16784
|
key: "getUserLocation",
|
|
15681
16785
|
value: function getUserLocation() {
|
|
15682
|
-
var
|
|
16786
|
+
var _this3 = this;
|
|
15683
16787
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
15684
16788
|
enableHighAccuracy: true,
|
|
15685
16789
|
timeout: 60 * 1000,
|
|
15686
16790
|
maximumAge: 10 * 1000
|
|
15687
16791
|
};
|
|
15688
16792
|
return new Promise(function (resolve, reject) {
|
|
15689
|
-
|
|
16793
|
+
_this3.geoLocation.getCurrentPosition(function (position) {
|
|
15690
16794
|
resolve(position);
|
|
15691
16795
|
}, function (error) {
|
|
15692
16796
|
reject(error);
|
|
@@ -15890,13 +16994,29 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15890
16994
|
* @group Utils
|
|
15891
16995
|
*/
|
|
15892
16996
|
|
|
16997
|
+
/**
|
|
16998
|
+
* Represents a category containing a image url.
|
|
16999
|
+
* @group Utils
|
|
17000
|
+
*/
|
|
17001
|
+
|
|
15893
17002
|
/**
|
|
15894
17003
|
* Represents a category containing an icon.
|
|
15895
17004
|
* @group Utils
|
|
15896
17005
|
*/
|
|
15897
17006
|
|
|
15898
17007
|
/**
|
|
15899
|
-
*
|
|
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.
|
|
15900
17020
|
* @group Utils
|
|
15901
17021
|
*/
|
|
15902
17022
|
|
|
@@ -15950,132 +17070,36 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
15950
17070
|
*/
|
|
15951
17071
|
|
|
15952
17072
|
/**
|
|
15953
|
-
* Checks if the category
|
|
15954
|
-
*
|
|
15955
|
-
* @param category
|
|
15956
|
-
* @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}.
|
|
15957
17077
|
*/
|
|
15958
17078
|
function isBasicWithLogo(category) {
|
|
15959
|
-
|
|
17079
|
+
var input = category;
|
|
17080
|
+
return input.logo != null && input.logo !== "";
|
|
15960
17081
|
}
|
|
15961
17082
|
|
|
15962
17083
|
/**
|
|
15963
|
-
* Checks if the category
|
|
17084
|
+
* Checks if the category carries a Font Awesome icon.
|
|
15964
17085
|
* @group Utils
|
|
15965
|
-
* @param category
|
|
15966
|
-
* @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}.
|
|
15967
17088
|
*/
|
|
15968
17089
|
function isBasicWithIcon(category) {
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
;// ./src/utils/update-css.ts
|
|
15972
|
-
function update_css_slicedToArray(r, e) { return update_css_arrayWithHoles(r) || update_css_iterableToArrayLimit(r, e) || update_css_unsupportedIterableToArray(r, e) || update_css_nonIterableRest(); }
|
|
15973
|
-
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."); }
|
|
15974
|
-
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; } }
|
|
15975
|
-
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; }
|
|
15976
|
-
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; } }
|
|
15977
|
-
function update_css_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
15978
|
-
/**
|
|
15979
|
-
* Load a CSS customization of a project.
|
|
15980
|
-
*
|
|
15981
|
-
* This function create a new HTML Style Element and add it to the current document.
|
|
15982
|
-
* Also activate the customization adding the first theme name to the body of the document.
|
|
15983
|
-
*
|
|
15984
|
-
* @group Utils
|
|
15985
|
-
* @param data The CSS customization data.
|
|
15986
|
-
*/
|
|
15987
|
-
function loadCustomization(data) {
|
|
15988
|
-
var style = document.createElement("style");
|
|
15989
|
-
style.textContent = "";
|
|
15990
|
-
for (var _i = 0, _Object$entries = Object.entries(data); _i < _Object$entries.length; _i++) {
|
|
15991
|
-
var _Object$entries$_i = update_css_slicedToArray(_Object$entries[_i], 2),
|
|
15992
|
-
themeName = _Object$entries$_i[0],
|
|
15993
|
-
themeData = _Object$entries$_i[1];
|
|
15994
|
-
var cssClass = loadTheme(themeName, themeData);
|
|
15995
|
-
style.textContent += cssClass;
|
|
15996
|
-
}
|
|
15997
|
-
document.head.appendChild(style);
|
|
15998
|
-
var firstThemeName = Object.keys(data).at(0);
|
|
15999
|
-
if (firstThemeName != null) {
|
|
16000
|
-
document.body.classList.add(firstThemeName);
|
|
16001
|
-
}
|
|
17090
|
+
var input = category;
|
|
17091
|
+
return input.icon != null && input.icon !== "";
|
|
16002
17092
|
}
|
|
16003
17093
|
|
|
16004
17094
|
/**
|
|
16005
|
-
*
|
|
16006
|
-
*
|
|
16007
|
-
* @group Utils
|
|
16008
|
-
* @param themeName The name of the Theme.
|
|
16009
|
-
* @param themeData The data of the Theme.
|
|
16010
|
-
* @returns A string with the processed theme to use on a CSS file.
|
|
16011
|
-
*/
|
|
16012
|
-
function loadTheme(themeName, themeData) {
|
|
16013
|
-
var cssClass = ".".concat(themeName, " {\n");
|
|
16014
|
-
var definitions = themeData.definitions;
|
|
16015
|
-
if (definitions != null) {
|
|
16016
|
-
cssClass = loadDefinitions(definitions, cssClass);
|
|
16017
|
-
}
|
|
16018
|
-
for (var _i2 = 0, _Object$entries2 = Object.entries((_themeData$screens = themeData.screens) !== null && _themeData$screens !== void 0 ? _themeData$screens : {}); _i2 < _Object$entries2.length; _i2++) {
|
|
16019
|
-
var _themeData$screens;
|
|
16020
|
-
var _Object$entries2$_i = update_css_slicedToArray(_Object$entries2[_i2], 2),
|
|
16021
|
-
screenName = _Object$entries2$_i[0],
|
|
16022
|
-
screenData = _Object$entries2$_i[1];
|
|
16023
|
-
for (var _i3 = 0, _Object$entries3 = Object.entries(screenData); _i3 < _Object$entries3.length; _i3++) {
|
|
16024
|
-
var _Object$entries3$_i = update_css_slicedToArray(_Object$entries3[_i3], 2),
|
|
16025
|
-
componentName = _Object$entries3$_i[0],
|
|
16026
|
-
componentData = _Object$entries3$_i[1];
|
|
16027
|
-
for (var _i4 = 0, _Object$entries4 = Object.entries(componentData); _i4 < _Object$entries4.length; _i4++) {
|
|
16028
|
-
var _Object$entries4$_i = update_css_slicedToArray(_Object$entries4[_i4], 2),
|
|
16029
|
-
elementName = _Object$entries4$_i[0],
|
|
16030
|
-
elementData = _Object$entries4$_i[1];
|
|
16031
|
-
for (var _i5 = 0, _Object$entries5 = Object.entries(elementData); _i5 < _Object$entries5.length; _i5++) {
|
|
16032
|
-
var _Object$entries5$_i = update_css_slicedToArray(_Object$entries5[_i5], 2),
|
|
16033
|
-
propertyName = _Object$entries5$_i[0],
|
|
16034
|
-
propertyValue = _Object$entries5$_i[1];
|
|
16035
|
-
cssClass += " --".concat(screenName, "-").concat(componentName, "-").concat(elementName, "-").concat(propertyName, ": ").concat(propertyValue, ";\n");
|
|
16036
|
-
}
|
|
16037
|
-
}
|
|
16038
|
-
}
|
|
16039
|
-
}
|
|
16040
|
-
cssClass += "}\n";
|
|
16041
|
-
return cssClass;
|
|
16042
|
-
}
|
|
16043
|
-
/**
|
|
16044
|
-
* Process the definitions of a theme.
|
|
16045
|
-
*
|
|
17095
|
+
* Checks if the category carries an image URL.
|
|
16046
17096
|
* @group Utils
|
|
16047
|
-
* @param
|
|
16048
|
-
* @
|
|
16049
|
-
* @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}.
|
|
16050
17099
|
*/
|
|
16051
|
-
function
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
var _Object$entries6$_i = update_css_slicedToArray(_Object$entries6[_i6], 2),
|
|
16055
|
-
colorName = _Object$entries6$_i[0],
|
|
16056
|
-
colorData = _Object$entries6$_i[1];
|
|
16057
|
-
for (var _i7 = 0, _Object$entries7 = Object.entries(colorData); _i7 < _Object$entries7.length; _i7++) {
|
|
16058
|
-
var _Object$entries7$_i = update_css_slicedToArray(_Object$entries7[_i7], 2),
|
|
16059
|
-
colorIntensity = _Object$entries7$_i[0],
|
|
16060
|
-
colorValue = _Object$entries7$_i[1];
|
|
16061
|
-
cssClass += " --definitions-colors-".concat(colorName, "-").concat(colorIntensity, ": ").concat(colorValue, ";\n");
|
|
16062
|
-
}
|
|
16063
|
-
}
|
|
16064
|
-
for (var _i8 = 0, _Object$entries8 = Object.entries((_definitions$shadows = definitions.shadows) !== null && _definitions$shadows !== void 0 ? _definitions$shadows : {}); _i8 < _Object$entries8.length; _i8++) {
|
|
16065
|
-
var _definitions$shadows;
|
|
16066
|
-
var _Object$entries8$_i = update_css_slicedToArray(_Object$entries8[_i8], 2),
|
|
16067
|
-
shadowName = _Object$entries8$_i[0],
|
|
16068
|
-
shadowValue = _Object$entries8$_i[1];
|
|
16069
|
-
cssClass += " --definitions-shadows-".concat(shadowName, ": ").concat(shadowValue, ";\n");
|
|
16070
|
-
}
|
|
16071
|
-
for (var _i9 = 0, _Object$entries9 = Object.entries((_definitions$textFont = definitions.textFonts) !== null && _definitions$textFont !== void 0 ? _definitions$textFont : {}); _i9 < _Object$entries9.length; _i9++) {
|
|
16072
|
-
var _definitions$textFont;
|
|
16073
|
-
var _Object$entries9$_i = update_css_slicedToArray(_Object$entries9[_i9], 2),
|
|
16074
|
-
fontName = _Object$entries9$_i[0],
|
|
16075
|
-
fontValue = _Object$entries9$_i[1];
|
|
16076
|
-
cssClass += " --definitions-textFonts-".concat(fontName, ": ").concat(fontValue, ";\n");
|
|
16077
|
-
}
|
|
16078
|
-
return cssClass;
|
|
17100
|
+
function isBasicWithImageUrl(category) {
|
|
17101
|
+
var input = category;
|
|
17102
|
+
return input.imageUrl != null && input.imageUrl !== "";
|
|
16079
17103
|
}
|
|
16080
17104
|
;// ./src/utils/opening-hours-helper.ts
|
|
16081
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; } } }; }
|
|
@@ -17217,6 +18241,115 @@ function normalizeOrigin(raw) {
|
|
|
17217
18241
|
return null;
|
|
17218
18242
|
}
|
|
17219
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
|
+
}
|
|
17220
18353
|
;// ./src/index.ts
|
|
17221
18354
|
// ─── Domain Ports (interfaces) ───────────────────────────────────────────────
|
|
17222
18355
|
|
|
@@ -17248,6 +18381,8 @@ function normalizeOrigin(raw) {
|
|
|
17248
18381
|
|
|
17249
18382
|
// ─── Domain Models: Categories ───────────────────────────────────────────────
|
|
17250
18383
|
|
|
18384
|
+
// ─── Domain Models: Circle ───────────────────────────────────────────────────
|
|
18385
|
+
|
|
17251
18386
|
|
|
17252
18387
|
// ─── Domain Models: City Filter ──────────────────────────────────────────────
|
|
17253
18388
|
|