venue-js 1.4.0-next.21 → 1.4.0-next.23
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/data/index.js +28 -19
- package/dist/data/index.js.map +1 -1
- package/dist/data/index.mjs +28 -19
- package/dist/data/index.mjs.map +1 -1
- package/dist/index.js +183 -174
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -956,7 +956,7 @@ var createElevatorNodeMap = (elevatorLikeRelationships, unitOpenings, options) =
|
|
|
956
956
|
const level = levels.find((level2) => level2.id === destination.properties.level_id);
|
|
957
957
|
return { opening, level };
|
|
958
958
|
});
|
|
959
|
-
const intermediaryOpeningAndLevels = intermediary.map((unitTypeAndId) => {
|
|
959
|
+
const intermediaryOpeningAndLevels = (intermediary || []).map((unitTypeAndId) => {
|
|
960
960
|
const openings = unitOpenings[unitTypeAndId.id];
|
|
961
961
|
const unit = units.find((unit2) => unit2.id === unitTypeAndId.id);
|
|
962
962
|
const level = levels.find((level2) => level2.id === unit.properties.level_id);
|
|
@@ -1000,11 +1000,13 @@ var createEscalatorNodeMap = (relationships, options) => {
|
|
|
1000
1000
|
const {
|
|
1001
1001
|
properties: { direction, origin, destination }
|
|
1002
1002
|
} = relationship;
|
|
1003
|
-
(
|
|
1004
|
-
|
|
1005
|
-
(
|
|
1003
|
+
if (origin && destination) {
|
|
1004
|
+
(0, import_set.default)(nodeMap, `${origin.id}.${destination.id}`, distanceOptions.baseDistance);
|
|
1005
|
+
if (direction === "undirected") {
|
|
1006
|
+
(0, import_set.default)(nodeMap, `${destination.id}.${origin.id}`, distanceOptions.baseDistance);
|
|
1007
|
+
}
|
|
1008
|
+
counter++;
|
|
1006
1009
|
}
|
|
1007
|
-
counter++;
|
|
1008
1010
|
}
|
|
1009
1011
|
const t1 = performance.now();
|
|
1010
1012
|
trace("nav", ` \u2502 \u251C\u2500 add ${counter} escalator relationships`, t1 - t0);
|
|
@@ -1057,7 +1059,9 @@ var createStairNodeMap = (elevatorLikeRelationships, unitOpenings, options) => {
|
|
|
1057
1059
|
const intermediaryOpeningAndLevels = intermediary.map((unitTypeAndId) => {
|
|
1058
1060
|
const openings2 = unitOpenings[unitTypeAndId.id];
|
|
1059
1061
|
const unit = units.find((unit2) => unit2.id === unitTypeAndId.id);
|
|
1062
|
+
if (!unit) return [];
|
|
1060
1063
|
const level = levels.find((level2) => level2.id === unit.properties.level_id);
|
|
1064
|
+
if (!level) return [];
|
|
1061
1065
|
return openings2.map((opening) => ({ opening, level }));
|
|
1062
1066
|
}).flat();
|
|
1063
1067
|
const connections = [...intermediaryOpeningAndLevels, destinationOpeningAndLevel];
|
|
@@ -1129,17 +1133,19 @@ var createPOINodeMap = (features, getFeatureUnit, unitOpenings) => {
|
|
|
1129
1133
|
features.forEach((feat) => {
|
|
1130
1134
|
try {
|
|
1131
1135
|
const locatedOnUnitId = getFeatureUnit(feat);
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1136
|
+
if (locatedOnUnitId) {
|
|
1137
|
+
const openings = unitOpenings[locatedOnUnitId] ?? [];
|
|
1138
|
+
const center8 = (0, import_center4.center)(feat);
|
|
1139
|
+
for (const opening of openings) {
|
|
1140
|
+
try {
|
|
1141
|
+
const openingCenter = (0, import_center4.center)(opening);
|
|
1142
|
+
const dis = (0, import_distance2.distance)(center8, openingCenter, { units: "meters" }) + BASE_POI_BASEDISTANCE;
|
|
1143
|
+
import_lodash9.default.set(nodeMap, `${opening.id}.${feat.id}`, dis);
|
|
1144
|
+
import_lodash9.default.set(nodeMap, `${feat.id}.${opening.id}`, dis);
|
|
1145
|
+
counter++;
|
|
1146
|
+
} catch (err) {
|
|
1147
|
+
console.log(err, opening);
|
|
1148
|
+
}
|
|
1143
1149
|
}
|
|
1144
1150
|
}
|
|
1145
1151
|
} catch (err) {
|
|
@@ -1241,7 +1247,7 @@ var prepareGraph = (options) => {
|
|
|
1241
1247
|
unitOpenings,
|
|
1242
1248
|
options
|
|
1243
1249
|
);
|
|
1244
|
-
const amenityNodeMap = createPOINodeMap(amenities, (amenity) => amenity.properties.unit_ids[0], unitOpenings);
|
|
1250
|
+
const amenityNodeMap = createPOINodeMap(amenities, (amenity) => amenity.properties.unit_ids?.[0] || null, unitOpenings);
|
|
1245
1251
|
const anchorsNodeMap = createPOINodeMap(anchors, (anchor) => anchor.properties.unit_id, unitOpenings);
|
|
1246
1252
|
const walkwayUnits = units.filter((unit) => unit.properties.category === "walkway");
|
|
1247
1253
|
const kioskNodeMap = createPOINodeMap(kiosks, (kiosk) => findContainingUnit(kiosk, walkwayUnits)?.id, unitOpenings);
|
|
@@ -2298,7 +2304,9 @@ var createLandmarkUtils = (options) => {
|
|
|
2298
2304
|
const locationType = occupant.properties.unit_id ? "unit" : "kiosk";
|
|
2299
2305
|
const locationId = locationType === "unit" ? occupant.properties.unit_id : occupant.properties.kiosk_id;
|
|
2300
2306
|
const location = locationType === "unit" ? findByIdSync(locationId) : findByIdSync(locationId);
|
|
2301
|
-
|
|
2307
|
+
if (!location) return null;
|
|
2308
|
+
const level = location.properties.level_id ? findByIdSync(location.properties.level_id) : null;
|
|
2309
|
+
if (!level) return null;
|
|
2302
2310
|
return {
|
|
2303
2311
|
name: occupant.properties.name,
|
|
2304
2312
|
point: (0, import_center8.center)(location.geometry).geometry.coordinates,
|
|
@@ -2308,7 +2316,7 @@ var createLandmarkUtils = (options) => {
|
|
|
2308
2316
|
};
|
|
2309
2317
|
};
|
|
2310
2318
|
const landmarks = [
|
|
2311
|
-
...occupants.map(occupantToLandmark)
|
|
2319
|
+
...compact(occupants.map(occupantToLandmark))
|
|
2312
2320
|
];
|
|
2313
2321
|
const findNearbyLandmarks = (point2, levelId) => {
|
|
2314
2322
|
if (point2 === null || levelId === null) return [];
|
|
@@ -2398,6 +2406,7 @@ var getNavigateClient = (options) => {
|
|
|
2398
2406
|
trace("nav", "\u2713 findRoute", 0);
|
|
2399
2407
|
const t02 = performance.now();
|
|
2400
2408
|
const path = graph.path(routeOriginParam, routeDestinationParam);
|
|
2409
|
+
if (path === null) return { steps: [], distance: 0, duration: 0 };
|
|
2401
2410
|
const t12 = performance.now();
|
|
2402
2411
|
trace("nav", " \u251C\u2500 path (dijkstra)", t12 - t02);
|
|
2403
2412
|
const waypoints = waypointUtils.toWaypoints(path);
|
|
@@ -2591,7 +2600,7 @@ var getDataClient = (options) => {
|
|
|
2591
2600
|
var import_maptalks_gl = require("maptalks-gl");
|
|
2592
2601
|
var import_transcoders = require("@maptalks/transcoders.draco");
|
|
2593
2602
|
var import_tween = __toESM(require("@tweenjs/tween.js"));
|
|
2594
|
-
var
|
|
2603
|
+
var import_lodash22 = __toESM(require("lodash"));
|
|
2595
2604
|
var import_distance6 = __toESM(require("@turf/distance"));
|
|
2596
2605
|
var import_center13 = __toESM(require("@turf/center"));
|
|
2597
2606
|
var import_three6 = require("three");
|
|
@@ -2672,7 +2681,7 @@ var VENUE_EVENTS = {
|
|
|
2672
2681
|
};
|
|
2673
2682
|
|
|
2674
2683
|
// src/IndoorMap/utils/createElements.js
|
|
2675
|
-
var
|
|
2684
|
+
var import_lodash18 = __toESM(require("lodash"));
|
|
2676
2685
|
var import_maptalks4 = require("maptalks");
|
|
2677
2686
|
var import_center11 = __toESM(require("@turf/center"));
|
|
2678
2687
|
var import_buffer = __toESM(require("@turf/buffer"));
|
|
@@ -2682,7 +2691,7 @@ var import_three4 = require("three");
|
|
|
2682
2691
|
var maptalks = __toESM(require("maptalks"));
|
|
2683
2692
|
var import_maptalks = require("maptalks.three");
|
|
2684
2693
|
var import_three = require("three");
|
|
2685
|
-
var
|
|
2694
|
+
var import_lodash15 = __toESM(require("lodash"));
|
|
2686
2695
|
var OPTIONS = {
|
|
2687
2696
|
altitude: 25,
|
|
2688
2697
|
scale: 15e-5,
|
|
@@ -2715,7 +2724,7 @@ var Billboard = class extends import_maptalks.BaseObject {
|
|
|
2715
2724
|
} = options;
|
|
2716
2725
|
this.properties = { ...properties };
|
|
2717
2726
|
this._createGroup();
|
|
2718
|
-
const divider =
|
|
2727
|
+
const divider = import_lodash15.default.clamp(window.innerWidth / 375 / 1.75, 1, 1.7);
|
|
2719
2728
|
if (showLeg) {
|
|
2720
2729
|
const lineMaterial = new import_three.LineBasicMaterial({
|
|
2721
2730
|
color: legColor,
|
|
@@ -2750,9 +2759,9 @@ var Billboard = class extends import_maptalks.BaseObject {
|
|
|
2750
2759
|
});
|
|
2751
2760
|
const z = layer.altitudeToVector3(altitude, altitude).x;
|
|
2752
2761
|
const position = layer.coordinateToVector3(coordinate, z);
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2762
|
+
import_lodash15.default.set(this.properties, "default.position", position);
|
|
2763
|
+
import_lodash15.default.set(this.properties, "default.altitude", altitude);
|
|
2764
|
+
import_lodash15.default.set(this.properties, "default.scale", scale3);
|
|
2756
2765
|
this.getObject3d().position.copy(position);
|
|
2757
2766
|
}
|
|
2758
2767
|
setLineHeight(altitude) {
|
|
@@ -2768,7 +2777,7 @@ var Billboard = class extends import_maptalks.BaseObject {
|
|
|
2768
2777
|
// src/IndoorMap/object3d/SpriteMarker.ts
|
|
2769
2778
|
var import_maptalks2 = require("maptalks.three");
|
|
2770
2779
|
var import_three2 = require("three");
|
|
2771
|
-
var
|
|
2780
|
+
var import_lodash16 = __toESM(require("lodash"));
|
|
2772
2781
|
var DEFAULT_SCALE = 0.05;
|
|
2773
2782
|
var DEFAULT_ALTITUDE = 0;
|
|
2774
2783
|
var DEFAULT_ALPHATEST = 0.3;
|
|
@@ -2799,7 +2808,7 @@ var SpriteMarker = class extends import_maptalks2.BaseObject {
|
|
|
2799
2808
|
this.properties = { ...properties };
|
|
2800
2809
|
const modifiedAltitude = altitude + 2;
|
|
2801
2810
|
this.#default = { options: { scale: scale3, altitude: modifiedAltitude }, material };
|
|
2802
|
-
this.#highlight =
|
|
2811
|
+
this.#highlight = import_lodash16.default.merge({}, DEFAULT_OPTIONS.highlight, highlight);
|
|
2803
2812
|
if (material && material instanceof import_three2.SpriteMaterial)
|
|
2804
2813
|
material.alphaTest = alphaTest;
|
|
2805
2814
|
const sprite = new import_three2.Sprite(material);
|
|
@@ -2808,7 +2817,7 @@ var SpriteMarker = class extends import_maptalks2.BaseObject {
|
|
|
2808
2817
|
obj3d.add(sprite);
|
|
2809
2818
|
const z = layer.altitudeToVector3(modifiedAltitude, modifiedAltitude).x;
|
|
2810
2819
|
const position = layer.coordinateToVector3(coordinate, z);
|
|
2811
|
-
|
|
2820
|
+
import_lodash16.default.set(this.properties, "default.position", position);
|
|
2812
2821
|
this.getObject3d().position.copy(position);
|
|
2813
2822
|
}
|
|
2814
2823
|
// Different objects need to implement their own methods
|
|
@@ -2950,14 +2959,14 @@ var NavigationPath = class extends import_maptalks3.BaseObject {
|
|
|
2950
2959
|
|
|
2951
2960
|
// src/IndoorMap/utils/geometry.ts
|
|
2952
2961
|
var import_center10 = __toESM(require("@turf/center"));
|
|
2953
|
-
var
|
|
2962
|
+
var import_lodash17 = __toESM(require("lodash"));
|
|
2954
2963
|
var import_line_offset = __toESM(require("@turf/line-offset"));
|
|
2955
2964
|
var getCenterFromGeometry = (geometry) => {
|
|
2956
2965
|
try {
|
|
2957
2966
|
const { type = null, coordinates = null } = geometry;
|
|
2958
2967
|
if (!type || !coordinates) return null;
|
|
2959
2968
|
const centerPoint = (0, import_center10.default)(geometry);
|
|
2960
|
-
return
|
|
2969
|
+
return import_lodash17.default.get(centerPoint, "geometry.coordinates");
|
|
2961
2970
|
} catch (error) {
|
|
2962
2971
|
return null;
|
|
2963
2972
|
}
|
|
@@ -3108,7 +3117,7 @@ var createWaterFixture = (feature2, style, options = {}) => {
|
|
|
3108
3117
|
const { geometry, properties } = feature2;
|
|
3109
3118
|
const { allowOverride, inheritFillColorToLine, zIndex } = options;
|
|
3110
3119
|
const symbolStyle = { ...style };
|
|
3111
|
-
if (allowOverride)
|
|
3120
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3112
3121
|
if (inheritFillColorToLine) symbolStyle.lineColor = symbolStyle.polygonFill;
|
|
3113
3122
|
return new GeometryType[geometry.type](geometry.coordinates, {
|
|
3114
3123
|
properties: {
|
|
@@ -3124,7 +3133,7 @@ var createVegetationFixture = (feature2, style, options = {}) => {
|
|
|
3124
3133
|
const { geometry, properties } = feature2;
|
|
3125
3134
|
const { allowOverride, inheritFillColorToLine, zIndex } = options;
|
|
3126
3135
|
const symbolStyle = { ...style };
|
|
3127
|
-
if (allowOverride)
|
|
3136
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3128
3137
|
if (inheritFillColorToLine) symbolStyle.lineColor = symbolStyle.polygonFill;
|
|
3129
3138
|
return new GeometryType[geometry.type](geometry.coordinates, {
|
|
3130
3139
|
properties: {
|
|
@@ -3141,8 +3150,8 @@ var createObstructionalFixture = (feature2, style = {}, options = {}) => {
|
|
|
3141
3150
|
const { model3d } = properties;
|
|
3142
3151
|
const { allowOverride, inheritFillColorToLine, zIndex } = options;
|
|
3143
3152
|
const symbolStyle = { ...style };
|
|
3144
|
-
if (!
|
|
3145
|
-
if (allowOverride)
|
|
3153
|
+
if (!import_lodash18.default.isEmpty(model3d)) return;
|
|
3154
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3146
3155
|
if (inheritFillColorToLine) symbolStyle.lineColor = symbolStyle.polygonFill;
|
|
3147
3156
|
if (geometry.type === "LineString") {
|
|
3148
3157
|
const polygon2 = createPolygonFromLineString(geometry);
|
|
@@ -3212,7 +3221,7 @@ var createPrincipalOpening = (feature2, style, options = {}) => {
|
|
|
3212
3221
|
const { geometry, properties } = feature2;
|
|
3213
3222
|
const { allowOverride, zIndex } = options;
|
|
3214
3223
|
const symbolStyle = { ...style };
|
|
3215
|
-
if (allowOverride)
|
|
3224
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3216
3225
|
try {
|
|
3217
3226
|
return new import_maptalks4.LineString(geometry.coordinates, {
|
|
3218
3227
|
properties: {
|
|
@@ -3229,7 +3238,7 @@ var createEmergencyExitOpening = (feature2, style, options = {}) => {
|
|
|
3229
3238
|
const { geometry, properties } = feature2;
|
|
3230
3239
|
const { allowOverride, zIndex } = options;
|
|
3231
3240
|
const symbolStyle = { ...style };
|
|
3232
|
-
if (allowOverride)
|
|
3241
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3233
3242
|
try {
|
|
3234
3243
|
return new import_maptalks4.LineString(geometry.coordinates, {
|
|
3235
3244
|
properties: {
|
|
@@ -3246,7 +3255,7 @@ var createPedestrianOpening = (feature2, style, options = {}) => {
|
|
|
3246
3255
|
const { geometry, properties, id } = feature2;
|
|
3247
3256
|
const { allowOverride, zIndex } = options;
|
|
3248
3257
|
const symbolStyle = { ...style };
|
|
3249
|
-
if (allowOverride)
|
|
3258
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3250
3259
|
try {
|
|
3251
3260
|
return new import_maptalks4.LineString(geometry.coordinates, {
|
|
3252
3261
|
properties: {
|
|
@@ -3284,9 +3293,9 @@ var create3DMarker = (coordinates, options, material, threeLayer, markerProperti
|
|
|
3284
3293
|
};
|
|
3285
3294
|
var getExtrudeConfigByFeature = (baseExtrudeConfig, feature2 = {}) => {
|
|
3286
3295
|
const { feature_type: featureType } = feature2;
|
|
3287
|
-
const featureExtrudeConfig =
|
|
3288
|
-
const featureCategory =
|
|
3289
|
-
const baseFeatureExtrudeConfig =
|
|
3296
|
+
const featureExtrudeConfig = import_lodash18.default.get(feature2, "properties.extrude");
|
|
3297
|
+
const featureCategory = import_lodash18.default.get(feature2, "properties.category");
|
|
3298
|
+
const baseFeatureExtrudeConfig = import_lodash18.default.get(
|
|
3290
3299
|
baseExtrudeConfig,
|
|
3291
3300
|
`${featureType}.${featureCategory || featureType}`
|
|
3292
3301
|
);
|
|
@@ -3344,50 +3353,50 @@ var createStyledUIMarkerElement = ({
|
|
|
3344
3353
|
var styledFeatureGenerator = (mapTheme) => {
|
|
3345
3354
|
const getElementSymbol = (key) => {
|
|
3346
3355
|
const [featureType] = key.split(".");
|
|
3347
|
-
const featureTypeTheme =
|
|
3356
|
+
const featureTypeTheme = import_lodash18.default.get(mapTheme, `${featureType}.geometry.symbol`);
|
|
3348
3357
|
if (featureType === key) return featureTypeTheme;
|
|
3349
|
-
const categoryTheme =
|
|
3350
|
-
return
|
|
3358
|
+
const categoryTheme = import_lodash18.default.get(mapTheme, `${key}.geometry.symbol`);
|
|
3359
|
+
return import_lodash18.default.merge({}, featureTypeTheme, categoryTheme);
|
|
3351
3360
|
};
|
|
3352
3361
|
const getLabelSymbol = (key) => {
|
|
3353
3362
|
const [featureType] = key.split(".");
|
|
3354
|
-
const featureTypeTheme =
|
|
3355
|
-
const categoryTheme =
|
|
3356
|
-
const mergedSymbol =
|
|
3357
|
-
let symbols =
|
|
3363
|
+
const featureTypeTheme = import_lodash18.default.get(mapTheme, `${featureType}.label`);
|
|
3364
|
+
const categoryTheme = import_lodash18.default.get(mapTheme, `${key}.label`);
|
|
3365
|
+
const mergedSymbol = import_lodash18.default.merge({}, featureTypeTheme, categoryTheme);
|
|
3366
|
+
let symbols = import_lodash18.default.values(import_lodash18.default.map(mergedSymbol, "symbol"));
|
|
3358
3367
|
const markerIndexToMove = symbols.findIndex(
|
|
3359
3368
|
({ elementType }) => elementType === "label.marker"
|
|
3360
3369
|
);
|
|
3361
3370
|
if (markerIndexToMove >= 0) {
|
|
3362
|
-
const markerSymbolToMove =
|
|
3371
|
+
const markerSymbolToMove = import_lodash18.default.pullAt(symbols, markerIndexToMove)[0];
|
|
3363
3372
|
symbols.push(markerSymbolToMove);
|
|
3364
3373
|
}
|
|
3365
3374
|
return symbols;
|
|
3366
3375
|
};
|
|
3367
3376
|
const getUIMarkerSymbol = (key) => {
|
|
3368
3377
|
const [featureType] = key.split(".");
|
|
3369
|
-
const featureTypeTheme =
|
|
3370
|
-
const categoryTheme =
|
|
3371
|
-
const mergedSymbol =
|
|
3372
|
-
const symbol =
|
|
3378
|
+
const featureTypeTheme = import_lodash18.default.get(mapTheme, `${featureType}.ui.marker`);
|
|
3379
|
+
const categoryTheme = import_lodash18.default.get(mapTheme, `${key}.ui.marker`);
|
|
3380
|
+
const mergedSymbol = import_lodash18.default.merge({}, featureTypeTheme, categoryTheme);
|
|
3381
|
+
const symbol = import_lodash18.default.get(mergedSymbol, "symbol");
|
|
3373
3382
|
return symbol;
|
|
3374
3383
|
};
|
|
3375
3384
|
const getUIMarkerOptions = (key) => {
|
|
3376
3385
|
const [featureType] = key.split(".");
|
|
3377
|
-
const featureTypeTheme =
|
|
3378
|
-
const categoryTheme =
|
|
3379
|
-
const mergedSymbol =
|
|
3380
|
-
const options =
|
|
3386
|
+
const featureTypeTheme = import_lodash18.default.get(mapTheme, `${featureType}.ui.marker`);
|
|
3387
|
+
const categoryTheme = import_lodash18.default.get(mapTheme, `${key}.ui.marker`);
|
|
3388
|
+
const mergedSymbol = import_lodash18.default.merge({}, featureTypeTheme, categoryTheme);
|
|
3389
|
+
const options = import_lodash18.default.get(mergedSymbol, "options");
|
|
3381
3390
|
return options;
|
|
3382
3391
|
};
|
|
3383
3392
|
const getLabelOptions = (key) => {
|
|
3384
3393
|
const [featureType] = key.split(".");
|
|
3385
|
-
const featureTypeSymbol =
|
|
3386
|
-
const categorySymbol =
|
|
3387
|
-
const mergedSymbol =
|
|
3388
|
-
return
|
|
3394
|
+
const featureTypeSymbol = import_lodash18.default.get(mapTheme, `${featureType}.label`);
|
|
3395
|
+
const categorySymbol = import_lodash18.default.get(mapTheme, `${key}.label`);
|
|
3396
|
+
const mergedSymbol = import_lodash18.default.merge({}, featureTypeSymbol, categorySymbol);
|
|
3397
|
+
return import_lodash18.default.reduce(
|
|
3389
3398
|
mergedSymbol,
|
|
3390
|
-
(acc, symbol) => ({ ...acc, ...
|
|
3399
|
+
(acc, symbol) => ({ ...acc, ...import_lodash18.default.get(symbol, "options", {}) }),
|
|
3391
3400
|
{}
|
|
3392
3401
|
);
|
|
3393
3402
|
};
|
|
@@ -3402,13 +3411,13 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3402
3411
|
};
|
|
3403
3412
|
const generateSpriteHighlightMarkerOption = () => {
|
|
3404
3413
|
return SPRITE_HIGHLIGHT_MARKER_FEATURE.reduce((acc, featCate) => {
|
|
3405
|
-
const categoryKey =
|
|
3414
|
+
const categoryKey = import_lodash18.default.last(featCate.split("-"));
|
|
3406
3415
|
const defaultLabelSymbol = getLabelSymbol(categoryKey);
|
|
3407
3416
|
const highlightLabelSymbol = getLabelSymbol(featCate);
|
|
3408
3417
|
const [defaultBase, defaultIcon] = defaultLabelSymbol;
|
|
3409
3418
|
const [highlightBase, highlightIcon] = highlightLabelSymbol;
|
|
3410
|
-
const base =
|
|
3411
|
-
const icon =
|
|
3419
|
+
const base = import_lodash18.default.merge({}, defaultBase, highlightBase);
|
|
3420
|
+
const icon = import_lodash18.default.merge({}, defaultIcon, highlightIcon);
|
|
3412
3421
|
const material = createSpriteMaterialByLabelSymbol([base, icon]);
|
|
3413
3422
|
const options = getLabelOptions(featCate);
|
|
3414
3423
|
return { ...acc, [featCate]: { material, options } };
|
|
@@ -3418,22 +3427,22 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3418
3427
|
const spriteHighlightMarkerOptionObj = generateSpriteHighlightMarkerOption();
|
|
3419
3428
|
const getElementOptions = (key) => {
|
|
3420
3429
|
const [featureType] = key.split(".");
|
|
3421
|
-
const featureTypeOptions =
|
|
3430
|
+
const featureTypeOptions = import_lodash18.default.get(
|
|
3422
3431
|
mapTheme,
|
|
3423
3432
|
`${featureType}.geometry.options`
|
|
3424
3433
|
);
|
|
3425
|
-
const categoryOptions =
|
|
3426
|
-
return
|
|
3434
|
+
const categoryOptions = import_lodash18.default.get(mapTheme, `${key}.geometry.options`);
|
|
3435
|
+
return import_lodash18.default.merge({}, featureTypeOptions, categoryOptions);
|
|
3427
3436
|
};
|
|
3428
3437
|
const createOccupantMarker = (feature2, locatedFeature, mapConfig) => {
|
|
3429
3438
|
const { textMarkerType, featureExtrudeConfig } = getFeatureMarkerConfig(
|
|
3430
3439
|
feature2,
|
|
3431
3440
|
mapConfig
|
|
3432
3441
|
);
|
|
3433
|
-
const markerHeight =
|
|
3442
|
+
const markerHeight = import_lodash18.default.get(featureExtrudeConfig, "height", 0);
|
|
3434
3443
|
const { properties, id, feature_type } = feature2;
|
|
3435
3444
|
if (!properties.anchor) return;
|
|
3436
|
-
const mainLocationId =
|
|
3445
|
+
const mainLocationId = import_lodash18.default.get(properties, "unit.id") || import_lodash18.default.get(properties, "kiosk.id");
|
|
3437
3446
|
const isMainLocationFeature = mainLocationId === locatedFeature?.id;
|
|
3438
3447
|
const { geometry: mainLocationGeometry } = properties?.anchor;
|
|
3439
3448
|
const geometry = isMainLocationFeature ? mainLocationGeometry : (0, import_center11.default)(locatedFeature)?.geometry;
|
|
@@ -3443,7 +3452,7 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3443
3452
|
category: properties.category,
|
|
3444
3453
|
altitude: getAltitude(properties)
|
|
3445
3454
|
};
|
|
3446
|
-
const occupantName =
|
|
3455
|
+
const occupantName = import_lodash18.default.isEmpty(properties.short_name) ? properties.name : properties.short_name;
|
|
3447
3456
|
if (locatedFeature) {
|
|
3448
3457
|
const { feature_type: feature_type2, properties: properties2 } = locatedFeature;
|
|
3449
3458
|
const { category } = properties2;
|
|
@@ -3457,21 +3466,21 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3457
3466
|
}
|
|
3458
3467
|
return requestedType;
|
|
3459
3468
|
};
|
|
3460
|
-
const logoUrl =
|
|
3461
|
-
const requestedRenderType =
|
|
3469
|
+
const logoUrl = import_lodash18.default.get(properties, "logo.url");
|
|
3470
|
+
const requestedRenderType = import_lodash18.default.get(properties, "render_type", "Name");
|
|
3462
3471
|
const renderType = getValidatedRenderType(requestedRenderType, logoUrl);
|
|
3463
3472
|
if (renderType === "Label") return null;
|
|
3464
3473
|
const renderPriority = properties.render_priority || 3;
|
|
3465
|
-
const labelSymbol = getLabelSymbol(`occupant-${
|
|
3466
|
-
const markerSymbol =
|
|
3467
|
-
const coordinates =
|
|
3474
|
+
const labelSymbol = getLabelSymbol(`occupant-${import_lodash18.default.toLower(renderType)}`);
|
|
3475
|
+
const markerSymbol = import_lodash18.default.last(labelSymbol);
|
|
3476
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
3468
3477
|
const priorityLabelSymbol = getLabelSymbol(
|
|
3469
|
-
`occupant-${
|
|
3478
|
+
`occupant-${import_lodash18.default.toLower(renderType)}-${renderPriority}`
|
|
3470
3479
|
);
|
|
3471
|
-
const priorityMarkerSymbol =
|
|
3480
|
+
const priorityMarkerSymbol = import_lodash18.default.last(priorityLabelSymbol) || {};
|
|
3472
3481
|
switch (renderType) {
|
|
3473
3482
|
case "Logo":
|
|
3474
|
-
|
|
3483
|
+
import_lodash18.default.set(priorityMarkerSymbol, "markerFile", logoUrl);
|
|
3475
3484
|
return new import_maptalks4.Marker(coordinates, {
|
|
3476
3485
|
properties: {
|
|
3477
3486
|
altitude: getAltitude(properties) + markerHeight,
|
|
@@ -3532,13 +3541,13 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3532
3541
|
});
|
|
3533
3542
|
}
|
|
3534
3543
|
const uiMarkerSymbol = getUIMarkerSymbol(
|
|
3535
|
-
`occupant-${
|
|
3544
|
+
`occupant-${import_lodash18.default.toLower(renderType)}`
|
|
3536
3545
|
);
|
|
3537
3546
|
const uiMarkerPrioritySymbol = getUIMarkerSymbol(
|
|
3538
|
-
`occupant-${
|
|
3547
|
+
`occupant-${import_lodash18.default.toLower(renderType)}-${renderPriority}`
|
|
3539
3548
|
);
|
|
3540
3549
|
const uiMarkerPriorityOptions = getUIMarkerOptions(
|
|
3541
|
-
`occupant-${
|
|
3550
|
+
`occupant-${import_lodash18.default.toLower(renderType)}-${renderPriority}`
|
|
3542
3551
|
);
|
|
3543
3552
|
const style = { ...uiMarkerSymbol, ...uiMarkerPrioritySymbol };
|
|
3544
3553
|
return new import_maptalks4.ui.UIMarker(coordinates, {
|
|
@@ -3560,7 +3569,7 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3560
3569
|
const { category, ordinal, style = {} } = properties;
|
|
3561
3570
|
const elementStyle = getElementSymbol(`${feature_type}.${category}`);
|
|
3562
3571
|
const { allowOverride } = getElementOptions(`${feature_type}.${category}`);
|
|
3563
|
-
if (allowOverride)
|
|
3572
|
+
if (allowOverride) import_lodash18.default.merge(elementStyle, style);
|
|
3564
3573
|
const { polygonFill: color } = elementStyle;
|
|
3565
3574
|
const featureProperty = {
|
|
3566
3575
|
id,
|
|
@@ -3649,9 +3658,9 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3649
3658
|
feature2,
|
|
3650
3659
|
mapConfig
|
|
3651
3660
|
);
|
|
3652
|
-
const markerHeight =
|
|
3661
|
+
const markerHeight = import_lodash18.default.get(featureExtrudeConfig, "height");
|
|
3653
3662
|
const { id, properties } = feature2;
|
|
3654
|
-
const geometry =
|
|
3663
|
+
const geometry = import_lodash18.default.get(feature2, "geometry") || import_lodash18.default.get(feature2, "properties.anchor.geometry");
|
|
3655
3664
|
const coordinates = getCenterFromGeometry(geometry);
|
|
3656
3665
|
const symbol = getElementSymbol("pin-marker");
|
|
3657
3666
|
try {
|
|
@@ -3671,10 +3680,10 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3671
3680
|
feature2,
|
|
3672
3681
|
mapConfig
|
|
3673
3682
|
);
|
|
3674
|
-
const markerHeight =
|
|
3683
|
+
const markerHeight = import_lodash18.default.get(featureExtrudeConfig, "height", 0);
|
|
3675
3684
|
const { properties, id } = feature2;
|
|
3676
3685
|
const { geometry } = properties.anchor;
|
|
3677
|
-
const logoUrl =
|
|
3686
|
+
const logoUrl = import_lodash18.default.get(properties, "logo.url");
|
|
3678
3687
|
const coordinates = getCenterFromGeometry(geometry);
|
|
3679
3688
|
const [markerBase, markerLabel] = getLabelSymbol(
|
|
3680
3689
|
"highlighted-logo-marker"
|
|
@@ -3744,7 +3753,7 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3744
3753
|
feature2,
|
|
3745
3754
|
mapConfig
|
|
3746
3755
|
);
|
|
3747
|
-
const markerHeight =
|
|
3756
|
+
const markerHeight = import_lodash18.default.get(featureExtrudeConfig, "height");
|
|
3748
3757
|
const { id, feature_type, properties } = feature2;
|
|
3749
3758
|
if (!properties.anchor) return;
|
|
3750
3759
|
const markerProperties = {
|
|
@@ -3754,8 +3763,8 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3754
3763
|
altitude: getAltitude(properties) + markerHeight
|
|
3755
3764
|
};
|
|
3756
3765
|
const { geometry } = properties?.anchor;
|
|
3757
|
-
const coordinates =
|
|
3758
|
-
const logoUrl =
|
|
3766
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
3767
|
+
const logoUrl = import_lodash18.default.get(properties, "logo.url");
|
|
3759
3768
|
if (markerSymbol) {
|
|
3760
3769
|
return new import_maptalks4.Marker(coordinates, {
|
|
3761
3770
|
properties: markerProperties,
|
|
@@ -3770,8 +3779,8 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3770
3779
|
});
|
|
3771
3780
|
}
|
|
3772
3781
|
const labelSymbol = getLabelSymbol("highlight-occupant-logo");
|
|
3773
|
-
const priorityMarkerSymbol =
|
|
3774
|
-
|
|
3782
|
+
const priorityMarkerSymbol = import_lodash18.default.last(labelSymbol) || {};
|
|
3783
|
+
import_lodash18.default.set(priorityMarkerSymbol, "markerFile", logoUrl);
|
|
3775
3784
|
return new import_maptalks4.Marker(coordinates, {
|
|
3776
3785
|
properties: markerProperties,
|
|
3777
3786
|
symbol: labelSymbol
|
|
@@ -3779,14 +3788,14 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3779
3788
|
},
|
|
3780
3789
|
createHighlight2DAmenityMarkerFrom3DMarker: (feature2, mapConfig) => {
|
|
3781
3790
|
const { coordinates, units, kiosk } = feature2;
|
|
3782
|
-
const amenityLocatedUnit =
|
|
3791
|
+
const amenityLocatedUnit = import_lodash18.default.first(units);
|
|
3783
3792
|
const unitConfig = getExtrudeConfigByFeature(
|
|
3784
3793
|
mapConfig,
|
|
3785
3794
|
amenityLocatedUnit
|
|
3786
3795
|
);
|
|
3787
|
-
const unitHeight =
|
|
3796
|
+
const unitHeight = import_lodash18.default.get(unitConfig, "height", 0);
|
|
3788
3797
|
const kioskConfig = getExtrudeConfigByFeature(mapConfig, kiosk);
|
|
3789
|
-
const kioskHeight =
|
|
3798
|
+
const kioskHeight = import_lodash18.default.get(kioskConfig, "height", 0);
|
|
3790
3799
|
const markerHeight = unitHeight + kioskHeight;
|
|
3791
3800
|
const symbol = getElementSymbol("highlight-amenity-marker");
|
|
3792
3801
|
return new import_maptalks4.Marker(coordinates, {
|
|
@@ -3862,7 +3871,7 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3862
3871
|
}
|
|
3863
3872
|
},
|
|
3864
3873
|
createLineStringFromGeometries: (geometries) => {
|
|
3865
|
-
const mergedCoordinates = (0,
|
|
3874
|
+
const mergedCoordinates = (0, import_lodash18.default)(geometries).map((geometry) => {
|
|
3866
3875
|
switch (geometry.type) {
|
|
3867
3876
|
case "Point":
|
|
3868
3877
|
return [
|
|
@@ -3971,29 +3980,29 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3971
3980
|
create3DAmenityMarker: (feature2, threeLayer, config) => {
|
|
3972
3981
|
const { geometry, properties, feature_type, id } = feature2;
|
|
3973
3982
|
const { category, units, kiosk, is_clickable } = properties;
|
|
3974
|
-
const amenityLocatedUnit =
|
|
3975
|
-
const isLocatedUnitModel3dAvailable = !
|
|
3983
|
+
const amenityLocatedUnit = import_lodash18.default.first(units);
|
|
3984
|
+
const isLocatedUnitModel3dAvailable = !import_lodash18.default.isEmpty(
|
|
3976
3985
|
amenityLocatedUnit?.properties?.model3d
|
|
3977
3986
|
);
|
|
3978
|
-
const isLocatedKioskModel3dAvailable = !
|
|
3987
|
+
const isLocatedKioskModel3dAvailable = !import_lodash18.default.isEmpty(
|
|
3979
3988
|
kiosk?.properties?.model3d
|
|
3980
3989
|
);
|
|
3981
3990
|
const unitConfig = getExtrudeConfigByFeature(config, amenityLocatedUnit);
|
|
3982
|
-
const unitHeight = isLocatedUnitModel3dAvailable ? 0 :
|
|
3991
|
+
const unitHeight = isLocatedUnitModel3dAvailable ? 0 : import_lodash18.default.get(unitConfig, "height", 0);
|
|
3983
3992
|
const kioskConfig = getExtrudeConfigByFeature(config, kiosk);
|
|
3984
|
-
const kioskHeight = isLocatedKioskModel3dAvailable ? 0 :
|
|
3985
|
-
const coordinates =
|
|
3993
|
+
const kioskHeight = isLocatedKioskModel3dAvailable ? 0 : import_lodash18.default.get(kioskConfig, "height", 0);
|
|
3994
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
3986
3995
|
const markerProperties = {
|
|
3987
3996
|
...properties,
|
|
3988
3997
|
coordinates,
|
|
3989
3998
|
id,
|
|
3990
3999
|
feature_type
|
|
3991
4000
|
};
|
|
3992
|
-
const material =
|
|
4001
|
+
const material = import_lodash18.default.get(
|
|
3993
4002
|
spriteMarkerMaterialObj,
|
|
3994
4003
|
`${feature_type}.${category}`
|
|
3995
4004
|
);
|
|
3996
|
-
const highlightOptions =
|
|
4005
|
+
const highlightOptions = import_lodash18.default.get(
|
|
3997
4006
|
spriteHighlightMarkerOptionObj,
|
|
3998
4007
|
`${PREFIX_HIGHLIGHTED_SYMBOL_KEY}-${feature_type}.${category}`
|
|
3999
4008
|
);
|
|
@@ -4016,24 +4025,24 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
4016
4025
|
const { category, unit, kiosk } = properties;
|
|
4017
4026
|
const amenityLocation = kiosk || unit;
|
|
4018
4027
|
const locationConfig = getExtrudeConfigByFeature(config, amenityLocation);
|
|
4019
|
-
const coordinates =
|
|
4028
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
4020
4029
|
const markerProperties = {
|
|
4021
4030
|
...properties,
|
|
4022
4031
|
coordinates,
|
|
4023
4032
|
id,
|
|
4024
4033
|
feature_type
|
|
4025
4034
|
};
|
|
4026
|
-
const material =
|
|
4035
|
+
const material = import_lodash18.default.get(
|
|
4027
4036
|
spriteMarkerMaterialObj,
|
|
4028
4037
|
`${feature_type}.${category}`
|
|
4029
4038
|
);
|
|
4030
|
-
const highlightOptions =
|
|
4039
|
+
const highlightOptions = import_lodash18.default.get(
|
|
4031
4040
|
spriteHighlightMarkerOptionObj,
|
|
4032
4041
|
`${PREFIX_HIGHLIGHTED_SYMBOL_KEY}-${feature_type}.${category}`
|
|
4033
4042
|
);
|
|
4034
4043
|
const options = {
|
|
4035
4044
|
scale: 0.05,
|
|
4036
|
-
altitude:
|
|
4045
|
+
altitude: import_lodash18.default.get(locationConfig, "height", 0),
|
|
4037
4046
|
highlight: highlightOptions
|
|
4038
4047
|
};
|
|
4039
4048
|
return create3DMarker(
|
|
@@ -4049,24 +4058,24 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
4049
4058
|
const { category, unit, kiosk } = properties;
|
|
4050
4059
|
const amenityLocation = kiosk || unit;
|
|
4051
4060
|
const locationConfig = getExtrudeConfigByFeature(config, amenityLocation);
|
|
4052
|
-
const coordinates =
|
|
4061
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
4053
4062
|
const markerProperties = {
|
|
4054
4063
|
...properties,
|
|
4055
4064
|
coordinates,
|
|
4056
4065
|
id,
|
|
4057
4066
|
feature_type
|
|
4058
4067
|
};
|
|
4059
|
-
const material =
|
|
4068
|
+
const material = import_lodash18.default.get(
|
|
4060
4069
|
spriteMarkerMaterialObj,
|
|
4061
4070
|
`${feature_type}.${category}`
|
|
4062
4071
|
);
|
|
4063
|
-
const highlightOptions =
|
|
4072
|
+
const highlightOptions = import_lodash18.default.get(
|
|
4064
4073
|
spriteHighlightMarkerOptionObj,
|
|
4065
4074
|
`${PREFIX_HIGHLIGHTED_SYMBOL_KEY}-${feature_type}.${category}`
|
|
4066
4075
|
);
|
|
4067
4076
|
const options = {
|
|
4068
4077
|
scale: 0.05,
|
|
4069
|
-
altitude:
|
|
4078
|
+
altitude: import_lodash18.default.get(locationConfig, "height", 0),
|
|
4070
4079
|
highlight: highlightOptions
|
|
4071
4080
|
};
|
|
4072
4081
|
return create3DMarker(
|
|
@@ -4078,13 +4087,13 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
4078
4087
|
);
|
|
4079
4088
|
},
|
|
4080
4089
|
createExtrudedUnit: (unit, threeLayer, options) => {
|
|
4081
|
-
const extrudeHeight =
|
|
4090
|
+
const extrudeHeight = import_lodash18.default.get(options, "height");
|
|
4082
4091
|
if (!extrudeHeight) return;
|
|
4083
4092
|
const unitProperty = getFeatureProperties(unit);
|
|
4084
4093
|
const options3d = {
|
|
4085
4094
|
// TODO: Move to extrude config later
|
|
4086
4095
|
offset: -0.1,
|
|
4087
|
-
altitude:
|
|
4096
|
+
altitude: import_lodash18.default.get(options, "altitude", 0)
|
|
4088
4097
|
};
|
|
4089
4098
|
const color = unitProperty.defaultColor;
|
|
4090
4099
|
if (color === "transparent") return;
|
|
@@ -4127,14 +4136,14 @@ var EXCEPT_AMENITY_LOCATION_CATEGORIES = [
|
|
|
4127
4136
|
"unspecified"
|
|
4128
4137
|
];
|
|
4129
4138
|
var getLocationByAmenity = (feature2) => {
|
|
4130
|
-
const unit =
|
|
4131
|
-
const unitCategory =
|
|
4139
|
+
const unit = import_lodash18.default.get(feature2, "properties.units[0]", null);
|
|
4140
|
+
const unitCategory = import_lodash18.default.get(unit, "properties.category");
|
|
4132
4141
|
if (!unit) return feature2.id;
|
|
4133
4142
|
return EXCEPT_AMENITY_LOCATION_CATEGORIES.includes(unitCategory) ? feature2 : unit;
|
|
4134
4143
|
};
|
|
4135
4144
|
var getLocationByOccupant = (feature2) => {
|
|
4136
|
-
const kiosk =
|
|
4137
|
-
const unit =
|
|
4145
|
+
const kiosk = import_lodash18.default.get(feature2, "properties.kiosk", null);
|
|
4146
|
+
const unit = import_lodash18.default.get(feature2, "properties.anchor.properties.unit", null);
|
|
4138
4147
|
return kiosk || unit;
|
|
4139
4148
|
};
|
|
4140
4149
|
var getLocationIdByFeature = (feature2) => {
|
|
@@ -4162,10 +4171,10 @@ var getFeatureByLocationId = (id, features = []) => {
|
|
|
4162
4171
|
});
|
|
4163
4172
|
};
|
|
4164
4173
|
var isClickableFeature = (feature2) => {
|
|
4165
|
-
const isClickable =
|
|
4174
|
+
const isClickable = import_lodash18.default.get(feature2, "properties.is_clickable");
|
|
4166
4175
|
switch (feature2?.feature_type) {
|
|
4167
4176
|
case "amenity":
|
|
4168
|
-
return
|
|
4177
|
+
return import_lodash18.default.isNull(isClickable) ? true : isClickable;
|
|
4169
4178
|
case "occupant":
|
|
4170
4179
|
return true;
|
|
4171
4180
|
default:
|
|
@@ -4183,15 +4192,15 @@ var getLocationByFeature = (feature2) => {
|
|
|
4183
4192
|
}
|
|
4184
4193
|
};
|
|
4185
4194
|
var getRelatedLocationsByOccupant = (feature2) => {
|
|
4186
|
-
const kiosks =
|
|
4187
|
-
const units =
|
|
4195
|
+
const kiosks = import_lodash18.default.get(feature2, "properties.kiosks", []);
|
|
4196
|
+
const units = import_lodash18.default.get(feature2, "properties.units", []);
|
|
4188
4197
|
return [...kiosks, ...units];
|
|
4189
4198
|
};
|
|
4190
4199
|
var getRelatedLocationsByAmenity = (feature2) => {
|
|
4191
|
-
const units =
|
|
4200
|
+
const units = import_lodash18.default.get(feature2, "properties.units", []);
|
|
4192
4201
|
if (units.length === 0) return [feature2];
|
|
4193
4202
|
return units.filter((unit) => {
|
|
4194
|
-
const unitCategory =
|
|
4203
|
+
const unitCategory = import_lodash18.default.get(unit, "properties.category");
|
|
4195
4204
|
return !EXCEPT_AMENITY_LOCATION_CATEGORIES.includes(unitCategory);
|
|
4196
4205
|
});
|
|
4197
4206
|
};
|
|
@@ -4217,8 +4226,8 @@ var getRelatedLocationsByFeature = (feature2) => {
|
|
|
4217
4226
|
};
|
|
4218
4227
|
var getOrdinalByLocationId = (locationId, feature2) => {
|
|
4219
4228
|
if (!feature2) return null;
|
|
4220
|
-
const mainUnit =
|
|
4221
|
-
const mainKiosk =
|
|
4229
|
+
const mainUnit = import_lodash18.default.get(feature2, "properties.unit");
|
|
4230
|
+
const mainKiosk = import_lodash18.default.get(feature2, "properties.kiosk");
|
|
4222
4231
|
const relatedLocations = getRelatedLocationsByFeature(feature2);
|
|
4223
4232
|
const allLocations = [mainUnit, mainKiosk, ...relatedLocations].filter(
|
|
4224
4233
|
Boolean
|
|
@@ -4226,7 +4235,7 @@ var getOrdinalByLocationId = (locationId, feature2) => {
|
|
|
4226
4235
|
const targetLocation = allLocations.find(
|
|
4227
4236
|
(location) => location.id === locationId
|
|
4228
4237
|
);
|
|
4229
|
-
return targetLocation ?
|
|
4238
|
+
return targetLocation ? import_lodash18.default.get(targetLocation, "properties.level.properties.ordinal") || import_lodash18.default.get(targetLocation, "properties.ordinal") : null;
|
|
4230
4239
|
};
|
|
4231
4240
|
|
|
4232
4241
|
// src/IndoorMap/utils/math.ts
|
|
@@ -4311,7 +4320,7 @@ var CameraManager = class {
|
|
|
4311
4320
|
};
|
|
4312
4321
|
|
|
4313
4322
|
// src/IndoorMap/renderer/RendererManager.ts
|
|
4314
|
-
var
|
|
4323
|
+
var import_lodash21 = require("lodash");
|
|
4315
4324
|
var import_center12 = require("@turf/center");
|
|
4316
4325
|
var THREE4 = __toESM(require("three"));
|
|
4317
4326
|
|
|
@@ -4332,7 +4341,7 @@ var maptalks3 = __toESM(require("maptalks-gl"));
|
|
|
4332
4341
|
var import_maptalks6 = require("maptalks.three");
|
|
4333
4342
|
var import_three5 = require("three");
|
|
4334
4343
|
var import_d3plus_shape = require("d3plus-shape");
|
|
4335
|
-
var
|
|
4344
|
+
var import_lodash19 = require("lodash");
|
|
4336
4345
|
var OPTIONS3 = {
|
|
4337
4346
|
// Allowing click through and prevent interaction
|
|
4338
4347
|
interactive: false,
|
|
@@ -4350,9 +4359,9 @@ var defaultFlatLabelOptions = {
|
|
|
4350
4359
|
textBaseline: "middle",
|
|
4351
4360
|
fillStyle: "#000"
|
|
4352
4361
|
};
|
|
4353
|
-
var defaultRectAngleToCalc = (0,
|
|
4362
|
+
var defaultRectAngleToCalc = (0, import_lodash19.range)(-90, 92, 2);
|
|
4354
4363
|
var getMaterial = (text, flatLabelOptions) => {
|
|
4355
|
-
const options = (0,
|
|
4364
|
+
const options = (0, import_lodash19.merge)({}, defaultFlatLabelOptions, flatLabelOptions);
|
|
4356
4365
|
const {
|
|
4357
4366
|
fontSize: initialFontSize,
|
|
4358
4367
|
fontFamily,
|
|
@@ -4405,12 +4414,12 @@ var getMaterial = (text, flatLabelOptions) => {
|
|
|
4405
4414
|
const maxWidth = SIZE - 2 * margin;
|
|
4406
4415
|
texts = wrapText(ctx, text, maxWidth);
|
|
4407
4416
|
}
|
|
4408
|
-
let textWidth = (0,
|
|
4417
|
+
let textWidth = (0, import_lodash19.max)(texts.map((text2) => ctx.measureText(text2).width));
|
|
4409
4418
|
let scale3 = 1;
|
|
4410
4419
|
while (scale3 > 0 && textWidth + 2 * margin > SIZE) {
|
|
4411
4420
|
scale3 -= scaleStep;
|
|
4412
4421
|
ctx.font = `${fontWeight} ${scale3 * fontSize}px "${fontFamily}", Arial`;
|
|
4413
|
-
textWidth = (0,
|
|
4422
|
+
textWidth = (0, import_lodash19.max)(texts.map((text2) => ctx.measureText(text2).width));
|
|
4414
4423
|
}
|
|
4415
4424
|
const center8 = { x: 0.5 * SIZE, y: 0.5 * SIZE };
|
|
4416
4425
|
if (scale3 > scaleMin) {
|
|
@@ -4478,7 +4487,7 @@ var GroundLabel = class extends import_maptalks6.BaseObject {
|
|
|
4478
4487
|
strokeStyle,
|
|
4479
4488
|
lineWidth
|
|
4480
4489
|
});
|
|
4481
|
-
const rectAngles = (0,
|
|
4490
|
+
const rectAngles = (0, import_lodash19.isArray)(angle) ? angle : [angle];
|
|
4482
4491
|
material.needsUpdate = true;
|
|
4483
4492
|
const rect = (0, import_d3plus_shape.largestRect)(bound, {
|
|
4484
4493
|
cache: true,
|
|
@@ -4551,32 +4560,32 @@ var GroundLabel = class extends import_maptalks6.BaseObject {
|
|
|
4551
4560
|
return { x: this.#offsetX, y: this.#offsetY };
|
|
4552
4561
|
}
|
|
4553
4562
|
set offsetX(value) {
|
|
4554
|
-
if ((0,
|
|
4563
|
+
if ((0, import_lodash19.isNumber)(value)) {
|
|
4555
4564
|
this.#offsetX = value;
|
|
4556
4565
|
this.#updatePosition();
|
|
4557
4566
|
}
|
|
4558
4567
|
}
|
|
4559
4568
|
set offsetY(value) {
|
|
4560
|
-
if ((0,
|
|
4569
|
+
if ((0, import_lodash19.isNumber)(value)) {
|
|
4561
4570
|
this.#offsetY = value;
|
|
4562
4571
|
this.#updatePosition();
|
|
4563
4572
|
}
|
|
4564
4573
|
}
|
|
4565
4574
|
set angle(newAngle) {
|
|
4566
|
-
if ((0,
|
|
4575
|
+
if ((0, import_lodash19.isNumber)(newAngle)) {
|
|
4567
4576
|
this.#angle = newAngle;
|
|
4568
4577
|
this.getObject3d().rotation.z = Math.PI / 180 * this.#angle;
|
|
4569
4578
|
}
|
|
4570
4579
|
}
|
|
4571
4580
|
setOffset(offsetX, offsetY) {
|
|
4572
|
-
if ((0,
|
|
4581
|
+
if ((0, import_lodash19.isNumber)(offsetX) && (0, import_lodash19.isNumber)(offsetY)) {
|
|
4573
4582
|
this.#offsetX = offsetX;
|
|
4574
4583
|
this.#offsetY = offsetY;
|
|
4575
4584
|
this.#updatePosition();
|
|
4576
4585
|
}
|
|
4577
4586
|
}
|
|
4578
4587
|
addOffset(deltaX, deltaY) {
|
|
4579
|
-
if ((0,
|
|
4588
|
+
if ((0, import_lodash19.isNumber)(deltaX) && (0, import_lodash19.isNumber)(deltaY)) {
|
|
4580
4589
|
this.#offsetX += deltaX;
|
|
4581
4590
|
this.#offsetY += deltaY;
|
|
4582
4591
|
this.#updatePosition();
|
|
@@ -5158,7 +5167,7 @@ var THREE3 = __toESM(require("three"));
|
|
|
5158
5167
|
var import_maptalks8 = require("maptalks");
|
|
5159
5168
|
var THREE2 = __toESM(require("three"));
|
|
5160
5169
|
var import_maptalks9 = require("maptalks.three");
|
|
5161
|
-
var
|
|
5170
|
+
var import_lodash20 = require("lodash");
|
|
5162
5171
|
|
|
5163
5172
|
// src/IndoorMap/renderer/utils/interpolateStops.ts
|
|
5164
5173
|
var interpolateStops = ({ stops }, zoom) => {
|
|
@@ -5253,7 +5262,7 @@ var TextSpriteMarker = class extends import_maptalks9.BaseObject {
|
|
|
5253
5262
|
const paragraphs = String(text).split("\n");
|
|
5254
5263
|
const wrappedLines = [];
|
|
5255
5264
|
paragraphs.forEach((paragraph) => {
|
|
5256
|
-
if ((0,
|
|
5265
|
+
if ((0, import_lodash20.isNil)(maxWidth) || isNaN(maxWidth)) {
|
|
5257
5266
|
wrappedLines.push(paragraph);
|
|
5258
5267
|
return;
|
|
5259
5268
|
}
|
|
@@ -5314,7 +5323,7 @@ var TextSpriteMarker = class extends import_maptalks9.BaseObject {
|
|
|
5314
5323
|
const altitude = (options.altitude || 0) + this.#altitudeOffset;
|
|
5315
5324
|
const z = layer.altitudeToVector3(altitude, altitude).x;
|
|
5316
5325
|
const position = layer.coordinateToVector3(this._coordinate, z);
|
|
5317
|
-
(0,
|
|
5326
|
+
(0, import_lodash20.set)(this.properties, "default.position", position);
|
|
5318
5327
|
this.getObject3d().position.copy(position);
|
|
5319
5328
|
}
|
|
5320
5329
|
_animation() {
|
|
@@ -5597,7 +5606,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5597
5606
|
if (this.#isClicked) return;
|
|
5598
5607
|
this.#isClicked = true;
|
|
5599
5608
|
const onClickElement = this.#onClickElement;
|
|
5600
|
-
if (!(0,
|
|
5609
|
+
if (!(0, import_lodash21.isFunction)(onClickElement)) return;
|
|
5601
5610
|
this.#onClickElement(e);
|
|
5602
5611
|
this.#isClicked = false;
|
|
5603
5612
|
};
|
|
@@ -5650,7 +5659,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5650
5659
|
});
|
|
5651
5660
|
units.filter((u) => u.properties.category === "room").forEach((unit) => {
|
|
5652
5661
|
const openingRelationships = relationships.filter((r) => r.properties.origin?.id === unit.id || r.properties.destination?.id === unit.id);
|
|
5653
|
-
const roomOpenings = (0,
|
|
5662
|
+
const roomOpenings = (0, import_lodash21.compact)(openingRelationships.map((rel) => {
|
|
5654
5663
|
const openingId = rel?.properties.intermediary[0].id;
|
|
5655
5664
|
return openings.find((o) => o.id === openingId);
|
|
5656
5665
|
}));
|
|
@@ -5732,7 +5741,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5732
5741
|
this.markerRenderer.showMarkers(markers, ordinal - baseOrdinal);
|
|
5733
5742
|
}
|
|
5734
5743
|
} else {
|
|
5735
|
-
const baseOrdinal = Array.isArray(targetOrdinal) ? (0,
|
|
5744
|
+
const baseOrdinal = Array.isArray(targetOrdinal) ? (0, import_lodash21.min)(targetOrdinal) : targetOrdinal;
|
|
5736
5745
|
for (const [ordinal, elements] of this.elementsByOrdinal) {
|
|
5737
5746
|
const inOrdinal = Array.isArray(targetOrdinal) ? targetOrdinal.includes(ordinal) : ordinal === targetOrdinal;
|
|
5738
5747
|
if (inOrdinal) {
|
|
@@ -5759,7 +5768,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5759
5768
|
const elements = elemIds.map((id) => this.elementsMap.get(id)).flat();
|
|
5760
5769
|
elements.forEach((element) => {
|
|
5761
5770
|
const controller = this.elementRenderer.createHighlightController(element);
|
|
5762
|
-
if (controller && (0,
|
|
5771
|
+
if (controller && (0, import_lodash21.isFunction)(controller.start)) {
|
|
5763
5772
|
controller.start();
|
|
5764
5773
|
this.highlightControllers.push(controller);
|
|
5765
5774
|
}
|
|
@@ -5767,7 +5776,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5767
5776
|
};
|
|
5768
5777
|
clearHighlightElements = () => {
|
|
5769
5778
|
this.highlightControllers.forEach((controller) => {
|
|
5770
|
-
if ((0,
|
|
5779
|
+
if ((0, import_lodash21.isFunction)(controller?.clear)) controller.clear();
|
|
5771
5780
|
});
|
|
5772
5781
|
};
|
|
5773
5782
|
/**
|
|
@@ -5882,7 +5891,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
5882
5891
|
};
|
|
5883
5892
|
constructor(elementId, options) {
|
|
5884
5893
|
super();
|
|
5885
|
-
const combinedOptions =
|
|
5894
|
+
const combinedOptions = import_lodash22.default.merge({}, defaultOptions, options);
|
|
5886
5895
|
this.options = combinedOptions;
|
|
5887
5896
|
const {
|
|
5888
5897
|
onMapReady,
|
|
@@ -5929,7 +5938,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
5929
5938
|
this.dataClient = options.dataClient;
|
|
5930
5939
|
}
|
|
5931
5940
|
setOptions(options) {
|
|
5932
|
-
const combinedOptions =
|
|
5941
|
+
const combinedOptions = import_lodash22.default.merge({}, defaultOptions, options);
|
|
5933
5942
|
this.options = combinedOptions;
|
|
5934
5943
|
const maptalksOptions = parseMaptalksOptions(combinedOptions);
|
|
5935
5944
|
this.map.setOptions(maptalksOptions);
|
|
@@ -5955,7 +5964,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
5955
5964
|
handleMapClick = ({ coordinate }) => {
|
|
5956
5965
|
const { x, y } = coordinate;
|
|
5957
5966
|
console.log(
|
|
5958
|
-
`[Coordinates]: x: ${
|
|
5967
|
+
`[Coordinates]: x: ${import_lodash22.default.round(x, 8)} y: ${import_lodash22.default.round(
|
|
5959
5968
|
y,
|
|
5960
5969
|
8
|
|
5961
5970
|
)}, [Bearing]: ${this.map.getBearing()}, [Pitch]: ${this.map.getPitch()}`
|
|
@@ -6041,7 +6050,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6041
6050
|
if (this.#isClicked) return;
|
|
6042
6051
|
this.#isClicked = true;
|
|
6043
6052
|
const onClickElement = this.#onClickElement;
|
|
6044
|
-
if (!
|
|
6053
|
+
if (!import_lodash22.default.isFunction(onClickElement)) return;
|
|
6045
6054
|
this.#onClickElement(e);
|
|
6046
6055
|
this.#isClicked = false;
|
|
6047
6056
|
};
|
|
@@ -6061,16 +6070,16 @@ var IndoorMap = class extends EventTarget {
|
|
|
6061
6070
|
for (const feature2 of this.#features) {
|
|
6062
6071
|
try {
|
|
6063
6072
|
const { feature_type: featureType, properties, id } = feature2;
|
|
6064
|
-
const layerName =
|
|
6073
|
+
const layerName = import_lodash22.default.get(
|
|
6065
6074
|
LAYER_FEATURE_TYPE_OBJ,
|
|
6066
6075
|
featureType,
|
|
6067
6076
|
featureType
|
|
6068
6077
|
);
|
|
6069
6078
|
const layer = this.map.getLayer(layerName);
|
|
6070
6079
|
let geometry;
|
|
6071
|
-
const category =
|
|
6072
|
-
const extrudeConfig =
|
|
6073
|
-
const textMarkerType =
|
|
6080
|
+
const category = import_lodash22.default.get(feature2, "properties.category");
|
|
6081
|
+
const extrudeConfig = import_lodash22.default.get(this.#mapConfig, "extrude");
|
|
6082
|
+
const textMarkerType = import_lodash22.default.get(
|
|
6074
6083
|
this.#mapConfig,
|
|
6075
6084
|
"text_marker_type",
|
|
6076
6085
|
"ui-marker"
|
|
@@ -6237,15 +6246,15 @@ var IndoorMap = class extends EventTarget {
|
|
|
6237
6246
|
}
|
|
6238
6247
|
}
|
|
6239
6248
|
updateUserLocationSymbolByLocale(locale) {
|
|
6240
|
-
const userLocationGeometry =
|
|
6249
|
+
const userLocationGeometry = import_lodash22.default.get(
|
|
6241
6250
|
this.#elements,
|
|
6242
6251
|
`${USER_LOCATION_ELEMENT_ID}.geometry`
|
|
6243
6252
|
);
|
|
6244
6253
|
if (!userLocationGeometry) return;
|
|
6245
6254
|
const currentSymbol = userLocationGeometry.getSymbol();
|
|
6246
6255
|
const localeSymbolToUpdate = currentSymbol.map((symbol) => {
|
|
6247
|
-
const localeSymbol =
|
|
6248
|
-
if (!
|
|
6256
|
+
const localeSymbol = import_lodash22.default.get(symbol, `${LOCALE_SYMBOL_KEY}.${locale}`) || import_lodash22.default.get(symbol, `${LOCALE_SYMBOL_KEY}.default`);
|
|
6257
|
+
if (!import_lodash22.default.isPlainObject(localeSymbol)) return symbol;
|
|
6249
6258
|
return {
|
|
6250
6259
|
...symbol,
|
|
6251
6260
|
...localeSymbol
|
|
@@ -6319,14 +6328,14 @@ var IndoorMap = class extends EventTarget {
|
|
|
6319
6328
|
* END of User Location
|
|
6320
6329
|
****************************/
|
|
6321
6330
|
showGeometryByElementId = (elementId) => {
|
|
6322
|
-
const geometry =
|
|
6331
|
+
const geometry = import_lodash22.default.get(
|
|
6323
6332
|
this.#elements,
|
|
6324
6333
|
`${elementId}.geometry`
|
|
6325
6334
|
);
|
|
6326
6335
|
if (geometry) geometry.show();
|
|
6327
6336
|
};
|
|
6328
6337
|
hideGeometryByElementId = (elementId) => {
|
|
6329
|
-
const geometry =
|
|
6338
|
+
const geometry = import_lodash22.default.get(this.#elements, `${elementId}.geometry`);
|
|
6330
6339
|
if (geometry) geometry.hide();
|
|
6331
6340
|
};
|
|
6332
6341
|
setSpriteMarkersOpacity = (opacity = 1) => {
|
|
@@ -6373,13 +6382,13 @@ var IndoorMap = class extends EventTarget {
|
|
|
6373
6382
|
const line = lineStrings[i];
|
|
6374
6383
|
const coords = line.geometry.coordinates;
|
|
6375
6384
|
const prevLine = lineStrings[i - 1];
|
|
6376
|
-
const firstCoord =
|
|
6385
|
+
const firstCoord = import_lodash22.default.first(coords);
|
|
6377
6386
|
const isFirstLine = i === 0;
|
|
6378
6387
|
if (isFirstLine) {
|
|
6379
6388
|
accLine.push(...coords);
|
|
6380
6389
|
continue;
|
|
6381
6390
|
}
|
|
6382
|
-
const prevLastCoord =
|
|
6391
|
+
const prevLastCoord = import_lodash22.default.last(prevLine.geometry.coordinates);
|
|
6383
6392
|
const isNearby = (0, import_distance6.default)(point(firstCoord), point(prevLastCoord)) < distance5;
|
|
6384
6393
|
if (!isNearby) {
|
|
6385
6394
|
const remainingLines = lineStrings.slice(i);
|
|
@@ -6400,8 +6409,8 @@ var IndoorMap = class extends EventTarget {
|
|
|
6400
6409
|
create3DStepPath
|
|
6401
6410
|
} = this.#styler;
|
|
6402
6411
|
const routeMarkerLayer = this.map.getLayer(HIGHLIGHT_LAYER_NAME);
|
|
6403
|
-
const linesByOrdinal = (0,
|
|
6404
|
-
const joinedLines = (0,
|
|
6412
|
+
const linesByOrdinal = (0, import_lodash22.default)(stepGeometries).filter(({ geometry }) => geometry.type === "LineString").groupBy("properties.ordinal").value();
|
|
6413
|
+
const joinedLines = (0, import_lodash22.default)(linesByOrdinal).reduce((acc, lines, key) => {
|
|
6405
6414
|
const joined = this.combineNearbyLineStrings(lines, {
|
|
6406
6415
|
properties: { ordinal: +key }
|
|
6407
6416
|
});
|
|
@@ -6429,14 +6438,14 @@ var IndoorMap = class extends EventTarget {
|
|
|
6429
6438
|
stepElement = createOriginMarker(stepGeometry).addTo(routeMarkerLayer);
|
|
6430
6439
|
break;
|
|
6431
6440
|
case "destination-marker":
|
|
6432
|
-
const extrudeConfig =
|
|
6441
|
+
const extrudeConfig = import_lodash22.default.get(this.#mapConfig, "extrude");
|
|
6433
6442
|
if (destinationFeature.feature_type === "occupant") {
|
|
6434
|
-
const stepId =
|
|
6443
|
+
const stepId = import_lodash22.default.get(stepGeometry, "id");
|
|
6435
6444
|
const normalizedDestinationFeature = {
|
|
6436
6445
|
...destinationFeature,
|
|
6437
6446
|
id: stepId
|
|
6438
6447
|
};
|
|
6439
|
-
const logoUrl =
|
|
6448
|
+
const logoUrl = import_lodash22.default.get(
|
|
6440
6449
|
normalizedDestinationFeature,
|
|
6441
6450
|
"properties.logo.url"
|
|
6442
6451
|
);
|
|
@@ -6481,15 +6490,15 @@ var IndoorMap = class extends EventTarget {
|
|
|
6481
6490
|
const routeMarkerLayer = this.map.getLayer(
|
|
6482
6491
|
HIGHLIGHT_LAYER_NAME
|
|
6483
6492
|
);
|
|
6484
|
-
const originMarkerGeometry =
|
|
6493
|
+
const originMarkerGeometry = import_lodash22.default.get(
|
|
6485
6494
|
this.#elements,
|
|
6486
6495
|
`${ORIGIN_MARKER_ID}.geometry`
|
|
6487
6496
|
);
|
|
6488
|
-
const destinationMarkerGeometry =
|
|
6497
|
+
const destinationMarkerGeometry = import_lodash22.default.get(
|
|
6489
6498
|
this.#elements,
|
|
6490
6499
|
`${DESTINATION_MARKER_ID}.geometry`
|
|
6491
6500
|
);
|
|
6492
|
-
const geometriesToRemove =
|
|
6501
|
+
const geometriesToRemove = import_lodash22.default.compact([
|
|
6493
6502
|
originMarkerGeometry,
|
|
6494
6503
|
destinationMarkerGeometry
|
|
6495
6504
|
]);
|
|
@@ -6500,7 +6509,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6500
6509
|
(obj) => !(obj instanceof NavigationPath)
|
|
6501
6510
|
);
|
|
6502
6511
|
const objects = this.#navigationGeometries || {};
|
|
6503
|
-
|
|
6512
|
+
import_lodash22.default.forEach(objects, (obj) => {
|
|
6504
6513
|
if (!obj) return;
|
|
6505
6514
|
this.#navigationGeometries[obj.properties.id] = null;
|
|
6506
6515
|
obj.remove();
|
|
@@ -6537,7 +6546,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6537
6546
|
}
|
|
6538
6547
|
if (this.threeLayer) {
|
|
6539
6548
|
const currentView = this.camera.getView();
|
|
6540
|
-
const objectOpacity =
|
|
6549
|
+
const objectOpacity = import_lodash22.default.clamp(38 - 2 * currentView.zoom, 0, 1);
|
|
6541
6550
|
this.#objects.forEach((object) => {
|
|
6542
6551
|
object.getObject3d().traverse((child) => {
|
|
6543
6552
|
if (child.isMesh) child.material.opacity = objectOpacity;
|
|
@@ -6547,7 +6556,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6547
6556
|
});
|
|
6548
6557
|
if (this.#billboardObjects) {
|
|
6549
6558
|
this.#billboardObjects.forEach((object) => {
|
|
6550
|
-
const objectScale =
|
|
6559
|
+
const objectScale = import_lodash22.default.clamp(
|
|
6551
6560
|
20 - 1 * currentView.zoom,
|
|
6552
6561
|
1,
|
|
6553
6562
|
1.05
|
|
@@ -6556,7 +6565,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6556
6565
|
});
|
|
6557
6566
|
}
|
|
6558
6567
|
if (this.#isLayersFadingOnZoom) {
|
|
6559
|
-
const layerOpacity =
|
|
6568
|
+
const layerOpacity = import_lodash22.default.clamp(1 - objectOpacity, 0, 1);
|
|
6560
6569
|
LAYERS.forEach((layerKey) => {
|
|
6561
6570
|
const layer = this.map.getLayer(layerKey);
|
|
6562
6571
|
if (layer) layer.setOpacity(layerOpacity);
|