@mapvx/web-js 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/domain/models/circle.js +38 -3
- package/dist/cjs/domain/models/circle.js.map +1 -1
- package/dist/cjs/logger/logger.js +1 -1
- package/dist/cjs/logger/rollbar.js +1 -1
- package/dist/cjs/map/map.js +100 -29
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/es/domain/models/circle.d.ts +39 -0
- package/dist/es/domain/models/circle.d.ts.map +1 -1
- package/dist/es/domain/models/circle.js +36 -2
- package/dist/es/domain/models/circle.js.map +1 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/logger/logger.js +1 -1
- package/dist/es/logger/rollbar.js +1 -1
- package/dist/es/map/map.d.ts +24 -1
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +101 -30
- package/dist/es/map/map.js.map +1 -1
- package/dist/umd/index.js +203 -52
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
|
@@ -6794,7 +6794,7 @@ var rollbar_umd_min_default = /*#__PURE__*/__webpack_require__.n(rollbar_umd_min
|
|
|
6794
6794
|
// bundle. The tsc-built ES/CJS outputs keep it as a bare global, so the
|
|
6795
6795
|
// typeof guard makes the lookup safe everywhere; the version placeholder is
|
|
6796
6796
|
// replaced with the package version by scripts/inject-build-defines.js.
|
|
6797
|
-
var SDK_VERSION = true ? "1.2.
|
|
6797
|
+
var SDK_VERSION = true ? "1.2.1" : 0;
|
|
6798
6798
|
var _rollbarConfig = {
|
|
6799
6799
|
accessToken: "28279d52df43411ebd138c2bee0ab1df",
|
|
6800
6800
|
// Only report what the SDK logs explicitly via logError. Capturing every
|
|
@@ -6842,7 +6842,7 @@ var logger_countly = {
|
|
|
6842
6842
|
// The typeof guards make the lookup safe everywhere; the version placeholder
|
|
6843
6843
|
// is replaced with the package version by scripts/inject-build-defines.js.
|
|
6844
6844
|
var IS_DEBUG = true ? false : 0;
|
|
6845
|
-
var logger_SDK_VERSION = true ? "1.2.
|
|
6845
|
+
var logger_SDK_VERSION = true ? "1.2.1" : 0;
|
|
6846
6846
|
var Logger = /*#__PURE__*/function () {
|
|
6847
6847
|
function Logger() {
|
|
6848
6848
|
logger_classCallCheck(this, Logger);
|
|
@@ -9630,6 +9630,11 @@ var DEFAULT_TILE_CACHE_CONFIG = {
|
|
|
9630
9630
|
*/
|
|
9631
9631
|
;// ./src/domain/models/circle.ts
|
|
9632
9632
|
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); }
|
|
9633
|
+
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; }
|
|
9634
|
+
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; }
|
|
9635
|
+
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; }
|
|
9636
|
+
function circle_toPropertyKey(t) { var i = circle_toPrimitive(t, "string"); return "symbol" == circle_typeof(i) ? i : i + ""; }
|
|
9637
|
+
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); }
|
|
9633
9638
|
|
|
9634
9639
|
/**
|
|
9635
9640
|
* MapVX brand color used as the default for circle styling and other
|
|
@@ -9639,6 +9644,27 @@ function circle_typeof(o) { "@babel/helpers - typeof"; return circle_typeof = "f
|
|
|
9639
9644
|
*/
|
|
9640
9645
|
var MAPVX_BRAND_COLOR = "#276EF1";
|
|
9641
9646
|
|
|
9647
|
+
/**
|
|
9648
|
+
* Where a circle renders relative to the other map layers.
|
|
9649
|
+
*
|
|
9650
|
+
* - `"aboveBasemap"` (default): above every basemap geometry layer —
|
|
9651
|
+
* including indoor floor-plate and building polygons — but below the
|
|
9652
|
+
* labels that follow them. A circle is never occluded by basemap fills.
|
|
9653
|
+
* - `"belowLabels"`: below the first symbol (label) layer of the style.
|
|
9654
|
+
* On indoor styles, floor-plate polygons ordered after that layer will
|
|
9655
|
+
* paint over the circle.
|
|
9656
|
+
* - `"top"`: above everything, including labels and markers drawn in
|
|
9657
|
+
* style layers.
|
|
9658
|
+
*
|
|
9659
|
+
* @group Circles
|
|
9660
|
+
*/
|
|
9661
|
+
|
|
9662
|
+
/**
|
|
9663
|
+
* Valid values for {@link CircleRenderOrder}, in rendering order.
|
|
9664
|
+
* @internal
|
|
9665
|
+
*/
|
|
9666
|
+
var CIRCLE_RENDER_ORDERS = ["belowLabels", "aboveBasemap", "top"];
|
|
9667
|
+
|
|
9642
9668
|
/**
|
|
9643
9669
|
* Default styling values applied to a circle when the corresponding
|
|
9644
9670
|
* {@link CircleConfig} fields are omitted.
|
|
@@ -9650,7 +9676,8 @@ var CIRCLE_DEFAULTS = {
|
|
|
9650
9676
|
fillOpacity: 0.14,
|
|
9651
9677
|
strokeColor: MAPVX_BRAND_COLOR,
|
|
9652
9678
|
strokeWidth: 2,
|
|
9653
|
-
strokeOpacity: 0.65
|
|
9679
|
+
strokeOpacity: 0.65,
|
|
9680
|
+
renderOrder: "aboveBasemap"
|
|
9654
9681
|
};
|
|
9655
9682
|
|
|
9656
9683
|
/**
|
|
@@ -9679,6 +9706,22 @@ var CIRCLE_DEFAULTS = {
|
|
|
9679
9706
|
* restyles: a circle hidden via `hideCircle` stays hidden until `showCircle`.
|
|
9680
9707
|
*/
|
|
9681
9708
|
|
|
9709
|
+
/**
|
|
9710
|
+
* Returns a deep copy of a {@link CircleRecord}, including the nested
|
|
9711
|
+
* coordinate. Used by the map accessors so callers can't mutate internal
|
|
9712
|
+
* circle state by writing to a returned record.
|
|
9713
|
+
*
|
|
9714
|
+
* @param record The circle record to clone.
|
|
9715
|
+
* @returns An independent copy of the record.
|
|
9716
|
+
*
|
|
9717
|
+
* @group Circles
|
|
9718
|
+
*/
|
|
9719
|
+
function cloneCircleRecord(record) {
|
|
9720
|
+
return circle_objectSpread(circle_objectSpread({}, record), {}, {
|
|
9721
|
+
coordinate: circle_objectSpread({}, record.coordinate)
|
|
9722
|
+
});
|
|
9723
|
+
}
|
|
9724
|
+
|
|
9682
9725
|
/**
|
|
9683
9726
|
* Validates that a radius in meters is positive and finite.
|
|
9684
9727
|
* @param radius The radius value to validate.
|
|
@@ -9762,6 +9805,9 @@ function isValidCircleConfig(config) {
|
|
|
9762
9805
|
if (typeof c.strokeOpacity !== "number" || !Number.isFinite(c.strokeOpacity)) return false;
|
|
9763
9806
|
}
|
|
9764
9807
|
if (c.floorId !== undefined && typeof c.floorId !== "string") return false;
|
|
9808
|
+
if (c.renderOrder !== undefined && !CIRCLE_RENDER_ORDERS.includes(c.renderOrder)) {
|
|
9809
|
+
return false;
|
|
9810
|
+
}
|
|
9765
9811
|
return true;
|
|
9766
9812
|
}
|
|
9767
9813
|
|
|
@@ -9777,13 +9823,21 @@ function isValidCircleConfig(config) {
|
|
|
9777
9823
|
* @group Circles
|
|
9778
9824
|
*/
|
|
9779
9825
|
function resolveCircleConfig(config) {
|
|
9780
|
-
var _config$id, _config$fillColor, _config$strokeColor, _config$strokeWidth;
|
|
9826
|
+
var _config$id, _config$fillColor, _config$strokeColor, _config$strokeWidth, _config$renderOrder;
|
|
9781
9827
|
var hidden = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
9782
9828
|
validateRadiusMeters(config.radiusMeters);
|
|
9783
9829
|
validateCoordinate(config.coordinate);
|
|
9830
|
+
if (config.renderOrder !== undefined && !CIRCLE_RENDER_ORDERS.includes(config.renderOrder)) {
|
|
9831
|
+
throw new Error("Invalid renderOrder: ".concat(String(config.renderOrder), ". ") + "Must be one of: ".concat(CIRCLE_RENDER_ORDERS.join(", "), "."));
|
|
9832
|
+
}
|
|
9784
9833
|
return {
|
|
9785
9834
|
id: (_config$id = config.id) !== null && _config$id !== void 0 ? _config$id : generateHexadecimalKey(),
|
|
9786
|
-
coordinate
|
|
9835
|
+
// Copy the coordinate so later mutations of the caller's object
|
|
9836
|
+
// can't change internal circle state
|
|
9837
|
+
coordinate: {
|
|
9838
|
+
lat: config.coordinate.lat,
|
|
9839
|
+
lng: config.coordinate.lng
|
|
9840
|
+
},
|
|
9787
9841
|
radiusMeters: config.radiusMeters,
|
|
9788
9842
|
fillColor: (_config$fillColor = config.fillColor) !== null && _config$fillColor !== void 0 ? _config$fillColor : CIRCLE_DEFAULTS.fillColor,
|
|
9789
9843
|
fillOpacity: clampOpacity(config.fillOpacity, CIRCLE_DEFAULTS.fillOpacity),
|
|
@@ -9791,6 +9845,7 @@ function resolveCircleConfig(config) {
|
|
|
9791
9845
|
strokeWidth: (_config$strokeWidth = config.strokeWidth) !== null && _config$strokeWidth !== void 0 ? _config$strokeWidth : CIRCLE_DEFAULTS.strokeWidth,
|
|
9792
9846
|
strokeOpacity: clampOpacity(config.strokeOpacity, CIRCLE_DEFAULTS.strokeOpacity),
|
|
9793
9847
|
floorId: config.floorId,
|
|
9848
|
+
renderOrder: (_config$renderOrder = config.renderOrder) !== null && _config$renderOrder !== void 0 ? _config$renderOrder : CIRCLE_DEFAULTS.renderOrder,
|
|
9794
9849
|
hidden: hidden
|
|
9795
9850
|
};
|
|
9796
9851
|
}
|
|
@@ -13414,11 +13469,11 @@ function map_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-prese
|
|
|
13414
13469
|
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); }
|
|
13415
13470
|
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); }
|
|
13416
13471
|
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); }); }; }
|
|
13417
|
-
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; } } }; }
|
|
13418
13472
|
function map_slicedToArray(r, e) { return map_arrayWithHoles(r) || map_iterableToArrayLimit(r, e) || map_unsupportedIterableToArray(r, e) || map_nonIterableRest(); }
|
|
13419
13473
|
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."); }
|
|
13420
13474
|
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; } }
|
|
13421
13475
|
function map_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13476
|
+
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; } } }; }
|
|
13422
13477
|
function map_toConsumableArray(r) { return map_arrayWithoutHoles(r) || map_iterableToArray(r) || map_unsupportedIterableToArray(r) || map_nonIterableSpread(); }
|
|
13423
13478
|
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."); }
|
|
13424
13479
|
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; } }
|
|
@@ -13448,6 +13503,30 @@ var CIRCLE_FILL_LAYER_ID = "mapvx-circles-fill";
|
|
|
13448
13503
|
/** Line layer rendering the circle outlines. */
|
|
13449
13504
|
var CIRCLE_LINE_LAYER_ID = "mapvx-circles-line";
|
|
13450
13505
|
|
|
13506
|
+
/**
|
|
13507
|
+
* Layer-id suffix per circle render order. The default placement keeps the
|
|
13508
|
+
* unsuffixed ids so existing consumers referencing them keep working.
|
|
13509
|
+
*/
|
|
13510
|
+
var CIRCLE_LAYER_SUFFIXES = {
|
|
13511
|
+
aboveBasemap: "",
|
|
13512
|
+
belowLabels: "-below-labels",
|
|
13513
|
+
top: "-top"
|
|
13514
|
+
};
|
|
13515
|
+
|
|
13516
|
+
/** Fill/line layer ids for one circle render-order bucket. */
|
|
13517
|
+
function circleLayerIdsFor(order) {
|
|
13518
|
+
var suffix = CIRCLE_LAYER_SUFFIXES[order];
|
|
13519
|
+
return {
|
|
13520
|
+
fill: CIRCLE_FILL_LAYER_ID + suffix,
|
|
13521
|
+
line: CIRCLE_LINE_LAYER_ID + suffix
|
|
13522
|
+
};
|
|
13523
|
+
}
|
|
13524
|
+
|
|
13525
|
+
/** True for the layer ids owned by the circle API, regardless of bucket. */
|
|
13526
|
+
function isCircleLayerId(id) {
|
|
13527
|
+
return id.startsWith(CIRCLE_FILL_LAYER_ID) || id.startsWith(CIRCLE_LINE_LAYER_ID);
|
|
13528
|
+
}
|
|
13529
|
+
|
|
13451
13530
|
// Flag to track if cached-tile protocol has been registered
|
|
13452
13531
|
var cachedTileProtocolRegistered = false;
|
|
13453
13532
|
|
|
@@ -14168,14 +14247,15 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14168
14247
|
}, {
|
|
14169
14248
|
key: "getCircle",
|
|
14170
14249
|
value: function getCircle(circleId) {
|
|
14171
|
-
|
|
14250
|
+
var circle = this.circles.find(function (c) {
|
|
14172
14251
|
return c.id === circleId;
|
|
14173
14252
|
});
|
|
14253
|
+
return circle ? cloneCircleRecord(circle) : undefined;
|
|
14174
14254
|
}
|
|
14175
14255
|
}, {
|
|
14176
14256
|
key: "getCircles",
|
|
14177
14257
|
value: function getCircles() {
|
|
14178
|
-
return this.circles.
|
|
14258
|
+
return this.circles.map(cloneCircleRecord);
|
|
14179
14259
|
}
|
|
14180
14260
|
}, {
|
|
14181
14261
|
key: "hasCircle",
|
|
@@ -14210,7 +14290,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14210
14290
|
throw new Error("Invalid radiusMeters: ".concat(radiusMeters, ". Must be a positive finite number."));
|
|
14211
14291
|
}
|
|
14212
14292
|
}
|
|
14213
|
-
_circle.coordinate =
|
|
14293
|
+
_circle.coordinate = {
|
|
14294
|
+
lat: center.lat,
|
|
14295
|
+
lng: center.lng
|
|
14296
|
+
};
|
|
14214
14297
|
if (radiusMeters !== undefined) {
|
|
14215
14298
|
_circle.radiusMeters = radiusMeters;
|
|
14216
14299
|
}
|
|
@@ -14332,7 +14415,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14332
14415
|
fillOpacity: circle.fillOpacity,
|
|
14333
14416
|
strokeColor: circle.strokeColor,
|
|
14334
14417
|
strokeWidth: circle.strokeWidth,
|
|
14335
|
-
strokeOpacity: circle.strokeOpacity
|
|
14418
|
+
strokeOpacity: circle.strokeOpacity,
|
|
14419
|
+
renderOrder: circle.renderOrder
|
|
14336
14420
|
},
|
|
14337
14421
|
geometry: {
|
|
14338
14422
|
type: "Polygon",
|
|
@@ -14353,45 +14437,112 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14353
14437
|
* time: a style that is still loading simply rejects the calls, and the
|
|
14354
14438
|
* styledata listener retries once the style is ready.
|
|
14355
14439
|
*/
|
|
14440
|
+
/**
|
|
14441
|
+
* Resolves the layer id to insert circle layers before, for one render
|
|
14442
|
+
* order. `undefined` means "append on top".
|
|
14443
|
+
*
|
|
14444
|
+
* `aboveBasemap` finds the topmost non-symbol layer of the style and
|
|
14445
|
+
* inserts before the first symbol layer that follows it. On indoor styles
|
|
14446
|
+
* the floor-plate and building polygons are ordered after the first symbol
|
|
14447
|
+
* layer, so anchoring on the topmost geometry layer — instead of the first
|
|
14448
|
+
* symbol layer — guarantees circles are never occluded by basemap fills
|
|
14449
|
+
* while still rendering below the labels that follow them.
|
|
14450
|
+
*/
|
|
14451
|
+
}, {
|
|
14452
|
+
key: "circleBeforeIdFor",
|
|
14453
|
+
value: function circleBeforeIdFor(order) {
|
|
14454
|
+
var _this$map$getStyle$la2, _this$map$getStyle2, _layers$slice$find;
|
|
14455
|
+
if (order === "top") return undefined;
|
|
14456
|
+
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) {
|
|
14457
|
+
return !isCircleLayerId(layer.id);
|
|
14458
|
+
});
|
|
14459
|
+
if (order === "belowLabels") {
|
|
14460
|
+
var _layers$find;
|
|
14461
|
+
return (_layers$find = layers.find(function (layer) {
|
|
14462
|
+
return layer.type === "symbol";
|
|
14463
|
+
})) === null || _layers$find === void 0 ? void 0 : _layers$find.id;
|
|
14464
|
+
}
|
|
14465
|
+
|
|
14466
|
+
// aboveBasemap
|
|
14467
|
+
var lastNonSymbolIndex = -1;
|
|
14468
|
+
layers.forEach(function (layer, index) {
|
|
14469
|
+
if (layer.type !== "symbol") lastNonSymbolIndex = index;
|
|
14470
|
+
});
|
|
14471
|
+
return (_layers$slice$find = layers.slice(lastNonSymbolIndex + 1).find(function (layer) {
|
|
14472
|
+
return layer.type === "symbol";
|
|
14473
|
+
})) === null || _layers$slice$find === void 0 ? void 0 : _layers$slice$find.id;
|
|
14474
|
+
}
|
|
14475
|
+
|
|
14476
|
+
/**
|
|
14477
|
+
* Idempotently ensures the shared circle source and one fill/line layer
|
|
14478
|
+
* pair per render order in use, at the placement that order requires.
|
|
14479
|
+
* Placement is recomputed and re-asserted (via moveLayer) on every call,
|
|
14480
|
+
* so circles regain their correct z-order after any style reload or
|
|
14481
|
+
* floor/parent-place change. Safe to call at any time: a style that is
|
|
14482
|
+
* still loading simply rejects the calls, and the styledata listener
|
|
14483
|
+
* retries once the style is ready.
|
|
14484
|
+
*/
|
|
14356
14485
|
}, {
|
|
14357
14486
|
key: "ensureCircleLayers",
|
|
14358
14487
|
value: function ensureCircleLayers() {
|
|
14359
14488
|
if (!this.map) return;
|
|
14360
14489
|
try {
|
|
14361
|
-
var _this$map$getStyle2;
|
|
14362
14490
|
if (!this.map.getSource(CIRCLE_SOURCE_ID)) {
|
|
14363
14491
|
this.map.addSource(CIRCLE_SOURCE_ID, {
|
|
14364
14492
|
type: "geojson",
|
|
14365
14493
|
data: this.circleFeatureCollection()
|
|
14366
14494
|
});
|
|
14367
14495
|
}
|
|
14368
|
-
var
|
|
14369
|
-
return
|
|
14370
|
-
}))
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
|
|
14386
|
-
|
|
14387
|
-
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14496
|
+
var ordersInUse = new Set(this.circles.map(function (c) {
|
|
14497
|
+
return c.renderOrder;
|
|
14498
|
+
}));
|
|
14499
|
+
// Always keep the default bucket alive so an empty map still renders
|
|
14500
|
+
// newly added circles without a layer rebuild
|
|
14501
|
+
ordersInUse.add("aboveBasemap");
|
|
14502
|
+
var _iterator = map_createForOfIteratorHelper(ordersInUse),
|
|
14503
|
+
_step;
|
|
14504
|
+
try {
|
|
14505
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
14506
|
+
var order = _step.value;
|
|
14507
|
+
var ids = circleLayerIdsFor(order);
|
|
14508
|
+
var beforeId = this.circleBeforeIdFor(order);
|
|
14509
|
+
var orderFilter = ["==", ["get", "renderOrder"], order];
|
|
14510
|
+
if (!this.map.getLayer(ids.fill)) {
|
|
14511
|
+
var fillLayer = {
|
|
14512
|
+
id: ids.fill,
|
|
14513
|
+
type: "fill",
|
|
14514
|
+
source: CIRCLE_SOURCE_ID,
|
|
14515
|
+
filter: orderFilter,
|
|
14516
|
+
paint: {
|
|
14517
|
+
"fill-color": ["get", "fillColor"],
|
|
14518
|
+
"fill-opacity": ["get", "fillOpacity"]
|
|
14519
|
+
}
|
|
14520
|
+
};
|
|
14521
|
+
this.map.addLayer(fillLayer, beforeId);
|
|
14522
|
+
} else {
|
|
14523
|
+
this.map.moveLayer(ids.fill, beforeId);
|
|
14524
|
+
}
|
|
14525
|
+
if (!this.map.getLayer(ids.line)) {
|
|
14526
|
+
var lineLayer = {
|
|
14527
|
+
id: ids.line,
|
|
14528
|
+
type: "line",
|
|
14529
|
+
source: CIRCLE_SOURCE_ID,
|
|
14530
|
+
filter: orderFilter,
|
|
14531
|
+
paint: {
|
|
14532
|
+
"line-color": ["get", "strokeColor"],
|
|
14533
|
+
"line-width": ["get", "strokeWidth"],
|
|
14534
|
+
"line-opacity": ["get", "strokeOpacity"]
|
|
14535
|
+
}
|
|
14536
|
+
};
|
|
14537
|
+
this.map.addLayer(lineLayer, beforeId);
|
|
14538
|
+
} else {
|
|
14539
|
+
this.map.moveLayer(ids.line, beforeId);
|
|
14392
14540
|
}
|
|
14393
|
-
}
|
|
14394
|
-
|
|
14541
|
+
}
|
|
14542
|
+
} catch (err) {
|
|
14543
|
+
_iterator.e(err);
|
|
14544
|
+
} finally {
|
|
14545
|
+
_iterator.f();
|
|
14395
14546
|
}
|
|
14396
14547
|
} catch (error) {
|
|
14397
14548
|
// Style may not be loaded yet; the styledata listener re-adds the layers
|
|
@@ -14460,12 +14611,12 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14460
14611
|
}, {
|
|
14461
14612
|
key: "updateFiltersTo",
|
|
14462
14613
|
value: function updateFiltersTo(floorId) {
|
|
14463
|
-
var _this$map$getStyle$
|
|
14614
|
+
var _this$map$getStyle$la3,
|
|
14464
14615
|
_this$map$getStyle3,
|
|
14465
14616
|
_this10 = this,
|
|
14466
14617
|
_this$innerFloors$fin0;
|
|
14467
14618
|
if (!this.map) return;
|
|
14468
|
-
var layers = (_this$map$getStyle$
|
|
14619
|
+
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 : [];
|
|
14469
14620
|
layers.filter(function (l) {
|
|
14470
14621
|
return l.id.startsWith("base-indoor-");
|
|
14471
14622
|
}).forEach(function (l) {
|
|
@@ -14592,11 +14743,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14592
14743
|
var minLng;
|
|
14593
14744
|
var maxLat;
|
|
14594
14745
|
var maxLng;
|
|
14595
|
-
var
|
|
14596
|
-
|
|
14746
|
+
var _iterator2 = map_createForOfIteratorHelper(coordinates),
|
|
14747
|
+
_step2;
|
|
14597
14748
|
try {
|
|
14598
|
-
for (
|
|
14599
|
-
var _coord =
|
|
14749
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
14750
|
+
var _coord = _step2.value;
|
|
14600
14751
|
var lat = _coord.lat,
|
|
14601
14752
|
lng = _coord.lng;
|
|
14602
14753
|
minLat = minLat === undefined ? lat : Math.min(minLat, lat);
|
|
@@ -14605,9 +14756,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14605
14756
|
maxLng = maxLng === undefined ? lng : Math.max(maxLng, lng);
|
|
14606
14757
|
}
|
|
14607
14758
|
} catch (err) {
|
|
14608
|
-
|
|
14759
|
+
_iterator2.e(err);
|
|
14609
14760
|
} finally {
|
|
14610
|
-
|
|
14761
|
+
_iterator2.f();
|
|
14611
14762
|
}
|
|
14612
14763
|
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];
|
|
14613
14764
|
|
|
@@ -14812,7 +14963,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14812
14963
|
var _this11 = this;
|
|
14813
14964
|
this.map.on("click", /*#__PURE__*/function () {
|
|
14814
14965
|
var _ref4 = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee2(e) {
|
|
14815
|
-
var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace,
|
|
14966
|
+
var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator3, _step3, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId, _t2;
|
|
14816
14967
|
return map_regenerator().w(function (_context2) {
|
|
14817
14968
|
while (1) switch (_context2.p = _context2.n) {
|
|
14818
14969
|
case 0:
|
|
@@ -14837,15 +14988,15 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14837
14988
|
_context2.n = 7;
|
|
14838
14989
|
break;
|
|
14839
14990
|
}
|
|
14840
|
-
|
|
14991
|
+
_iterator3 = map_createForOfIteratorHelper(_this11.potentialParentPlaces);
|
|
14841
14992
|
_context2.p = 1;
|
|
14842
|
-
|
|
14993
|
+
_iterator3.s();
|
|
14843
14994
|
case 2:
|
|
14844
|
-
if ((
|
|
14995
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
14845
14996
|
_context2.n = 4;
|
|
14846
14997
|
break;
|
|
14847
14998
|
}
|
|
14848
|
-
potentialParentPlace =
|
|
14999
|
+
potentialParentPlace = _step3.value;
|
|
14849
15000
|
cachedSubPlaces = _this11.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
|
|
14850
15001
|
if (!cachedSubPlaces) {
|
|
14851
15002
|
_context2.n = 3;
|
|
@@ -14868,10 +15019,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14868
15019
|
case 5:
|
|
14869
15020
|
_context2.p = 5;
|
|
14870
15021
|
_t2 = _context2.v;
|
|
14871
|
-
|
|
15022
|
+
_iterator3.e(_t2);
|
|
14872
15023
|
case 6:
|
|
14873
15024
|
_context2.p = 6;
|
|
14874
|
-
|
|
15025
|
+
_iterator3.f();
|
|
14875
15026
|
return _context2.f(6);
|
|
14876
15027
|
case 7:
|
|
14877
15028
|
if (!(clickedPlace === undefined)) {
|