@mapvx/web-js 2.0.2 → 2.1.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/controllers/routeController.js +25 -0
- package/dist/cjs/controllers/routeController.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger/sentry.js +1 -1
- package/dist/cjs/map/map.js +15 -0
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/map/scene3DController.js +93 -8
- package/dist/cjs/map/scene3DController.js.map +1 -1
- package/dist/cjs/utils/3d.js +34 -0
- package/dist/cjs/utils/3d.js.map +1 -1
- package/dist/es/controllers/routeController.d.ts +8 -0
- package/dist/es/controllers/routeController.d.ts.map +1 -1
- package/dist/es/controllers/routeController.js +25 -0
- package/dist/es/controllers/routeController.js.map +1 -1
- package/dist/es/domain/models/scene3D.d.ts +34 -0
- package/dist/es/domain/models/scene3D.d.ts.map +1 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/logger/sentry.js +1 -1
- package/dist/es/map/map.d.ts +13 -0
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +15 -0
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/map/scene3DController.d.ts +31 -4
- package/dist/es/map/scene3DController.d.ts.map +1 -1
- package/dist/es/map/scene3DController.js +94 -9
- package/dist/es/map/scene3DController.js.map +1 -1
- package/dist/es/utils/3d.d.ts +32 -1
- package/dist/es/utils/3d.d.ts.map +1 -1
- package/dist/es/utils/3d.js +31 -0
- package/dist/es/utils/3d.js.map +1 -1
- package/dist/umd/index.js +290 -66
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
|
@@ -11242,7 +11242,7 @@ const extractSafariExtensionDetails = (func, filename) => {
|
|
|
11242
11242
|
// replaced with the package version by scripts/inject-build-defines.js. The DSN
|
|
11243
11243
|
// falls back to the public MapVX Sentry project DSN when none is injected at
|
|
11244
11244
|
// build time — a DSN's public key is safe to ship in the client bundle.
|
|
11245
|
-
var sentry_SDK_VERSION = true ? "2.0.
|
|
11245
|
+
var sentry_SDK_VERSION = true ? "2.1.0-dev.1" : 0;
|
|
11246
11246
|
var DSN = false ? 0 : "https://872f598f020e3cd73a0933b562d24c81@sentry.mapvx.app/5";
|
|
11247
11247
|
|
|
11248
11248
|
/**
|
|
@@ -12764,6 +12764,60 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
12764
12764
|
} finally {
|
|
12765
12765
|
_iterator.f();
|
|
12766
12766
|
}
|
|
12767
|
+
this.syncRouteCollision();
|
|
12768
|
+
}
|
|
12769
|
+
|
|
12770
|
+
/**
|
|
12771
|
+
* Recompute the GLB route-transparency collision path from all active routes and push it to the
|
|
12772
|
+
* map. Every polyline point of every step is tagged with the floor its segment is drawn on (same
|
|
12773
|
+
* derivation as the route line's `floor_key`), so a 3D building only fades when a route is visibly
|
|
12774
|
+
* crossing it on the displayed floor. The map ignores this unless the 3D scene is active, so it is
|
|
12775
|
+
* safe to call unconditionally.
|
|
12776
|
+
*/
|
|
12777
|
+
}, {
|
|
12778
|
+
key: "syncRouteCollision",
|
|
12779
|
+
value: function syncRouteCollision() {
|
|
12780
|
+
var points = [];
|
|
12781
|
+
var _iterator2 = routeController_createForOfIteratorHelper(this.routes.values()),
|
|
12782
|
+
_step2;
|
|
12783
|
+
try {
|
|
12784
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
12785
|
+
var instance = _step2.value;
|
|
12786
|
+
var _iterator3 = routeController_createForOfIteratorHelper(instance.route.steps),
|
|
12787
|
+
_step3;
|
|
12788
|
+
try {
|
|
12789
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
12790
|
+
var step = _step3.value;
|
|
12791
|
+
var floorKey = this.getFloorKeyForStep(step);
|
|
12792
|
+
var _iterator4 = routeController_createForOfIteratorHelper(step.coordinates),
|
|
12793
|
+
_step4;
|
|
12794
|
+
try {
|
|
12795
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
12796
|
+
var coord = _step4.value;
|
|
12797
|
+
points.push({
|
|
12798
|
+
lng: coord.lng,
|
|
12799
|
+
lat: coord.lat,
|
|
12800
|
+
floorKey: floorKey
|
|
12801
|
+
});
|
|
12802
|
+
}
|
|
12803
|
+
} catch (err) {
|
|
12804
|
+
_iterator4.e(err);
|
|
12805
|
+
} finally {
|
|
12806
|
+
_iterator4.f();
|
|
12807
|
+
}
|
|
12808
|
+
}
|
|
12809
|
+
} catch (err) {
|
|
12810
|
+
_iterator3.e(err);
|
|
12811
|
+
} finally {
|
|
12812
|
+
_iterator3.f();
|
|
12813
|
+
}
|
|
12814
|
+
}
|
|
12815
|
+
} catch (err) {
|
|
12816
|
+
_iterator2.e(err);
|
|
12817
|
+
} finally {
|
|
12818
|
+
_iterator2.f();
|
|
12819
|
+
}
|
|
12820
|
+
this.mapvxMap.setRouteCollisionPath(points);
|
|
12767
12821
|
}
|
|
12768
12822
|
|
|
12769
12823
|
/**
|
|
@@ -12781,6 +12835,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
12781
12835
|
this.setSourceData(instance, instance.aheadId, route.steps);
|
|
12782
12836
|
this.setLayerPaint(instance.aheadId, drawConfig);
|
|
12783
12837
|
this.updateLayerFilter(instance.aheadId);
|
|
12838
|
+
this.syncRouteCollision();
|
|
12784
12839
|
}
|
|
12785
12840
|
|
|
12786
12841
|
/**
|
|
@@ -13091,19 +13146,19 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
13091
13146
|
}, {
|
|
13092
13147
|
key: "updateRouteLayers",
|
|
13093
13148
|
value: function updateRouteLayers(floorId) {
|
|
13094
|
-
var
|
|
13095
|
-
|
|
13149
|
+
var _iterator5 = routeController_createForOfIteratorHelper(this.routes.values()),
|
|
13150
|
+
_step5;
|
|
13096
13151
|
try {
|
|
13097
|
-
for (
|
|
13098
|
-
var instance =
|
|
13152
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
13153
|
+
var instance = _step5.value;
|
|
13099
13154
|
this.updateLayerFilter(instance.aheadId, floorId);
|
|
13100
13155
|
this.updateLayerFilter(instance.behindId, floorId);
|
|
13101
13156
|
this.updateLayerFilter(instance.currentId, floorId);
|
|
13102
13157
|
}
|
|
13103
13158
|
} catch (err) {
|
|
13104
|
-
|
|
13159
|
+
_iterator5.e(err);
|
|
13105
13160
|
} finally {
|
|
13106
|
-
|
|
13161
|
+
_iterator5.f();
|
|
13107
13162
|
}
|
|
13108
13163
|
}
|
|
13109
13164
|
|
|
@@ -13114,18 +13169,18 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
13114
13169
|
}, {
|
|
13115
13170
|
key: "updateRouteMarkerVisibility",
|
|
13116
13171
|
value: function updateRouteMarkerVisibility(floorId) {
|
|
13117
|
-
var
|
|
13118
|
-
|
|
13172
|
+
var _iterator6 = routeController_createForOfIteratorHelper(this.routes.values()),
|
|
13173
|
+
_step6;
|
|
13119
13174
|
try {
|
|
13120
|
-
for (
|
|
13175
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
13121
13176
|
var _instance$routeMarker, _instance$routeMarker2, _instance$routeMarker3;
|
|
13122
|
-
var instance =
|
|
13177
|
+
var instance = _step6.value;
|
|
13123
13178
|
((_instance$routeMarker = instance.routeMarker) === null || _instance$routeMarker === void 0 ? void 0 : _instance$routeMarker.floorId) === floorId ? (_instance$routeMarker2 = instance.routeMarker) === null || _instance$routeMarker2 === void 0 ? void 0 : _instance$routeMarker2.show(this.map) : (_instance$routeMarker3 = instance.routeMarker) === null || _instance$routeMarker3 === void 0 ? void 0 : _instance$routeMarker3.hide();
|
|
13124
13179
|
}
|
|
13125
13180
|
} catch (err) {
|
|
13126
|
-
|
|
13181
|
+
_iterator6.e(err);
|
|
13127
13182
|
} finally {
|
|
13128
|
-
|
|
13183
|
+
_iterator6.f();
|
|
13129
13184
|
}
|
|
13130
13185
|
}
|
|
13131
13186
|
}, {
|
|
@@ -13209,6 +13264,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
13209
13264
|
return _this2.prepareForNextStep(time, instance);
|
|
13210
13265
|
}
|
|
13211
13266
|
};
|
|
13267
|
+
this.syncRouteCollision();
|
|
13212
13268
|
}
|
|
13213
13269
|
}, {
|
|
13214
13270
|
key: "clearRouteInstance",
|
|
@@ -13247,6 +13303,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
13247
13303
|
var remaining = _toConsumableArray(this.routes.keys());
|
|
13248
13304
|
this.lastAddedRouteId = remaining.length > 0 ? remaining[remaining.length - 1] : undefined;
|
|
13249
13305
|
}
|
|
13306
|
+
this.syncRouteCollision();
|
|
13250
13307
|
}
|
|
13251
13308
|
|
|
13252
13309
|
/**
|
|
@@ -13255,21 +13312,22 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
13255
13312
|
}, {
|
|
13256
13313
|
key: "removeAllRoutes",
|
|
13257
13314
|
value: function removeAllRoutes() {
|
|
13258
|
-
var
|
|
13259
|
-
|
|
13315
|
+
var _iterator7 = routeController_createForOfIteratorHelper(this.routes.values()),
|
|
13316
|
+
_step7;
|
|
13260
13317
|
try {
|
|
13261
|
-
for (
|
|
13262
|
-
var instance =
|
|
13318
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
13319
|
+
var instance = _step7.value;
|
|
13263
13320
|
this.clearRouteInstance(instance);
|
|
13264
13321
|
this.removeSourcesAndLayersForRoute(instance);
|
|
13265
13322
|
}
|
|
13266
13323
|
} catch (err) {
|
|
13267
|
-
|
|
13324
|
+
_iterator7.e(err);
|
|
13268
13325
|
} finally {
|
|
13269
|
-
|
|
13326
|
+
_iterator7.f();
|
|
13270
13327
|
}
|
|
13271
13328
|
this.routes.clear();
|
|
13272
13329
|
this.lastAddedRouteId = undefined;
|
|
13330
|
+
this.syncRouteCollision();
|
|
13273
13331
|
}
|
|
13274
13332
|
|
|
13275
13333
|
/**
|
|
@@ -13518,6 +13576,7 @@ var RouteController = /*#__PURE__*/function () {
|
|
|
13518
13576
|
instance.stepAnimationStatus = "WAITING";
|
|
13519
13577
|
}
|
|
13520
13578
|
};
|
|
13579
|
+
this.syncRouteCollision();
|
|
13521
13580
|
}
|
|
13522
13581
|
|
|
13523
13582
|
/**
|
|
@@ -17944,6 +18003,44 @@ function opacityForZoom(cfg, zoom) {
|
|
|
17944
18003
|
return zoom >= cfg.zoom ? cfg.opacity : 1;
|
|
17945
18004
|
}
|
|
17946
18005
|
|
|
18006
|
+
/**
|
|
18007
|
+
* Resolves the effective route-based transparency for a placement, applying precedence:
|
|
18008
|
+
* placement > asset > global. Returns `undefined` when none is configured, which disables
|
|
18009
|
+
* route transparency for that model (a route crossing it leaves its opacity unchanged).
|
|
18010
|
+
*/
|
|
18011
|
+
function resolveRouteTransparency(models, asset, placement) {
|
|
18012
|
+
var _ref2, _placement$routeTrans;
|
|
18013
|
+
return (_ref2 = (_placement$routeTrans = placement.routeTransparency) !== null && _placement$routeTrans !== void 0 ? _placement$routeTrans : asset === null || asset === void 0 ? void 0 : asset.routeTransparency) !== null && _ref2 !== void 0 ? _ref2 : models.routeTransparency;
|
|
18014
|
+
}
|
|
18015
|
+
|
|
18016
|
+
/**
|
|
18017
|
+
* Axis-aligned footprint of a model in its own local x/z plane (metres), used for cheap
|
|
18018
|
+
* point-in-building collision tests. Height (y) is ignored: a route point on the floor should
|
|
18019
|
+
* match regardless of the model's vertical extent.
|
|
18020
|
+
* @internal
|
|
18021
|
+
*/
|
|
18022
|
+
|
|
18023
|
+
/**
|
|
18024
|
+
* Whether a point already expressed in the model's local space falls within its x/z footprint.
|
|
18025
|
+
* @internal
|
|
18026
|
+
*/
|
|
18027
|
+
function pointInFootprint(footprint, localX, localZ) {
|
|
18028
|
+
return localX >= footprint.minX && localX <= footprint.maxX && localZ >= footprint.minZ && localZ <= footprint.maxZ;
|
|
18029
|
+
}
|
|
18030
|
+
|
|
18031
|
+
/**
|
|
18032
|
+
* Effective opacity for a placed model: the more transparent of its zoom-based value and, when a
|
|
18033
|
+
* route currently crosses it, its route-based value. Route transparency only participates when a
|
|
18034
|
+
* {@link RouteTransparencyConfig} is configured (`routeCfg` present) and the model is currently
|
|
18035
|
+
* crossed by a route (`routeAffected`).
|
|
18036
|
+
* @internal
|
|
18037
|
+
*/
|
|
18038
|
+
function effectiveModelOpacity(zoomCfg, routeCfg, zoom, routeAffected) {
|
|
18039
|
+
var zoomOpacity = opacityForZoom(zoomCfg, zoom);
|
|
18040
|
+
var routeOpacity = routeAffected && routeCfg ? routeCfg.opacity : 1;
|
|
18041
|
+
return Math.min(zoomOpacity, routeOpacity);
|
|
18042
|
+
}
|
|
18043
|
+
|
|
17947
18044
|
/**
|
|
17948
18045
|
* Whether a GLB placement should be visible for the given floor key.
|
|
17949
18046
|
*/
|
|
@@ -18415,6 +18512,13 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
18415
18512
|
scene3DController_defineProperty(this, "scene3DGlbLightCount", 0);
|
|
18416
18513
|
/** Container group holding all placed GLB pivots; rebuilt on each floor change. */
|
|
18417
18514
|
scene3DController_defineProperty(this, "scene3DModelsGroup", undefined);
|
|
18515
|
+
/**
|
|
18516
|
+
* Route points currently used for GLB route-transparency collision, tagged with the floor on
|
|
18517
|
+
* which each point's route segment is visible. Stored as coordinates (not pivot references) so
|
|
18518
|
+
* they survive `placeScene3DModels` rebuilds on floor change. Only points matching the current
|
|
18519
|
+
* floor participate, so a model only fades when a route is visibly crossing it on that floor.
|
|
18520
|
+
*/
|
|
18521
|
+
scene3DController_defineProperty(this, "scene3DRouteCollisionPoints", []);
|
|
18418
18522
|
scene3DController_defineProperty(this, "spriteIconMapping", {});
|
|
18419
18523
|
scene3DController_defineProperty(this, "spriteAtlasImage", new Image());
|
|
18420
18524
|
this.map = map;
|
|
@@ -18497,7 +18601,21 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
18497
18601
|
}, {
|
|
18498
18602
|
key: "onZoom",
|
|
18499
18603
|
value: function onZoom() {
|
|
18500
|
-
this.
|
|
18604
|
+
this.applyModelOpacity();
|
|
18605
|
+
}
|
|
18606
|
+
|
|
18607
|
+
/**
|
|
18608
|
+
* Sets the route path used for GLB route-transparency collision and re-evaluates which models a
|
|
18609
|
+
* route currently crosses. Points are tagged with the floor on which their route segment is
|
|
18610
|
+
* visible; only points on the current floor participate, so a model never fades unless a route is
|
|
18611
|
+
* visibly crossing it on the displayed floor. Pass an empty array to clear.
|
|
18612
|
+
*/
|
|
18613
|
+
}, {
|
|
18614
|
+
key: "setRouteCollisionPath",
|
|
18615
|
+
value: function setRouteCollisionPath(points) {
|
|
18616
|
+
this.scene3DRouteCollisionPoints = points;
|
|
18617
|
+
this.recomputeRouteAffectedModels();
|
|
18618
|
+
this.applyModelOpacity();
|
|
18501
18619
|
}
|
|
18502
18620
|
|
|
18503
18621
|
/** Rebuilds the deck overlay and GLB placements for the given floor. */
|
|
@@ -18788,6 +18906,22 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
18788
18906
|
|
|
18789
18907
|
// Stash the resolved zoom-transparency config so it can be re-applied on every zoom change.
|
|
18790
18908
|
pivot.userData.zoomTransparency = resolveZoomTransparency(models, asset, placement);
|
|
18909
|
+
|
|
18910
|
+
// Stash route-transparency config (may be undefined => feature off for this model) so a
|
|
18911
|
+
// route crossing this model can fade it independently of zoom.
|
|
18912
|
+
pivot.userData.routeTransparency = resolveRouteTransparency(models, asset, placement);
|
|
18913
|
+
|
|
18914
|
+
// Precompute the model footprint in the pivot's local x/z frame while `model` has no parent
|
|
18915
|
+
// (its world matrix equals its local matrix), for cheap point-in-building collision tests.
|
|
18916
|
+
// After `pivot.add(model)` the world matrix would fold in the pivot transform, giving a loose
|
|
18917
|
+
// world-axis box instead; `pivot.worldToLocal` at test time undoes the pivot transform.
|
|
18918
|
+
var localBox = new three.Box3().setFromObject(model);
|
|
18919
|
+
pivot.userData.footprint = {
|
|
18920
|
+
minX: localBox.min.x,
|
|
18921
|
+
maxX: localBox.max.x,
|
|
18922
|
+
minZ: localBox.min.z,
|
|
18923
|
+
maxZ: localBox.max.z
|
|
18924
|
+
};
|
|
18791
18925
|
pivot.add(model);
|
|
18792
18926
|
modelsGroup.add(pivot);
|
|
18793
18927
|
},
|
|
@@ -18803,42 +18937,114 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
18803
18937
|
}
|
|
18804
18938
|
this.scene3DModelsGroup = modelsGroup;
|
|
18805
18939
|
this.scene3DGlbScene.add(modelsGroup);
|
|
18806
|
-
|
|
18940
|
+
// Recompute route collision against the freshly rebuilt pivots (footprints/floor changed),
|
|
18941
|
+
// then apply the combined opacity.
|
|
18942
|
+
this.recomputeRouteAffectedModels();
|
|
18943
|
+
this.applyModelOpacity();
|
|
18807
18944
|
this.map.triggerRepaint();
|
|
18808
18945
|
}
|
|
18809
18946
|
|
|
18810
18947
|
/**
|
|
18811
|
-
*
|
|
18812
|
-
*
|
|
18813
|
-
*
|
|
18948
|
+
* Recomputes `pivot.userData.routeAffected` for every placed model by testing the current-floor
|
|
18949
|
+
* route collision points against each model's precomputed footprint. Cheap point-in-box tests in
|
|
18950
|
+
* the pivot's local x/z frame; runs only when the route path or the placed models change, never
|
|
18951
|
+
* per zoom frame.
|
|
18952
|
+
*/
|
|
18953
|
+
}, {
|
|
18954
|
+
key: "recomputeRouteAffectedModels",
|
|
18955
|
+
value: function recomputeRouteAffectedModels() {
|
|
18956
|
+
var _this$threeMod4,
|
|
18957
|
+
_this3 = this;
|
|
18958
|
+
var three = (_this$threeMod4 = this.threeMod) === null || _this$threeMod4 === void 0 ? void 0 : _this$threeMod4.THREE;
|
|
18959
|
+
var modelsGroup = this.scene3DModelsGroup;
|
|
18960
|
+
if (!three || !modelsGroup) {
|
|
18961
|
+
return;
|
|
18962
|
+
}
|
|
18963
|
+
var points = this.scene3DRouteCollisionPoints.filter(function (p) {
|
|
18964
|
+
return p.floorKey === _this3.currentFloor;
|
|
18965
|
+
});
|
|
18966
|
+
|
|
18967
|
+
// Convert each route point into the models group's local frame (metres relative to
|
|
18968
|
+
// initialCenter), exactly as placements are positioned in `placeScene3DModels`. The group's
|
|
18969
|
+
// own transform (globalOffset) is applied via `localToWorld` at test time, so route points and
|
|
18970
|
+
// model pivots share one frame regardless of the collective offset.
|
|
18971
|
+
var refMercator = maplibre_gl.MercatorCoordinate.fromLngLat(this.initialCenter, 0);
|
|
18972
|
+
var meterScale = refMercator.meterInMercatorCoordinateUnits();
|
|
18973
|
+
var groupLocalPoints = points.map(function (p) {
|
|
18974
|
+
var target = maplibre_gl.MercatorCoordinate.fromLngLat([p.lng, p.lat], 0);
|
|
18975
|
+
var x = (target.x - refMercator.x) / meterScale;
|
|
18976
|
+
var z = (target.y - refMercator.y) / meterScale;
|
|
18977
|
+
return new three.Vector3(x, 0, z);
|
|
18978
|
+
});
|
|
18979
|
+
modelsGroup.updateMatrixWorld(true);
|
|
18980
|
+
var local = new three.Vector3();
|
|
18981
|
+
var _iterator3 = scene3DController_createForOfIteratorHelper(modelsGroup.children),
|
|
18982
|
+
_step3;
|
|
18983
|
+
try {
|
|
18984
|
+
var _loop2 = function _loop2() {
|
|
18985
|
+
var pivot = _step3.value;
|
|
18986
|
+
var routeCfg = pivot.userData.routeTransparency;
|
|
18987
|
+
var footprint = pivot.userData.footprint;
|
|
18988
|
+
// Only models with a route-transparency config participate (feature activation gate).
|
|
18989
|
+
if (!routeCfg || !footprint || groupLocalPoints.length === 0) {
|
|
18990
|
+
pivot.userData.routeAffected = false;
|
|
18991
|
+
return 1; // continue
|
|
18992
|
+
}
|
|
18993
|
+
pivot.userData.routeAffected = groupLocalPoints.some(function (gp) {
|
|
18994
|
+
// group-local -> world (applies globalOffset) -> pivot-local (undoes position/rotation/
|
|
18995
|
+
// scale), then test its x/z against the footprint. y is ignored (floor-level footprint).
|
|
18996
|
+
local.copy(gp);
|
|
18997
|
+
modelsGroup.localToWorld(local);
|
|
18998
|
+
pivot.worldToLocal(local);
|
|
18999
|
+
return pointInFootprint(footprint, local.x, local.z);
|
|
19000
|
+
});
|
|
19001
|
+
};
|
|
19002
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
19003
|
+
if (_loop2()) continue;
|
|
19004
|
+
}
|
|
19005
|
+
} catch (err) {
|
|
19006
|
+
_iterator3.e(err);
|
|
19007
|
+
} finally {
|
|
19008
|
+
_iterator3.f();
|
|
19009
|
+
}
|
|
19010
|
+
}
|
|
19011
|
+
|
|
19012
|
+
/**
|
|
19013
|
+
* Applies transparency to placed GLB models, combining zoom-based transparency
|
|
19014
|
+
* ({@link ZoomTransparencyConfig}, a hard threshold: fully opaque below the configured zoom,
|
|
19015
|
+
* configured opacity at/above it) with route-based transparency
|
|
19016
|
+
* ({@link RouteTransparencyConfig}) for models a route currently crosses
|
|
19017
|
+
* (`pivot.userData.routeAffected`). The more transparent of the two wins. Only triggers a
|
|
18814
19018
|
* repaint when at least one material actually changed.
|
|
18815
19019
|
*/
|
|
18816
19020
|
}, {
|
|
18817
|
-
key: "
|
|
18818
|
-
value: function
|
|
19021
|
+
key: "applyModelOpacity",
|
|
19022
|
+
value: function applyModelOpacity() {
|
|
18819
19023
|
if (!this.scene3DModelsGroup) {
|
|
18820
19024
|
return;
|
|
18821
19025
|
}
|
|
18822
19026
|
var zoom = this.map.getZoom();
|
|
18823
19027
|
var changed = false;
|
|
18824
|
-
var
|
|
18825
|
-
|
|
19028
|
+
var _iterator4 = scene3DController_createForOfIteratorHelper(this.scene3DModelsGroup.children),
|
|
19029
|
+
_step4;
|
|
18826
19030
|
try {
|
|
18827
|
-
var
|
|
18828
|
-
var pivot =
|
|
18829
|
-
var
|
|
18830
|
-
var
|
|
19031
|
+
var _loop3 = function _loop3() {
|
|
19032
|
+
var pivot = _step4.value;
|
|
19033
|
+
var zoomCfg = pivot.userData.zoomTransparency;
|
|
19034
|
+
var routeCfg = pivot.userData.routeTransparency;
|
|
19035
|
+
var routeAffected = pivot.userData.routeAffected === true;
|
|
19036
|
+
var opacity = effectiveModelOpacity(zoomCfg, routeCfg, zoom, routeAffected);
|
|
18831
19037
|
pivot.traverse(function (obj) {
|
|
18832
19038
|
var mesh = obj;
|
|
18833
19039
|
if (!mesh.isMesh) {
|
|
18834
19040
|
return;
|
|
18835
19041
|
}
|
|
18836
19042
|
var materials = Array.isArray(mesh.material) ? mesh.material : [mesh.material];
|
|
18837
|
-
var
|
|
18838
|
-
|
|
19043
|
+
var _iterator5 = scene3DController_createForOfIteratorHelper(materials),
|
|
19044
|
+
_step5;
|
|
18839
19045
|
try {
|
|
18840
|
-
for (
|
|
18841
|
-
var material =
|
|
19046
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
19047
|
+
var material = _step5.value;
|
|
18842
19048
|
if (material.opacity !== opacity) {
|
|
18843
19049
|
material.transparent = opacity < 1;
|
|
18844
19050
|
material.opacity = opacity;
|
|
@@ -18848,19 +19054,19 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
18848
19054
|
}
|
|
18849
19055
|
}
|
|
18850
19056
|
} catch (err) {
|
|
18851
|
-
|
|
19057
|
+
_iterator5.e(err);
|
|
18852
19058
|
} finally {
|
|
18853
|
-
|
|
19059
|
+
_iterator5.f();
|
|
18854
19060
|
}
|
|
18855
19061
|
});
|
|
18856
19062
|
};
|
|
18857
|
-
for (
|
|
18858
|
-
|
|
19063
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
19064
|
+
_loop3();
|
|
18859
19065
|
}
|
|
18860
19066
|
} catch (err) {
|
|
18861
|
-
|
|
19067
|
+
_iterator4.e(err);
|
|
18862
19068
|
} finally {
|
|
18863
|
-
|
|
19069
|
+
_iterator4.f();
|
|
18864
19070
|
}
|
|
18865
19071
|
if (changed) {
|
|
18866
19072
|
this.map.triggerRepaint();
|
|
@@ -18942,7 +19148,7 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
18942
19148
|
var _layerConfig$binaryDa2,
|
|
18943
19149
|
_layerConfig$minZoom,
|
|
18944
19150
|
_layerConfig$maxZoom,
|
|
18945
|
-
|
|
19151
|
+
_this4 = this;
|
|
18946
19152
|
var useSdf = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
18947
19153
|
var deck = this.deckMod;
|
|
18948
19154
|
if (!deck) return null;
|
|
@@ -18957,7 +19163,7 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
18957
19163
|
// Use area_name and poi Point features — unique per tile, no duplicates.
|
|
18958
19164
|
// If a logo-{name} image exists in the sprite, the icon takes priority over the text label.
|
|
18959
19165
|
var textData = buildLabelData(props.data || [], floorKey, function (imageId) {
|
|
18960
|
-
return
|
|
19166
|
+
return _this4.map.hasImage(imageId);
|
|
18961
19167
|
}, (_layerConfig$defaultH2 = layerConfig.defaultHeight) !== null && _layerConfig$defaultH2 !== void 0 ? _layerConfig$defaultH2 : 5);
|
|
18962
19168
|
if (!textData.length) return null;
|
|
18963
19169
|
return new deck.TextLayer(scene3DController_objectSpread(scene3DController_objectSpread({}, props), {}, {
|
|
@@ -18996,7 +19202,7 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
18996
19202
|
var _layerConfig$binaryDa3,
|
|
18997
19203
|
_layerConfig$minZoom2,
|
|
18998
19204
|
_layerConfig$maxZoom2,
|
|
18999
|
-
|
|
19205
|
+
_this5 = this;
|
|
19000
19206
|
var deck = this.deckMod;
|
|
19001
19207
|
if (!deck || !this.spriteIconMapping || !this.spriteAtlasImage) return null;
|
|
19002
19208
|
return new deck.MVTLayer({
|
|
@@ -19012,8 +19218,8 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
19012
19218
|
return new deck.IconLayer(scene3DController_objectSpread(scene3DController_objectSpread({}, props), {}, {
|
|
19013
19219
|
id: "".concat(props.id, "-poi-icons"),
|
|
19014
19220
|
data: iconData,
|
|
19015
|
-
iconAtlas:
|
|
19016
|
-
iconMapping:
|
|
19221
|
+
iconAtlas: _this5.spriteAtlasImage,
|
|
19222
|
+
iconMapping: _this5.spriteIconMapping,
|
|
19017
19223
|
getIcon: function getIcon(d) {
|
|
19018
19224
|
return d.icon;
|
|
19019
19225
|
},
|
|
@@ -19038,7 +19244,7 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
19038
19244
|
var _layerConfig$binaryDa4,
|
|
19039
19245
|
_layerConfig$minZoom3,
|
|
19040
19246
|
_layerConfig$maxZoom3,
|
|
19041
|
-
|
|
19247
|
+
_this6 = this;
|
|
19042
19248
|
var deck = this.deckMod;
|
|
19043
19249
|
if (!deck || !this.spriteIconMapping || !this.spriteAtlasImage) return null;
|
|
19044
19250
|
return new deck.MVTLayer({
|
|
@@ -19049,13 +19255,13 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
19049
19255
|
maxZoom: (_layerConfig$maxZoom3 = layerConfig.maxZoom) !== null && _layerConfig$maxZoom3 !== void 0 ? _layerConfig$maxZoom3 : 24,
|
|
19050
19256
|
renderSubLayers: function renderSubLayers(props) {
|
|
19051
19257
|
var _layerConfig$defaultH4, _layerConfig$sizeUnit2, _layerConfig$sizeScal2, _layerConfig$billboar2;
|
|
19052
|
-
var logoData = buildStoreLogoData(props.data || [], floorKey,
|
|
19258
|
+
var logoData = buildStoreLogoData(props.data || [], floorKey, _this6.spriteIconMapping, (_layerConfig$defaultH4 = layerConfig.defaultHeight) !== null && _layerConfig$defaultH4 !== void 0 ? _layerConfig$defaultH4 : 5);
|
|
19053
19259
|
if (!logoData.length) return null;
|
|
19054
19260
|
return new deck.IconLayer(scene3DController_objectSpread(scene3DController_objectSpread({}, props), {}, {
|
|
19055
19261
|
id: "".concat(props.id, "-store-logos"),
|
|
19056
19262
|
data: logoData,
|
|
19057
|
-
iconAtlas:
|
|
19058
|
-
iconMapping:
|
|
19263
|
+
iconAtlas: _this6.spriteAtlasImage,
|
|
19264
|
+
iconMapping: _this6.spriteIconMapping,
|
|
19059
19265
|
getIcon: function getIcon(d) {
|
|
19060
19266
|
return d.icon;
|
|
19061
19267
|
},
|
|
@@ -19067,7 +19273,7 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
19067
19273
|
},
|
|
19068
19274
|
getSize: function getSize(d) {
|
|
19069
19275
|
var _layerConfig$logoScal;
|
|
19070
|
-
return computeStoreLogoSize(
|
|
19276
|
+
return computeStoreLogoSize(_this6.spriteIconMapping, d.icon, (_layerConfig$logoScal = layerConfig.logoScale) !== null && _layerConfig$logoScal !== void 0 ? _layerConfig$logoScal : {});
|
|
19071
19277
|
},
|
|
19072
19278
|
sizeUnits: (_layerConfig$sizeUnit2 = layerConfig.sizeUnits) !== null && _layerConfig$sizeUnit2 !== void 0 ? _layerConfig$sizeUnit2 : "meters",
|
|
19073
19279
|
sizeScale: (_layerConfig$sizeScal2 = layerConfig.sizeScale) !== null && _layerConfig$sizeScal2 !== void 0 ? _layerConfig$sizeScal2 : 1,
|
|
@@ -19112,19 +19318,19 @@ var Scene3DController = /*#__PURE__*/function () {
|
|
|
19112
19318
|
key: "hideLayers",
|
|
19113
19319
|
value: function hideLayers(layersIds) {
|
|
19114
19320
|
if (!layersIds) return;
|
|
19115
|
-
var
|
|
19116
|
-
|
|
19321
|
+
var _iterator6 = scene3DController_createForOfIteratorHelper(layersIds),
|
|
19322
|
+
_step6;
|
|
19117
19323
|
try {
|
|
19118
|
-
for (
|
|
19119
|
-
var layerId =
|
|
19324
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
19325
|
+
var layerId = _step6.value;
|
|
19120
19326
|
var layer = this.map.getLayer(layerId);
|
|
19121
19327
|
if (!layer) continue;
|
|
19122
19328
|
this.map.setLayoutProperty(layer.id, "visibility", "none");
|
|
19123
19329
|
}
|
|
19124
19330
|
} catch (err) {
|
|
19125
|
-
|
|
19331
|
+
_iterator6.e(err);
|
|
19126
19332
|
} finally {
|
|
19127
|
-
|
|
19333
|
+
_iterator6.f();
|
|
19128
19334
|
}
|
|
19129
19335
|
}
|
|
19130
19336
|
}]);
|
|
@@ -19952,6 +20158,24 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
19952
20158
|
return (_this$currentFloor = this.currentFloor) !== null && _this$currentFloor !== void 0 ? _this$currentFloor : "";
|
|
19953
20159
|
}
|
|
19954
20160
|
|
|
20161
|
+
/**
|
|
20162
|
+
* Sets the route path used for GLB route-transparency collision, so 3D models a route passes
|
|
20163
|
+
* through fade and reveal the floor plan underneath. Called by {@link RouteController} whenever
|
|
20164
|
+
* the set of drawn routes changes. Points are tagged with the floor their segment is drawn on;
|
|
20165
|
+
* only points on the displayed floor participate. Pass an empty array to clear.
|
|
20166
|
+
*
|
|
20167
|
+
* No-op unless the 3D scene is active.
|
|
20168
|
+
*/
|
|
20169
|
+
}, {
|
|
20170
|
+
key: "setRouteCollisionPath",
|
|
20171
|
+
value: function setRouteCollisionPath(points) {
|
|
20172
|
+
var _this$scene3D;
|
|
20173
|
+
if (!this.is3DSceneActive()) {
|
|
20174
|
+
return;
|
|
20175
|
+
}
|
|
20176
|
+
(_this$scene3D = this.scene3D) === null || _this$scene3D === void 0 || _this$scene3D.setRouteCollisionPath(points);
|
|
20177
|
+
}
|
|
20178
|
+
|
|
19955
20179
|
/**
|
|
19956
20180
|
* Performs changes when parent place is updated
|
|
19957
20181
|
* @param place new parent place
|
|
@@ -19966,7 +20190,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
19966
20190
|
_this$innerFloors$fin,
|
|
19967
20191
|
_this$innerFloors$fin2,
|
|
19968
20192
|
_this$innerFloors$,
|
|
19969
|
-
_this$
|
|
20193
|
+
_this$scene3D2,
|
|
19970
20194
|
_this9 = this;
|
|
19971
20195
|
var updateStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
19972
20196
|
var onStyleReady = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -19981,7 +20205,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
19981
20205
|
if (place) {
|
|
19982
20206
|
this.subPlacesLoad(place.mapvxId);
|
|
19983
20207
|
}
|
|
19984
|
-
(_this$
|
|
20208
|
+
(_this$scene3D2 = this.scene3D) === null || _this$scene3D2 === void 0 || _this$scene3D2.onFloorChange(this.currentFloor);
|
|
19985
20209
|
if (updateStyle) {
|
|
19986
20210
|
this.repository.fetchAndParseMapStyle(place === null || place === void 0 ? void 0 : place.mapvxId).then(function (style) {
|
|
19987
20211
|
var useServiceWorkerCaching = _this9.tileCacheConfig.enabled && _this9.tileCacheConfig.persistToServiceWorker;
|
|
@@ -20003,7 +20227,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
20003
20227
|
}, {
|
|
20004
20228
|
key: "updatePlaceAndFloor",
|
|
20005
20229
|
value: function updatePlaceAndFloor(parentPlaceId, floorId) {
|
|
20006
|
-
var _place$innerFloors$so2, _ref2, _ref3, _this$innerFloors$fin3, _this$innerFloors$2, _this$
|
|
20230
|
+
var _place$innerFloors$so2, _ref2, _ref3, _this$innerFloors$fin3, _this$innerFloors$2, _this$scene3D3;
|
|
20007
20231
|
var place = this.potentialParentPlaces.find(function (place) {
|
|
20008
20232
|
return place.mapvxId === parentPlaceId;
|
|
20009
20233
|
});
|
|
@@ -20015,7 +20239,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
20015
20239
|
this.currentFloor = (_ref2 = (_ref3 = floorId !== null && floorId !== void 0 ? floorId : (_this$innerFloors$fin3 = this.innerFloors.find(function (floor) {
|
|
20016
20240
|
return floor.defaultFloor;
|
|
20017
20241
|
})) === null || _this$innerFloors$fin3 === void 0 ? void 0 : _this$innerFloors$fin3.key) !== null && _ref3 !== void 0 ? _ref3 : (_this$innerFloors$2 = this.innerFloors[0]) === null || _this$innerFloors$2 === void 0 ? void 0 : _this$innerFloors$2.key) !== null && _ref2 !== void 0 ? _ref2 : "";
|
|
20018
|
-
(_this$
|
|
20242
|
+
(_this$scene3D3 = this.scene3D) === null || _this$scene3D3 === void 0 || _this$scene3D3.onFloorChange(this.currentFloor);
|
|
20019
20243
|
}
|
|
20020
20244
|
}, {
|
|
20021
20245
|
key: "updateParentPlaceAndFloor",
|
|
@@ -20075,14 +20299,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
20075
20299
|
}, {
|
|
20076
20300
|
key: "whenStyleUpdates",
|
|
20077
20301
|
value: function whenStyleUpdates(newStyle) {
|
|
20078
|
-
var _this$
|
|
20302
|
+
var _this$scene3D4;
|
|
20079
20303
|
if (newStyle) {
|
|
20080
20304
|
this.setBaseFilters(newStyle);
|
|
20081
20305
|
}
|
|
20082
20306
|
this.routeController.addSourcesAndLayers();
|
|
20083
20307
|
this.refreshCircles();
|
|
20084
20308
|
this.filterByFloorKey(this.currentFloor);
|
|
20085
|
-
(_this$
|
|
20309
|
+
(_this$scene3D4 = this.scene3D) === null || _this$scene3D4 === void 0 || _this$scene3D4.refreshOverlay(this.currentFloor);
|
|
20086
20310
|
}
|
|
20087
20311
|
}, {
|
|
20088
20312
|
key: "addMarker",
|
|
@@ -20949,9 +21173,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
20949
21173
|
key: "updateFloor",
|
|
20950
21174
|
value: function updateFloor(floorId, options) {
|
|
20951
21175
|
try {
|
|
20952
|
-
var _this$
|
|
21176
|
+
var _this$scene3D5, _this$onFloorChange2, _options$onComplete6;
|
|
20953
21177
|
this.filterByFloorKey(floorId);
|
|
20954
|
-
(_this$
|
|
21178
|
+
(_this$scene3D5 = this.scene3D) === null || _this$scene3D5 === void 0 || _this$scene3D5.onFloorChange(this.currentFloor);
|
|
20955
21179
|
(_this$onFloorChange2 = this.onFloorChange) === null || _this$onFloorChange2 === void 0 || _this$onFloorChange2.call(this, floorId);
|
|
20956
21180
|
this.logEvent("updateFloor", {
|
|
20957
21181
|
floorId: floorId
|