venue-js 1.4.0-next.20 → 1.4.0-next.22
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.d.mts +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +38 -32
- package/dist/data/index.js.map +1 -1
- package/dist/data/index.mjs +32 -26
- package/dist/data/index.mjs.map +1 -1
- package/dist/{index-X4qpYAhF.d.mts → index-CrxL_5B7.d.mts} +2 -2
- package/dist/{index-X4qpYAhF.d.ts → index-CrxL_5B7.d.ts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +193 -187
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -832,7 +832,7 @@ var getSearchClient = ({ occupants, amenities }) => {
|
|
|
832
832
|
var import_boolean_point_in_polygon4 = require("@turf/boolean-point-in-polygon");
|
|
833
833
|
|
|
834
834
|
// src/data/navigate/graph/prepare.ts
|
|
835
|
-
var
|
|
835
|
+
var import_lodash11 = __toESM(require("lodash"));
|
|
836
836
|
var import_node_dijkstra = __toESM(require("node-dijkstra"));
|
|
837
837
|
var import_distance3 = require("@turf/distance");
|
|
838
838
|
var import_center5 = require("@turf/center");
|
|
@@ -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);
|
|
@@ -1129,17 +1131,19 @@ var createPOINodeMap = (features, getFeatureUnit, unitOpenings) => {
|
|
|
1129
1131
|
features.forEach((feat) => {
|
|
1130
1132
|
try {
|
|
1131
1133
|
const locatedOnUnitId = getFeatureUnit(feat);
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1134
|
+
if (locatedOnUnitId) {
|
|
1135
|
+
const openings = unitOpenings[locatedOnUnitId] ?? [];
|
|
1136
|
+
const center8 = (0, import_center4.center)(feat);
|
|
1137
|
+
for (const opening of openings) {
|
|
1138
|
+
try {
|
|
1139
|
+
const openingCenter = (0, import_center4.center)(opening);
|
|
1140
|
+
const dis = (0, import_distance2.distance)(center8, openingCenter, { units: "meters" }) + BASE_POI_BASEDISTANCE;
|
|
1141
|
+
import_lodash9.default.set(nodeMap, `${opening.id}.${feat.id}`, dis);
|
|
1142
|
+
import_lodash9.default.set(nodeMap, `${feat.id}.${opening.id}`, dis);
|
|
1143
|
+
counter++;
|
|
1144
|
+
} catch (err) {
|
|
1145
|
+
console.log(err, opening);
|
|
1146
|
+
}
|
|
1143
1147
|
}
|
|
1144
1148
|
}
|
|
1145
1149
|
} catch (err) {
|
|
@@ -1186,13 +1190,13 @@ var createUnitOpenings = (relationships, units, openings) => {
|
|
|
1186
1190
|
});
|
|
1187
1191
|
units.forEach((unit) => {
|
|
1188
1192
|
const unitId = unit.id;
|
|
1189
|
-
const
|
|
1190
|
-
const relationshipIntermediaryTypeAndId =
|
|
1191
|
-
(relationship) => relationship.properties.intermediary[0]
|
|
1193
|
+
const connectedRelationship = relationshipMap.get(unitId) || [];
|
|
1194
|
+
const relationshipIntermediaryTypeAndId = compact(connectedRelationship.map(
|
|
1195
|
+
(relationship) => relationship.properties.intermediary?.[0]
|
|
1192
1196
|
// Assuming intermediary is always an array
|
|
1193
|
-
);
|
|
1197
|
+
));
|
|
1194
1198
|
const relationshipIntermediary = relationshipIntermediaryTypeAndId.map(({ id }) => {
|
|
1195
|
-
return openings.find((opening) => opening.id === id);
|
|
1199
|
+
return openings.find((opening) => !!opening && opening.id === id);
|
|
1196
1200
|
});
|
|
1197
1201
|
openingConnections[unitId] = (0, import_uniqBy.default)(
|
|
1198
1202
|
[...openingConnections[unitId] || [], ...relationshipIntermediary],
|
|
@@ -1217,8 +1221,7 @@ var prepareGraph = (options) => {
|
|
|
1217
1221
|
relationships = [],
|
|
1218
1222
|
openings = [],
|
|
1219
1223
|
units = [],
|
|
1220
|
-
kiosks = []
|
|
1221
|
-
levels = []
|
|
1224
|
+
kiosks = []
|
|
1222
1225
|
}
|
|
1223
1226
|
} = options;
|
|
1224
1227
|
const {
|
|
@@ -1227,7 +1230,7 @@ var prepareGraph = (options) => {
|
|
|
1227
1230
|
ramp: rampRelationships = [],
|
|
1228
1231
|
elevator: elevatorRelationships = [],
|
|
1229
1232
|
stairs: stairsRelationships = []
|
|
1230
|
-
} =
|
|
1233
|
+
} = import_lodash11.default.groupBy(relationships, "properties.category");
|
|
1231
1234
|
const unitOpenings = createUnitOpenings(traversalRelationships, units, openings);
|
|
1232
1235
|
const traversalNodeMap = createTraversalNodeMap(unitOpenings, options);
|
|
1233
1236
|
const escalatorNodeMap = createEscalatorNodeMap(escalatorRelationships, options);
|
|
@@ -1242,7 +1245,7 @@ var prepareGraph = (options) => {
|
|
|
1242
1245
|
unitOpenings,
|
|
1243
1246
|
options
|
|
1244
1247
|
);
|
|
1245
|
-
const amenityNodeMap = createPOINodeMap(amenities, (amenity) => amenity.properties.unit_ids[0], unitOpenings);
|
|
1248
|
+
const amenityNodeMap = createPOINodeMap(amenities, (amenity) => amenity.properties.unit_ids?.[0] || null, unitOpenings);
|
|
1246
1249
|
const anchorsNodeMap = createPOINodeMap(anchors, (anchor) => anchor.properties.unit_id, unitOpenings);
|
|
1247
1250
|
const walkwayUnits = units.filter((unit) => unit.properties.category === "walkway");
|
|
1248
1251
|
const kioskNodeMap = createPOINodeMap(kiosks, (kiosk) => findContainingUnit(kiosk, walkwayUnits)?.id, unitOpenings);
|
|
@@ -1286,7 +1289,7 @@ var prepareGraph = (options) => {
|
|
|
1286
1289
|
};
|
|
1287
1290
|
|
|
1288
1291
|
// src/data/navigate/steps/createStepUtils.ts
|
|
1289
|
-
var
|
|
1292
|
+
var import_lodash13 = require("lodash");
|
|
1290
1293
|
var import_intersectionBy = __toESM(require("lodash/intersectionBy"));
|
|
1291
1294
|
|
|
1292
1295
|
// src/data/navigate/description/describe.ts
|
|
@@ -1310,7 +1313,7 @@ var describeHorizontalStep = (intermediary, toward, landmark) => {
|
|
|
1310
1313
|
};
|
|
1311
1314
|
|
|
1312
1315
|
// src/data/navigate/steps/path/index.ts
|
|
1313
|
-
var
|
|
1316
|
+
var import_lodash12 = __toESM(require("lodash"));
|
|
1314
1317
|
|
|
1315
1318
|
// src/data/navigate/constants.ts
|
|
1316
1319
|
var OBSTACLE_FEATURE_TYPES = [
|
|
@@ -1960,7 +1963,7 @@ var createStepPathUtils = (options) => {
|
|
|
1960
1963
|
const exceptionFeatureIds = [];
|
|
1961
1964
|
const obstacles = findObstaclesFromWalkway(
|
|
1962
1965
|
relatedWalkablePlatform,
|
|
1963
|
-
|
|
1966
|
+
import_lodash12.default.compact(exceptionFeatureIds)
|
|
1964
1967
|
);
|
|
1965
1968
|
const line = findPathOnArea(from, to, {
|
|
1966
1969
|
resolution,
|
|
@@ -2040,7 +2043,7 @@ var createStepUtils = (options) => {
|
|
|
2040
2043
|
return intermediaryTypeAndId.map(({ id }) => findByIdSync(id));
|
|
2041
2044
|
};
|
|
2042
2045
|
const formatCategoryLabel = (category) => {
|
|
2043
|
-
return (0,
|
|
2046
|
+
return (0, import_lodash13.capitalize)(category);
|
|
2044
2047
|
};
|
|
2045
2048
|
const getNextStepIntermediary = (from, to, intermediary) => {
|
|
2046
2049
|
if (to.type === "end") return to.name;
|
|
@@ -2299,7 +2302,9 @@ var createLandmarkUtils = (options) => {
|
|
|
2299
2302
|
const locationType = occupant.properties.unit_id ? "unit" : "kiosk";
|
|
2300
2303
|
const locationId = locationType === "unit" ? occupant.properties.unit_id : occupant.properties.kiosk_id;
|
|
2301
2304
|
const location = locationType === "unit" ? findByIdSync(locationId) : findByIdSync(locationId);
|
|
2302
|
-
|
|
2305
|
+
if (!location) return null;
|
|
2306
|
+
const level = location.properties.level_id ? findByIdSync(location.properties.level_id) : null;
|
|
2307
|
+
if (!level) return null;
|
|
2303
2308
|
return {
|
|
2304
2309
|
name: occupant.properties.name,
|
|
2305
2310
|
point: (0, import_center8.center)(location.geometry).geometry.coordinates,
|
|
@@ -2309,7 +2314,7 @@ var createLandmarkUtils = (options) => {
|
|
|
2309
2314
|
};
|
|
2310
2315
|
};
|
|
2311
2316
|
const landmarks = [
|
|
2312
|
-
...occupants.map(occupantToLandmark)
|
|
2317
|
+
...compact(occupants.map(occupantToLandmark))
|
|
2313
2318
|
];
|
|
2314
2319
|
const findNearbyLandmarks = (point2, levelId) => {
|
|
2315
2320
|
if (point2 === null || levelId === null) return [];
|
|
@@ -2399,6 +2404,7 @@ var getNavigateClient = (options) => {
|
|
|
2399
2404
|
trace("nav", "\u2713 findRoute", 0);
|
|
2400
2405
|
const t02 = performance.now();
|
|
2401
2406
|
const path = graph.path(routeOriginParam, routeDestinationParam);
|
|
2407
|
+
if (path === null) return { steps: [], distance: 0, duration: 0 };
|
|
2402
2408
|
const t12 = performance.now();
|
|
2403
2409
|
trace("nav", " \u251C\u2500 path (dijkstra)", t12 - t02);
|
|
2404
2410
|
const waypoints = waypointUtils.toWaypoints(path);
|
|
@@ -2592,7 +2598,7 @@ var getDataClient = (options) => {
|
|
|
2592
2598
|
var import_maptalks_gl = require("maptalks-gl");
|
|
2593
2599
|
var import_transcoders = require("@maptalks/transcoders.draco");
|
|
2594
2600
|
var import_tween = __toESM(require("@tweenjs/tween.js"));
|
|
2595
|
-
var
|
|
2601
|
+
var import_lodash22 = __toESM(require("lodash"));
|
|
2596
2602
|
var import_distance6 = __toESM(require("@turf/distance"));
|
|
2597
2603
|
var import_center13 = __toESM(require("@turf/center"));
|
|
2598
2604
|
var import_three6 = require("three");
|
|
@@ -2673,7 +2679,7 @@ var VENUE_EVENTS = {
|
|
|
2673
2679
|
};
|
|
2674
2680
|
|
|
2675
2681
|
// src/IndoorMap/utils/createElements.js
|
|
2676
|
-
var
|
|
2682
|
+
var import_lodash18 = __toESM(require("lodash"));
|
|
2677
2683
|
var import_maptalks4 = require("maptalks");
|
|
2678
2684
|
var import_center11 = __toESM(require("@turf/center"));
|
|
2679
2685
|
var import_buffer = __toESM(require("@turf/buffer"));
|
|
@@ -2683,7 +2689,7 @@ var import_three4 = require("three");
|
|
|
2683
2689
|
var maptalks = __toESM(require("maptalks"));
|
|
2684
2690
|
var import_maptalks = require("maptalks.three");
|
|
2685
2691
|
var import_three = require("three");
|
|
2686
|
-
var
|
|
2692
|
+
var import_lodash15 = __toESM(require("lodash"));
|
|
2687
2693
|
var OPTIONS = {
|
|
2688
2694
|
altitude: 25,
|
|
2689
2695
|
scale: 15e-5,
|
|
@@ -2716,7 +2722,7 @@ var Billboard = class extends import_maptalks.BaseObject {
|
|
|
2716
2722
|
} = options;
|
|
2717
2723
|
this.properties = { ...properties };
|
|
2718
2724
|
this._createGroup();
|
|
2719
|
-
const divider =
|
|
2725
|
+
const divider = import_lodash15.default.clamp(window.innerWidth / 375 / 1.75, 1, 1.7);
|
|
2720
2726
|
if (showLeg) {
|
|
2721
2727
|
const lineMaterial = new import_three.LineBasicMaterial({
|
|
2722
2728
|
color: legColor,
|
|
@@ -2751,9 +2757,9 @@ var Billboard = class extends import_maptalks.BaseObject {
|
|
|
2751
2757
|
});
|
|
2752
2758
|
const z = layer.altitudeToVector3(altitude, altitude).x;
|
|
2753
2759
|
const position = layer.coordinateToVector3(coordinate, z);
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2760
|
+
import_lodash15.default.set(this.properties, "default.position", position);
|
|
2761
|
+
import_lodash15.default.set(this.properties, "default.altitude", altitude);
|
|
2762
|
+
import_lodash15.default.set(this.properties, "default.scale", scale3);
|
|
2757
2763
|
this.getObject3d().position.copy(position);
|
|
2758
2764
|
}
|
|
2759
2765
|
setLineHeight(altitude) {
|
|
@@ -2769,7 +2775,7 @@ var Billboard = class extends import_maptalks.BaseObject {
|
|
|
2769
2775
|
// src/IndoorMap/object3d/SpriteMarker.ts
|
|
2770
2776
|
var import_maptalks2 = require("maptalks.three");
|
|
2771
2777
|
var import_three2 = require("three");
|
|
2772
|
-
var
|
|
2778
|
+
var import_lodash16 = __toESM(require("lodash"));
|
|
2773
2779
|
var DEFAULT_SCALE = 0.05;
|
|
2774
2780
|
var DEFAULT_ALTITUDE = 0;
|
|
2775
2781
|
var DEFAULT_ALPHATEST = 0.3;
|
|
@@ -2800,7 +2806,7 @@ var SpriteMarker = class extends import_maptalks2.BaseObject {
|
|
|
2800
2806
|
this.properties = { ...properties };
|
|
2801
2807
|
const modifiedAltitude = altitude + 2;
|
|
2802
2808
|
this.#default = { options: { scale: scale3, altitude: modifiedAltitude }, material };
|
|
2803
|
-
this.#highlight =
|
|
2809
|
+
this.#highlight = import_lodash16.default.merge({}, DEFAULT_OPTIONS.highlight, highlight);
|
|
2804
2810
|
if (material && material instanceof import_three2.SpriteMaterial)
|
|
2805
2811
|
material.alphaTest = alphaTest;
|
|
2806
2812
|
const sprite = new import_three2.Sprite(material);
|
|
@@ -2809,7 +2815,7 @@ var SpriteMarker = class extends import_maptalks2.BaseObject {
|
|
|
2809
2815
|
obj3d.add(sprite);
|
|
2810
2816
|
const z = layer.altitudeToVector3(modifiedAltitude, modifiedAltitude).x;
|
|
2811
2817
|
const position = layer.coordinateToVector3(coordinate, z);
|
|
2812
|
-
|
|
2818
|
+
import_lodash16.default.set(this.properties, "default.position", position);
|
|
2813
2819
|
this.getObject3d().position.copy(position);
|
|
2814
2820
|
}
|
|
2815
2821
|
// Different objects need to implement their own methods
|
|
@@ -2951,14 +2957,14 @@ var NavigationPath = class extends import_maptalks3.BaseObject {
|
|
|
2951
2957
|
|
|
2952
2958
|
// src/IndoorMap/utils/geometry.ts
|
|
2953
2959
|
var import_center10 = __toESM(require("@turf/center"));
|
|
2954
|
-
var
|
|
2960
|
+
var import_lodash17 = __toESM(require("lodash"));
|
|
2955
2961
|
var import_line_offset = __toESM(require("@turf/line-offset"));
|
|
2956
2962
|
var getCenterFromGeometry = (geometry) => {
|
|
2957
2963
|
try {
|
|
2958
2964
|
const { type = null, coordinates = null } = geometry;
|
|
2959
2965
|
if (!type || !coordinates) return null;
|
|
2960
2966
|
const centerPoint = (0, import_center10.default)(geometry);
|
|
2961
|
-
return
|
|
2967
|
+
return import_lodash17.default.get(centerPoint, "geometry.coordinates");
|
|
2962
2968
|
} catch (error) {
|
|
2963
2969
|
return null;
|
|
2964
2970
|
}
|
|
@@ -3109,7 +3115,7 @@ var createWaterFixture = (feature2, style, options = {}) => {
|
|
|
3109
3115
|
const { geometry, properties } = feature2;
|
|
3110
3116
|
const { allowOverride, inheritFillColorToLine, zIndex } = options;
|
|
3111
3117
|
const symbolStyle = { ...style };
|
|
3112
|
-
if (allowOverride)
|
|
3118
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3113
3119
|
if (inheritFillColorToLine) symbolStyle.lineColor = symbolStyle.polygonFill;
|
|
3114
3120
|
return new GeometryType[geometry.type](geometry.coordinates, {
|
|
3115
3121
|
properties: {
|
|
@@ -3125,7 +3131,7 @@ var createVegetationFixture = (feature2, style, options = {}) => {
|
|
|
3125
3131
|
const { geometry, properties } = feature2;
|
|
3126
3132
|
const { allowOverride, inheritFillColorToLine, zIndex } = options;
|
|
3127
3133
|
const symbolStyle = { ...style };
|
|
3128
|
-
if (allowOverride)
|
|
3134
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3129
3135
|
if (inheritFillColorToLine) symbolStyle.lineColor = symbolStyle.polygonFill;
|
|
3130
3136
|
return new GeometryType[geometry.type](geometry.coordinates, {
|
|
3131
3137
|
properties: {
|
|
@@ -3142,8 +3148,8 @@ var createObstructionalFixture = (feature2, style = {}, options = {}) => {
|
|
|
3142
3148
|
const { model3d } = properties;
|
|
3143
3149
|
const { allowOverride, inheritFillColorToLine, zIndex } = options;
|
|
3144
3150
|
const symbolStyle = { ...style };
|
|
3145
|
-
if (!
|
|
3146
|
-
if (allowOverride)
|
|
3151
|
+
if (!import_lodash18.default.isEmpty(model3d)) return;
|
|
3152
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3147
3153
|
if (inheritFillColorToLine) symbolStyle.lineColor = symbolStyle.polygonFill;
|
|
3148
3154
|
if (geometry.type === "LineString") {
|
|
3149
3155
|
const polygon2 = createPolygonFromLineString(geometry);
|
|
@@ -3213,7 +3219,7 @@ var createPrincipalOpening = (feature2, style, options = {}) => {
|
|
|
3213
3219
|
const { geometry, properties } = feature2;
|
|
3214
3220
|
const { allowOverride, zIndex } = options;
|
|
3215
3221
|
const symbolStyle = { ...style };
|
|
3216
|
-
if (allowOverride)
|
|
3222
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3217
3223
|
try {
|
|
3218
3224
|
return new import_maptalks4.LineString(geometry.coordinates, {
|
|
3219
3225
|
properties: {
|
|
@@ -3230,7 +3236,7 @@ var createEmergencyExitOpening = (feature2, style, options = {}) => {
|
|
|
3230
3236
|
const { geometry, properties } = feature2;
|
|
3231
3237
|
const { allowOverride, zIndex } = options;
|
|
3232
3238
|
const symbolStyle = { ...style };
|
|
3233
|
-
if (allowOverride)
|
|
3239
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3234
3240
|
try {
|
|
3235
3241
|
return new import_maptalks4.LineString(geometry.coordinates, {
|
|
3236
3242
|
properties: {
|
|
@@ -3247,7 +3253,7 @@ var createPedestrianOpening = (feature2, style, options = {}) => {
|
|
|
3247
3253
|
const { geometry, properties, id } = feature2;
|
|
3248
3254
|
const { allowOverride, zIndex } = options;
|
|
3249
3255
|
const symbolStyle = { ...style };
|
|
3250
|
-
if (allowOverride)
|
|
3256
|
+
if (allowOverride) import_lodash18.default.merge(symbolStyle, properties.style);
|
|
3251
3257
|
try {
|
|
3252
3258
|
return new import_maptalks4.LineString(geometry.coordinates, {
|
|
3253
3259
|
properties: {
|
|
@@ -3285,9 +3291,9 @@ var create3DMarker = (coordinates, options, material, threeLayer, markerProperti
|
|
|
3285
3291
|
};
|
|
3286
3292
|
var getExtrudeConfigByFeature = (baseExtrudeConfig, feature2 = {}) => {
|
|
3287
3293
|
const { feature_type: featureType } = feature2;
|
|
3288
|
-
const featureExtrudeConfig =
|
|
3289
|
-
const featureCategory =
|
|
3290
|
-
const baseFeatureExtrudeConfig =
|
|
3294
|
+
const featureExtrudeConfig = import_lodash18.default.get(feature2, "properties.extrude");
|
|
3295
|
+
const featureCategory = import_lodash18.default.get(feature2, "properties.category");
|
|
3296
|
+
const baseFeatureExtrudeConfig = import_lodash18.default.get(
|
|
3291
3297
|
baseExtrudeConfig,
|
|
3292
3298
|
`${featureType}.${featureCategory || featureType}`
|
|
3293
3299
|
);
|
|
@@ -3345,50 +3351,50 @@ var createStyledUIMarkerElement = ({
|
|
|
3345
3351
|
var styledFeatureGenerator = (mapTheme) => {
|
|
3346
3352
|
const getElementSymbol = (key) => {
|
|
3347
3353
|
const [featureType] = key.split(".");
|
|
3348
|
-
const featureTypeTheme =
|
|
3354
|
+
const featureTypeTheme = import_lodash18.default.get(mapTheme, `${featureType}.geometry.symbol`);
|
|
3349
3355
|
if (featureType === key) return featureTypeTheme;
|
|
3350
|
-
const categoryTheme =
|
|
3351
|
-
return
|
|
3356
|
+
const categoryTheme = import_lodash18.default.get(mapTheme, `${key}.geometry.symbol`);
|
|
3357
|
+
return import_lodash18.default.merge({}, featureTypeTheme, categoryTheme);
|
|
3352
3358
|
};
|
|
3353
3359
|
const getLabelSymbol = (key) => {
|
|
3354
3360
|
const [featureType] = key.split(".");
|
|
3355
|
-
const featureTypeTheme =
|
|
3356
|
-
const categoryTheme =
|
|
3357
|
-
const mergedSymbol =
|
|
3358
|
-
let symbols =
|
|
3361
|
+
const featureTypeTheme = import_lodash18.default.get(mapTheme, `${featureType}.label`);
|
|
3362
|
+
const categoryTheme = import_lodash18.default.get(mapTheme, `${key}.label`);
|
|
3363
|
+
const mergedSymbol = import_lodash18.default.merge({}, featureTypeTheme, categoryTheme);
|
|
3364
|
+
let symbols = import_lodash18.default.values(import_lodash18.default.map(mergedSymbol, "symbol"));
|
|
3359
3365
|
const markerIndexToMove = symbols.findIndex(
|
|
3360
3366
|
({ elementType }) => elementType === "label.marker"
|
|
3361
3367
|
);
|
|
3362
3368
|
if (markerIndexToMove >= 0) {
|
|
3363
|
-
const markerSymbolToMove =
|
|
3369
|
+
const markerSymbolToMove = import_lodash18.default.pullAt(symbols, markerIndexToMove)[0];
|
|
3364
3370
|
symbols.push(markerSymbolToMove);
|
|
3365
3371
|
}
|
|
3366
3372
|
return symbols;
|
|
3367
3373
|
};
|
|
3368
3374
|
const getUIMarkerSymbol = (key) => {
|
|
3369
3375
|
const [featureType] = key.split(".");
|
|
3370
|
-
const featureTypeTheme =
|
|
3371
|
-
const categoryTheme =
|
|
3372
|
-
const mergedSymbol =
|
|
3373
|
-
const symbol =
|
|
3376
|
+
const featureTypeTheme = import_lodash18.default.get(mapTheme, `${featureType}.ui.marker`);
|
|
3377
|
+
const categoryTheme = import_lodash18.default.get(mapTheme, `${key}.ui.marker`);
|
|
3378
|
+
const mergedSymbol = import_lodash18.default.merge({}, featureTypeTheme, categoryTheme);
|
|
3379
|
+
const symbol = import_lodash18.default.get(mergedSymbol, "symbol");
|
|
3374
3380
|
return symbol;
|
|
3375
3381
|
};
|
|
3376
3382
|
const getUIMarkerOptions = (key) => {
|
|
3377
3383
|
const [featureType] = key.split(".");
|
|
3378
|
-
const featureTypeTheme =
|
|
3379
|
-
const categoryTheme =
|
|
3380
|
-
const mergedSymbol =
|
|
3381
|
-
const options =
|
|
3384
|
+
const featureTypeTheme = import_lodash18.default.get(mapTheme, `${featureType}.ui.marker`);
|
|
3385
|
+
const categoryTheme = import_lodash18.default.get(mapTheme, `${key}.ui.marker`);
|
|
3386
|
+
const mergedSymbol = import_lodash18.default.merge({}, featureTypeTheme, categoryTheme);
|
|
3387
|
+
const options = import_lodash18.default.get(mergedSymbol, "options");
|
|
3382
3388
|
return options;
|
|
3383
3389
|
};
|
|
3384
3390
|
const getLabelOptions = (key) => {
|
|
3385
3391
|
const [featureType] = key.split(".");
|
|
3386
|
-
const featureTypeSymbol =
|
|
3387
|
-
const categorySymbol =
|
|
3388
|
-
const mergedSymbol =
|
|
3389
|
-
return
|
|
3392
|
+
const featureTypeSymbol = import_lodash18.default.get(mapTheme, `${featureType}.label`);
|
|
3393
|
+
const categorySymbol = import_lodash18.default.get(mapTheme, `${key}.label`);
|
|
3394
|
+
const mergedSymbol = import_lodash18.default.merge({}, featureTypeSymbol, categorySymbol);
|
|
3395
|
+
return import_lodash18.default.reduce(
|
|
3390
3396
|
mergedSymbol,
|
|
3391
|
-
(acc, symbol) => ({ ...acc, ...
|
|
3397
|
+
(acc, symbol) => ({ ...acc, ...import_lodash18.default.get(symbol, "options", {}) }),
|
|
3392
3398
|
{}
|
|
3393
3399
|
);
|
|
3394
3400
|
};
|
|
@@ -3403,13 +3409,13 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3403
3409
|
};
|
|
3404
3410
|
const generateSpriteHighlightMarkerOption = () => {
|
|
3405
3411
|
return SPRITE_HIGHLIGHT_MARKER_FEATURE.reduce((acc, featCate) => {
|
|
3406
|
-
const categoryKey =
|
|
3412
|
+
const categoryKey = import_lodash18.default.last(featCate.split("-"));
|
|
3407
3413
|
const defaultLabelSymbol = getLabelSymbol(categoryKey);
|
|
3408
3414
|
const highlightLabelSymbol = getLabelSymbol(featCate);
|
|
3409
3415
|
const [defaultBase, defaultIcon] = defaultLabelSymbol;
|
|
3410
3416
|
const [highlightBase, highlightIcon] = highlightLabelSymbol;
|
|
3411
|
-
const base =
|
|
3412
|
-
const icon =
|
|
3417
|
+
const base = import_lodash18.default.merge({}, defaultBase, highlightBase);
|
|
3418
|
+
const icon = import_lodash18.default.merge({}, defaultIcon, highlightIcon);
|
|
3413
3419
|
const material = createSpriteMaterialByLabelSymbol([base, icon]);
|
|
3414
3420
|
const options = getLabelOptions(featCate);
|
|
3415
3421
|
return { ...acc, [featCate]: { material, options } };
|
|
@@ -3419,22 +3425,22 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3419
3425
|
const spriteHighlightMarkerOptionObj = generateSpriteHighlightMarkerOption();
|
|
3420
3426
|
const getElementOptions = (key) => {
|
|
3421
3427
|
const [featureType] = key.split(".");
|
|
3422
|
-
const featureTypeOptions =
|
|
3428
|
+
const featureTypeOptions = import_lodash18.default.get(
|
|
3423
3429
|
mapTheme,
|
|
3424
3430
|
`${featureType}.geometry.options`
|
|
3425
3431
|
);
|
|
3426
|
-
const categoryOptions =
|
|
3427
|
-
return
|
|
3432
|
+
const categoryOptions = import_lodash18.default.get(mapTheme, `${key}.geometry.options`);
|
|
3433
|
+
return import_lodash18.default.merge({}, featureTypeOptions, categoryOptions);
|
|
3428
3434
|
};
|
|
3429
3435
|
const createOccupantMarker = (feature2, locatedFeature, mapConfig) => {
|
|
3430
3436
|
const { textMarkerType, featureExtrudeConfig } = getFeatureMarkerConfig(
|
|
3431
3437
|
feature2,
|
|
3432
3438
|
mapConfig
|
|
3433
3439
|
);
|
|
3434
|
-
const markerHeight =
|
|
3440
|
+
const markerHeight = import_lodash18.default.get(featureExtrudeConfig, "height", 0);
|
|
3435
3441
|
const { properties, id, feature_type } = feature2;
|
|
3436
3442
|
if (!properties.anchor) return;
|
|
3437
|
-
const mainLocationId =
|
|
3443
|
+
const mainLocationId = import_lodash18.default.get(properties, "unit.id") || import_lodash18.default.get(properties, "kiosk.id");
|
|
3438
3444
|
const isMainLocationFeature = mainLocationId === locatedFeature?.id;
|
|
3439
3445
|
const { geometry: mainLocationGeometry } = properties?.anchor;
|
|
3440
3446
|
const geometry = isMainLocationFeature ? mainLocationGeometry : (0, import_center11.default)(locatedFeature)?.geometry;
|
|
@@ -3444,7 +3450,7 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3444
3450
|
category: properties.category,
|
|
3445
3451
|
altitude: getAltitude(properties)
|
|
3446
3452
|
};
|
|
3447
|
-
const occupantName =
|
|
3453
|
+
const occupantName = import_lodash18.default.isEmpty(properties.short_name) ? properties.name : properties.short_name;
|
|
3448
3454
|
if (locatedFeature) {
|
|
3449
3455
|
const { feature_type: feature_type2, properties: properties2 } = locatedFeature;
|
|
3450
3456
|
const { category } = properties2;
|
|
@@ -3458,21 +3464,21 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3458
3464
|
}
|
|
3459
3465
|
return requestedType;
|
|
3460
3466
|
};
|
|
3461
|
-
const logoUrl =
|
|
3462
|
-
const requestedRenderType =
|
|
3467
|
+
const logoUrl = import_lodash18.default.get(properties, "logo.url");
|
|
3468
|
+
const requestedRenderType = import_lodash18.default.get(properties, "render_type", "Name");
|
|
3463
3469
|
const renderType = getValidatedRenderType(requestedRenderType, logoUrl);
|
|
3464
3470
|
if (renderType === "Label") return null;
|
|
3465
3471
|
const renderPriority = properties.render_priority || 3;
|
|
3466
|
-
const labelSymbol = getLabelSymbol(`occupant-${
|
|
3467
|
-
const markerSymbol =
|
|
3468
|
-
const coordinates =
|
|
3472
|
+
const labelSymbol = getLabelSymbol(`occupant-${import_lodash18.default.toLower(renderType)}`);
|
|
3473
|
+
const markerSymbol = import_lodash18.default.last(labelSymbol);
|
|
3474
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
3469
3475
|
const priorityLabelSymbol = getLabelSymbol(
|
|
3470
|
-
`occupant-${
|
|
3476
|
+
`occupant-${import_lodash18.default.toLower(renderType)}-${renderPriority}`
|
|
3471
3477
|
);
|
|
3472
|
-
const priorityMarkerSymbol =
|
|
3478
|
+
const priorityMarkerSymbol = import_lodash18.default.last(priorityLabelSymbol) || {};
|
|
3473
3479
|
switch (renderType) {
|
|
3474
3480
|
case "Logo":
|
|
3475
|
-
|
|
3481
|
+
import_lodash18.default.set(priorityMarkerSymbol, "markerFile", logoUrl);
|
|
3476
3482
|
return new import_maptalks4.Marker(coordinates, {
|
|
3477
3483
|
properties: {
|
|
3478
3484
|
altitude: getAltitude(properties) + markerHeight,
|
|
@@ -3533,13 +3539,13 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3533
3539
|
});
|
|
3534
3540
|
}
|
|
3535
3541
|
const uiMarkerSymbol = getUIMarkerSymbol(
|
|
3536
|
-
`occupant-${
|
|
3542
|
+
`occupant-${import_lodash18.default.toLower(renderType)}`
|
|
3537
3543
|
);
|
|
3538
3544
|
const uiMarkerPrioritySymbol = getUIMarkerSymbol(
|
|
3539
|
-
`occupant-${
|
|
3545
|
+
`occupant-${import_lodash18.default.toLower(renderType)}-${renderPriority}`
|
|
3540
3546
|
);
|
|
3541
3547
|
const uiMarkerPriorityOptions = getUIMarkerOptions(
|
|
3542
|
-
`occupant-${
|
|
3548
|
+
`occupant-${import_lodash18.default.toLower(renderType)}-${renderPriority}`
|
|
3543
3549
|
);
|
|
3544
3550
|
const style = { ...uiMarkerSymbol, ...uiMarkerPrioritySymbol };
|
|
3545
3551
|
return new import_maptalks4.ui.UIMarker(coordinates, {
|
|
@@ -3561,7 +3567,7 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3561
3567
|
const { category, ordinal, style = {} } = properties;
|
|
3562
3568
|
const elementStyle = getElementSymbol(`${feature_type}.${category}`);
|
|
3563
3569
|
const { allowOverride } = getElementOptions(`${feature_type}.${category}`);
|
|
3564
|
-
if (allowOverride)
|
|
3570
|
+
if (allowOverride) import_lodash18.default.merge(elementStyle, style);
|
|
3565
3571
|
const { polygonFill: color } = elementStyle;
|
|
3566
3572
|
const featureProperty = {
|
|
3567
3573
|
id,
|
|
@@ -3650,9 +3656,9 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3650
3656
|
feature2,
|
|
3651
3657
|
mapConfig
|
|
3652
3658
|
);
|
|
3653
|
-
const markerHeight =
|
|
3659
|
+
const markerHeight = import_lodash18.default.get(featureExtrudeConfig, "height");
|
|
3654
3660
|
const { id, properties } = feature2;
|
|
3655
|
-
const geometry =
|
|
3661
|
+
const geometry = import_lodash18.default.get(feature2, "geometry") || import_lodash18.default.get(feature2, "properties.anchor.geometry");
|
|
3656
3662
|
const coordinates = getCenterFromGeometry(geometry);
|
|
3657
3663
|
const symbol = getElementSymbol("pin-marker");
|
|
3658
3664
|
try {
|
|
@@ -3672,10 +3678,10 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3672
3678
|
feature2,
|
|
3673
3679
|
mapConfig
|
|
3674
3680
|
);
|
|
3675
|
-
const markerHeight =
|
|
3681
|
+
const markerHeight = import_lodash18.default.get(featureExtrudeConfig, "height", 0);
|
|
3676
3682
|
const { properties, id } = feature2;
|
|
3677
3683
|
const { geometry } = properties.anchor;
|
|
3678
|
-
const logoUrl =
|
|
3684
|
+
const logoUrl = import_lodash18.default.get(properties, "logo.url");
|
|
3679
3685
|
const coordinates = getCenterFromGeometry(geometry);
|
|
3680
3686
|
const [markerBase, markerLabel] = getLabelSymbol(
|
|
3681
3687
|
"highlighted-logo-marker"
|
|
@@ -3745,7 +3751,7 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3745
3751
|
feature2,
|
|
3746
3752
|
mapConfig
|
|
3747
3753
|
);
|
|
3748
|
-
const markerHeight =
|
|
3754
|
+
const markerHeight = import_lodash18.default.get(featureExtrudeConfig, "height");
|
|
3749
3755
|
const { id, feature_type, properties } = feature2;
|
|
3750
3756
|
if (!properties.anchor) return;
|
|
3751
3757
|
const markerProperties = {
|
|
@@ -3755,8 +3761,8 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3755
3761
|
altitude: getAltitude(properties) + markerHeight
|
|
3756
3762
|
};
|
|
3757
3763
|
const { geometry } = properties?.anchor;
|
|
3758
|
-
const coordinates =
|
|
3759
|
-
const logoUrl =
|
|
3764
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
3765
|
+
const logoUrl = import_lodash18.default.get(properties, "logo.url");
|
|
3760
3766
|
if (markerSymbol) {
|
|
3761
3767
|
return new import_maptalks4.Marker(coordinates, {
|
|
3762
3768
|
properties: markerProperties,
|
|
@@ -3771,8 +3777,8 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3771
3777
|
});
|
|
3772
3778
|
}
|
|
3773
3779
|
const labelSymbol = getLabelSymbol("highlight-occupant-logo");
|
|
3774
|
-
const priorityMarkerSymbol =
|
|
3775
|
-
|
|
3780
|
+
const priorityMarkerSymbol = import_lodash18.default.last(labelSymbol) || {};
|
|
3781
|
+
import_lodash18.default.set(priorityMarkerSymbol, "markerFile", logoUrl);
|
|
3776
3782
|
return new import_maptalks4.Marker(coordinates, {
|
|
3777
3783
|
properties: markerProperties,
|
|
3778
3784
|
symbol: labelSymbol
|
|
@@ -3780,14 +3786,14 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3780
3786
|
},
|
|
3781
3787
|
createHighlight2DAmenityMarkerFrom3DMarker: (feature2, mapConfig) => {
|
|
3782
3788
|
const { coordinates, units, kiosk } = feature2;
|
|
3783
|
-
const amenityLocatedUnit =
|
|
3789
|
+
const amenityLocatedUnit = import_lodash18.default.first(units);
|
|
3784
3790
|
const unitConfig = getExtrudeConfigByFeature(
|
|
3785
3791
|
mapConfig,
|
|
3786
3792
|
amenityLocatedUnit
|
|
3787
3793
|
);
|
|
3788
|
-
const unitHeight =
|
|
3794
|
+
const unitHeight = import_lodash18.default.get(unitConfig, "height", 0);
|
|
3789
3795
|
const kioskConfig = getExtrudeConfigByFeature(mapConfig, kiosk);
|
|
3790
|
-
const kioskHeight =
|
|
3796
|
+
const kioskHeight = import_lodash18.default.get(kioskConfig, "height", 0);
|
|
3791
3797
|
const markerHeight = unitHeight + kioskHeight;
|
|
3792
3798
|
const symbol = getElementSymbol("highlight-amenity-marker");
|
|
3793
3799
|
return new import_maptalks4.Marker(coordinates, {
|
|
@@ -3863,7 +3869,7 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3863
3869
|
}
|
|
3864
3870
|
},
|
|
3865
3871
|
createLineStringFromGeometries: (geometries) => {
|
|
3866
|
-
const mergedCoordinates = (0,
|
|
3872
|
+
const mergedCoordinates = (0, import_lodash18.default)(geometries).map((geometry) => {
|
|
3867
3873
|
switch (geometry.type) {
|
|
3868
3874
|
case "Point":
|
|
3869
3875
|
return [
|
|
@@ -3972,29 +3978,29 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
3972
3978
|
create3DAmenityMarker: (feature2, threeLayer, config) => {
|
|
3973
3979
|
const { geometry, properties, feature_type, id } = feature2;
|
|
3974
3980
|
const { category, units, kiosk, is_clickable } = properties;
|
|
3975
|
-
const amenityLocatedUnit =
|
|
3976
|
-
const isLocatedUnitModel3dAvailable = !
|
|
3981
|
+
const amenityLocatedUnit = import_lodash18.default.first(units);
|
|
3982
|
+
const isLocatedUnitModel3dAvailable = !import_lodash18.default.isEmpty(
|
|
3977
3983
|
amenityLocatedUnit?.properties?.model3d
|
|
3978
3984
|
);
|
|
3979
|
-
const isLocatedKioskModel3dAvailable = !
|
|
3985
|
+
const isLocatedKioskModel3dAvailable = !import_lodash18.default.isEmpty(
|
|
3980
3986
|
kiosk?.properties?.model3d
|
|
3981
3987
|
);
|
|
3982
3988
|
const unitConfig = getExtrudeConfigByFeature(config, amenityLocatedUnit);
|
|
3983
|
-
const unitHeight = isLocatedUnitModel3dAvailable ? 0 :
|
|
3989
|
+
const unitHeight = isLocatedUnitModel3dAvailable ? 0 : import_lodash18.default.get(unitConfig, "height", 0);
|
|
3984
3990
|
const kioskConfig = getExtrudeConfigByFeature(config, kiosk);
|
|
3985
|
-
const kioskHeight = isLocatedKioskModel3dAvailable ? 0 :
|
|
3986
|
-
const coordinates =
|
|
3991
|
+
const kioskHeight = isLocatedKioskModel3dAvailable ? 0 : import_lodash18.default.get(kioskConfig, "height", 0);
|
|
3992
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
3987
3993
|
const markerProperties = {
|
|
3988
3994
|
...properties,
|
|
3989
3995
|
coordinates,
|
|
3990
3996
|
id,
|
|
3991
3997
|
feature_type
|
|
3992
3998
|
};
|
|
3993
|
-
const material =
|
|
3999
|
+
const material = import_lodash18.default.get(
|
|
3994
4000
|
spriteMarkerMaterialObj,
|
|
3995
4001
|
`${feature_type}.${category}`
|
|
3996
4002
|
);
|
|
3997
|
-
const highlightOptions =
|
|
4003
|
+
const highlightOptions = import_lodash18.default.get(
|
|
3998
4004
|
spriteHighlightMarkerOptionObj,
|
|
3999
4005
|
`${PREFIX_HIGHLIGHTED_SYMBOL_KEY}-${feature_type}.${category}`
|
|
4000
4006
|
);
|
|
@@ -4017,24 +4023,24 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
4017
4023
|
const { category, unit, kiosk } = properties;
|
|
4018
4024
|
const amenityLocation = kiosk || unit;
|
|
4019
4025
|
const locationConfig = getExtrudeConfigByFeature(config, amenityLocation);
|
|
4020
|
-
const coordinates =
|
|
4026
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
4021
4027
|
const markerProperties = {
|
|
4022
4028
|
...properties,
|
|
4023
4029
|
coordinates,
|
|
4024
4030
|
id,
|
|
4025
4031
|
feature_type
|
|
4026
4032
|
};
|
|
4027
|
-
const material =
|
|
4033
|
+
const material = import_lodash18.default.get(
|
|
4028
4034
|
spriteMarkerMaterialObj,
|
|
4029
4035
|
`${feature_type}.${category}`
|
|
4030
4036
|
);
|
|
4031
|
-
const highlightOptions =
|
|
4037
|
+
const highlightOptions = import_lodash18.default.get(
|
|
4032
4038
|
spriteHighlightMarkerOptionObj,
|
|
4033
4039
|
`${PREFIX_HIGHLIGHTED_SYMBOL_KEY}-${feature_type}.${category}`
|
|
4034
4040
|
);
|
|
4035
4041
|
const options = {
|
|
4036
4042
|
scale: 0.05,
|
|
4037
|
-
altitude:
|
|
4043
|
+
altitude: import_lodash18.default.get(locationConfig, "height", 0),
|
|
4038
4044
|
highlight: highlightOptions
|
|
4039
4045
|
};
|
|
4040
4046
|
return create3DMarker(
|
|
@@ -4050,24 +4056,24 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
4050
4056
|
const { category, unit, kiosk } = properties;
|
|
4051
4057
|
const amenityLocation = kiosk || unit;
|
|
4052
4058
|
const locationConfig = getExtrudeConfigByFeature(config, amenityLocation);
|
|
4053
|
-
const coordinates =
|
|
4059
|
+
const coordinates = import_lodash18.default.get(geometry, "coordinates");
|
|
4054
4060
|
const markerProperties = {
|
|
4055
4061
|
...properties,
|
|
4056
4062
|
coordinates,
|
|
4057
4063
|
id,
|
|
4058
4064
|
feature_type
|
|
4059
4065
|
};
|
|
4060
|
-
const material =
|
|
4066
|
+
const material = import_lodash18.default.get(
|
|
4061
4067
|
spriteMarkerMaterialObj,
|
|
4062
4068
|
`${feature_type}.${category}`
|
|
4063
4069
|
);
|
|
4064
|
-
const highlightOptions =
|
|
4070
|
+
const highlightOptions = import_lodash18.default.get(
|
|
4065
4071
|
spriteHighlightMarkerOptionObj,
|
|
4066
4072
|
`${PREFIX_HIGHLIGHTED_SYMBOL_KEY}-${feature_type}.${category}`
|
|
4067
4073
|
);
|
|
4068
4074
|
const options = {
|
|
4069
4075
|
scale: 0.05,
|
|
4070
|
-
altitude:
|
|
4076
|
+
altitude: import_lodash18.default.get(locationConfig, "height", 0),
|
|
4071
4077
|
highlight: highlightOptions
|
|
4072
4078
|
};
|
|
4073
4079
|
return create3DMarker(
|
|
@@ -4079,13 +4085,13 @@ var styledFeatureGenerator = (mapTheme) => {
|
|
|
4079
4085
|
);
|
|
4080
4086
|
},
|
|
4081
4087
|
createExtrudedUnit: (unit, threeLayer, options) => {
|
|
4082
|
-
const extrudeHeight =
|
|
4088
|
+
const extrudeHeight = import_lodash18.default.get(options, "height");
|
|
4083
4089
|
if (!extrudeHeight) return;
|
|
4084
4090
|
const unitProperty = getFeatureProperties(unit);
|
|
4085
4091
|
const options3d = {
|
|
4086
4092
|
// TODO: Move to extrude config later
|
|
4087
4093
|
offset: -0.1,
|
|
4088
|
-
altitude:
|
|
4094
|
+
altitude: import_lodash18.default.get(options, "altitude", 0)
|
|
4089
4095
|
};
|
|
4090
4096
|
const color = unitProperty.defaultColor;
|
|
4091
4097
|
if (color === "transparent") return;
|
|
@@ -4128,14 +4134,14 @@ var EXCEPT_AMENITY_LOCATION_CATEGORIES = [
|
|
|
4128
4134
|
"unspecified"
|
|
4129
4135
|
];
|
|
4130
4136
|
var getLocationByAmenity = (feature2) => {
|
|
4131
|
-
const unit =
|
|
4132
|
-
const unitCategory =
|
|
4137
|
+
const unit = import_lodash18.default.get(feature2, "properties.units[0]", null);
|
|
4138
|
+
const unitCategory = import_lodash18.default.get(unit, "properties.category");
|
|
4133
4139
|
if (!unit) return feature2.id;
|
|
4134
4140
|
return EXCEPT_AMENITY_LOCATION_CATEGORIES.includes(unitCategory) ? feature2 : unit;
|
|
4135
4141
|
};
|
|
4136
4142
|
var getLocationByOccupant = (feature2) => {
|
|
4137
|
-
const kiosk =
|
|
4138
|
-
const unit =
|
|
4143
|
+
const kiosk = import_lodash18.default.get(feature2, "properties.kiosk", null);
|
|
4144
|
+
const unit = import_lodash18.default.get(feature2, "properties.anchor.properties.unit", null);
|
|
4139
4145
|
return kiosk || unit;
|
|
4140
4146
|
};
|
|
4141
4147
|
var getLocationIdByFeature = (feature2) => {
|
|
@@ -4163,10 +4169,10 @@ var getFeatureByLocationId = (id, features = []) => {
|
|
|
4163
4169
|
});
|
|
4164
4170
|
};
|
|
4165
4171
|
var isClickableFeature = (feature2) => {
|
|
4166
|
-
const isClickable =
|
|
4172
|
+
const isClickable = import_lodash18.default.get(feature2, "properties.is_clickable");
|
|
4167
4173
|
switch (feature2?.feature_type) {
|
|
4168
4174
|
case "amenity":
|
|
4169
|
-
return
|
|
4175
|
+
return import_lodash18.default.isNull(isClickable) ? true : isClickable;
|
|
4170
4176
|
case "occupant":
|
|
4171
4177
|
return true;
|
|
4172
4178
|
default:
|
|
@@ -4184,15 +4190,15 @@ var getLocationByFeature = (feature2) => {
|
|
|
4184
4190
|
}
|
|
4185
4191
|
};
|
|
4186
4192
|
var getRelatedLocationsByOccupant = (feature2) => {
|
|
4187
|
-
const kiosks =
|
|
4188
|
-
const units =
|
|
4193
|
+
const kiosks = import_lodash18.default.get(feature2, "properties.kiosks", []);
|
|
4194
|
+
const units = import_lodash18.default.get(feature2, "properties.units", []);
|
|
4189
4195
|
return [...kiosks, ...units];
|
|
4190
4196
|
};
|
|
4191
4197
|
var getRelatedLocationsByAmenity = (feature2) => {
|
|
4192
|
-
const units =
|
|
4198
|
+
const units = import_lodash18.default.get(feature2, "properties.units", []);
|
|
4193
4199
|
if (units.length === 0) return [feature2];
|
|
4194
4200
|
return units.filter((unit) => {
|
|
4195
|
-
const unitCategory =
|
|
4201
|
+
const unitCategory = import_lodash18.default.get(unit, "properties.category");
|
|
4196
4202
|
return !EXCEPT_AMENITY_LOCATION_CATEGORIES.includes(unitCategory);
|
|
4197
4203
|
});
|
|
4198
4204
|
};
|
|
@@ -4218,8 +4224,8 @@ var getRelatedLocationsByFeature = (feature2) => {
|
|
|
4218
4224
|
};
|
|
4219
4225
|
var getOrdinalByLocationId = (locationId, feature2) => {
|
|
4220
4226
|
if (!feature2) return null;
|
|
4221
|
-
const mainUnit =
|
|
4222
|
-
const mainKiosk =
|
|
4227
|
+
const mainUnit = import_lodash18.default.get(feature2, "properties.unit");
|
|
4228
|
+
const mainKiosk = import_lodash18.default.get(feature2, "properties.kiosk");
|
|
4223
4229
|
const relatedLocations = getRelatedLocationsByFeature(feature2);
|
|
4224
4230
|
const allLocations = [mainUnit, mainKiosk, ...relatedLocations].filter(
|
|
4225
4231
|
Boolean
|
|
@@ -4227,7 +4233,7 @@ var getOrdinalByLocationId = (locationId, feature2) => {
|
|
|
4227
4233
|
const targetLocation = allLocations.find(
|
|
4228
4234
|
(location) => location.id === locationId
|
|
4229
4235
|
);
|
|
4230
|
-
return targetLocation ?
|
|
4236
|
+
return targetLocation ? import_lodash18.default.get(targetLocation, "properties.level.properties.ordinal") || import_lodash18.default.get(targetLocation, "properties.ordinal") : null;
|
|
4231
4237
|
};
|
|
4232
4238
|
|
|
4233
4239
|
// src/IndoorMap/utils/math.ts
|
|
@@ -4312,7 +4318,7 @@ var CameraManager = class {
|
|
|
4312
4318
|
};
|
|
4313
4319
|
|
|
4314
4320
|
// src/IndoorMap/renderer/RendererManager.ts
|
|
4315
|
-
var
|
|
4321
|
+
var import_lodash21 = require("lodash");
|
|
4316
4322
|
var import_center12 = require("@turf/center");
|
|
4317
4323
|
var THREE4 = __toESM(require("three"));
|
|
4318
4324
|
|
|
@@ -4333,7 +4339,7 @@ var maptalks3 = __toESM(require("maptalks-gl"));
|
|
|
4333
4339
|
var import_maptalks6 = require("maptalks.three");
|
|
4334
4340
|
var import_three5 = require("three");
|
|
4335
4341
|
var import_d3plus_shape = require("d3plus-shape");
|
|
4336
|
-
var
|
|
4342
|
+
var import_lodash19 = require("lodash");
|
|
4337
4343
|
var OPTIONS3 = {
|
|
4338
4344
|
// Allowing click through and prevent interaction
|
|
4339
4345
|
interactive: false,
|
|
@@ -4351,9 +4357,9 @@ var defaultFlatLabelOptions = {
|
|
|
4351
4357
|
textBaseline: "middle",
|
|
4352
4358
|
fillStyle: "#000"
|
|
4353
4359
|
};
|
|
4354
|
-
var defaultRectAngleToCalc = (0,
|
|
4360
|
+
var defaultRectAngleToCalc = (0, import_lodash19.range)(-90, 92, 2);
|
|
4355
4361
|
var getMaterial = (text, flatLabelOptions) => {
|
|
4356
|
-
const options = (0,
|
|
4362
|
+
const options = (0, import_lodash19.merge)({}, defaultFlatLabelOptions, flatLabelOptions);
|
|
4357
4363
|
const {
|
|
4358
4364
|
fontSize: initialFontSize,
|
|
4359
4365
|
fontFamily,
|
|
@@ -4406,12 +4412,12 @@ var getMaterial = (text, flatLabelOptions) => {
|
|
|
4406
4412
|
const maxWidth = SIZE - 2 * margin;
|
|
4407
4413
|
texts = wrapText(ctx, text, maxWidth);
|
|
4408
4414
|
}
|
|
4409
|
-
let textWidth = (0,
|
|
4415
|
+
let textWidth = (0, import_lodash19.max)(texts.map((text2) => ctx.measureText(text2).width));
|
|
4410
4416
|
let scale3 = 1;
|
|
4411
4417
|
while (scale3 > 0 && textWidth + 2 * margin > SIZE) {
|
|
4412
4418
|
scale3 -= scaleStep;
|
|
4413
4419
|
ctx.font = `${fontWeight} ${scale3 * fontSize}px "${fontFamily}", Arial`;
|
|
4414
|
-
textWidth = (0,
|
|
4420
|
+
textWidth = (0, import_lodash19.max)(texts.map((text2) => ctx.measureText(text2).width));
|
|
4415
4421
|
}
|
|
4416
4422
|
const center8 = { x: 0.5 * SIZE, y: 0.5 * SIZE };
|
|
4417
4423
|
if (scale3 > scaleMin) {
|
|
@@ -4479,7 +4485,7 @@ var GroundLabel = class extends import_maptalks6.BaseObject {
|
|
|
4479
4485
|
strokeStyle,
|
|
4480
4486
|
lineWidth
|
|
4481
4487
|
});
|
|
4482
|
-
const rectAngles = (0,
|
|
4488
|
+
const rectAngles = (0, import_lodash19.isArray)(angle) ? angle : [angle];
|
|
4483
4489
|
material.needsUpdate = true;
|
|
4484
4490
|
const rect = (0, import_d3plus_shape.largestRect)(bound, {
|
|
4485
4491
|
cache: true,
|
|
@@ -4552,32 +4558,32 @@ var GroundLabel = class extends import_maptalks6.BaseObject {
|
|
|
4552
4558
|
return { x: this.#offsetX, y: this.#offsetY };
|
|
4553
4559
|
}
|
|
4554
4560
|
set offsetX(value) {
|
|
4555
|
-
if ((0,
|
|
4561
|
+
if ((0, import_lodash19.isNumber)(value)) {
|
|
4556
4562
|
this.#offsetX = value;
|
|
4557
4563
|
this.#updatePosition();
|
|
4558
4564
|
}
|
|
4559
4565
|
}
|
|
4560
4566
|
set offsetY(value) {
|
|
4561
|
-
if ((0,
|
|
4567
|
+
if ((0, import_lodash19.isNumber)(value)) {
|
|
4562
4568
|
this.#offsetY = value;
|
|
4563
4569
|
this.#updatePosition();
|
|
4564
4570
|
}
|
|
4565
4571
|
}
|
|
4566
4572
|
set angle(newAngle) {
|
|
4567
|
-
if ((0,
|
|
4573
|
+
if ((0, import_lodash19.isNumber)(newAngle)) {
|
|
4568
4574
|
this.#angle = newAngle;
|
|
4569
4575
|
this.getObject3d().rotation.z = Math.PI / 180 * this.#angle;
|
|
4570
4576
|
}
|
|
4571
4577
|
}
|
|
4572
4578
|
setOffset(offsetX, offsetY) {
|
|
4573
|
-
if ((0,
|
|
4579
|
+
if ((0, import_lodash19.isNumber)(offsetX) && (0, import_lodash19.isNumber)(offsetY)) {
|
|
4574
4580
|
this.#offsetX = offsetX;
|
|
4575
4581
|
this.#offsetY = offsetY;
|
|
4576
4582
|
this.#updatePosition();
|
|
4577
4583
|
}
|
|
4578
4584
|
}
|
|
4579
4585
|
addOffset(deltaX, deltaY) {
|
|
4580
|
-
if ((0,
|
|
4586
|
+
if ((0, import_lodash19.isNumber)(deltaX) && (0, import_lodash19.isNumber)(deltaY)) {
|
|
4581
4587
|
this.#offsetX += deltaX;
|
|
4582
4588
|
this.#offsetY += deltaY;
|
|
4583
4589
|
this.#updatePosition();
|
|
@@ -5159,7 +5165,7 @@ var THREE3 = __toESM(require("three"));
|
|
|
5159
5165
|
var import_maptalks8 = require("maptalks");
|
|
5160
5166
|
var THREE2 = __toESM(require("three"));
|
|
5161
5167
|
var import_maptalks9 = require("maptalks.three");
|
|
5162
|
-
var
|
|
5168
|
+
var import_lodash20 = require("lodash");
|
|
5163
5169
|
|
|
5164
5170
|
// src/IndoorMap/renderer/utils/interpolateStops.ts
|
|
5165
5171
|
var interpolateStops = ({ stops }, zoom) => {
|
|
@@ -5254,7 +5260,7 @@ var TextSpriteMarker = class extends import_maptalks9.BaseObject {
|
|
|
5254
5260
|
const paragraphs = String(text).split("\n");
|
|
5255
5261
|
const wrappedLines = [];
|
|
5256
5262
|
paragraphs.forEach((paragraph) => {
|
|
5257
|
-
if ((0,
|
|
5263
|
+
if ((0, import_lodash20.isNil)(maxWidth) || isNaN(maxWidth)) {
|
|
5258
5264
|
wrappedLines.push(paragraph);
|
|
5259
5265
|
return;
|
|
5260
5266
|
}
|
|
@@ -5315,7 +5321,7 @@ var TextSpriteMarker = class extends import_maptalks9.BaseObject {
|
|
|
5315
5321
|
const altitude = (options.altitude || 0) + this.#altitudeOffset;
|
|
5316
5322
|
const z = layer.altitudeToVector3(altitude, altitude).x;
|
|
5317
5323
|
const position = layer.coordinateToVector3(this._coordinate, z);
|
|
5318
|
-
(0,
|
|
5324
|
+
(0, import_lodash20.set)(this.properties, "default.position", position);
|
|
5319
5325
|
this.getObject3d().position.copy(position);
|
|
5320
5326
|
}
|
|
5321
5327
|
_animation() {
|
|
@@ -5598,7 +5604,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5598
5604
|
if (this.#isClicked) return;
|
|
5599
5605
|
this.#isClicked = true;
|
|
5600
5606
|
const onClickElement = this.#onClickElement;
|
|
5601
|
-
if (!(0,
|
|
5607
|
+
if (!(0, import_lodash21.isFunction)(onClickElement)) return;
|
|
5602
5608
|
this.#onClickElement(e);
|
|
5603
5609
|
this.#isClicked = false;
|
|
5604
5610
|
};
|
|
@@ -5651,7 +5657,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5651
5657
|
});
|
|
5652
5658
|
units.filter((u) => u.properties.category === "room").forEach((unit) => {
|
|
5653
5659
|
const openingRelationships = relationships.filter((r) => r.properties.origin?.id === unit.id || r.properties.destination?.id === unit.id);
|
|
5654
|
-
const roomOpenings = (0,
|
|
5660
|
+
const roomOpenings = (0, import_lodash21.compact)(openingRelationships.map((rel) => {
|
|
5655
5661
|
const openingId = rel?.properties.intermediary[0].id;
|
|
5656
5662
|
return openings.find((o) => o.id === openingId);
|
|
5657
5663
|
}));
|
|
@@ -5733,7 +5739,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5733
5739
|
this.markerRenderer.showMarkers(markers, ordinal - baseOrdinal);
|
|
5734
5740
|
}
|
|
5735
5741
|
} else {
|
|
5736
|
-
const baseOrdinal = Array.isArray(targetOrdinal) ? (0,
|
|
5742
|
+
const baseOrdinal = Array.isArray(targetOrdinal) ? (0, import_lodash21.min)(targetOrdinal) : targetOrdinal;
|
|
5737
5743
|
for (const [ordinal, elements] of this.elementsByOrdinal) {
|
|
5738
5744
|
const inOrdinal = Array.isArray(targetOrdinal) ? targetOrdinal.includes(ordinal) : ordinal === targetOrdinal;
|
|
5739
5745
|
if (inOrdinal) {
|
|
@@ -5760,7 +5766,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5760
5766
|
const elements = elemIds.map((id) => this.elementsMap.get(id)).flat();
|
|
5761
5767
|
elements.forEach((element) => {
|
|
5762
5768
|
const controller = this.elementRenderer.createHighlightController(element);
|
|
5763
|
-
if (controller && (0,
|
|
5769
|
+
if (controller && (0, import_lodash21.isFunction)(controller.start)) {
|
|
5764
5770
|
controller.start();
|
|
5765
5771
|
this.highlightControllers.push(controller);
|
|
5766
5772
|
}
|
|
@@ -5768,7 +5774,7 @@ var RendererManager = class extends EventTarget {
|
|
|
5768
5774
|
};
|
|
5769
5775
|
clearHighlightElements = () => {
|
|
5770
5776
|
this.highlightControllers.forEach((controller) => {
|
|
5771
|
-
if ((0,
|
|
5777
|
+
if ((0, import_lodash21.isFunction)(controller?.clear)) controller.clear();
|
|
5772
5778
|
});
|
|
5773
5779
|
};
|
|
5774
5780
|
/**
|
|
@@ -5883,7 +5889,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
5883
5889
|
};
|
|
5884
5890
|
constructor(elementId, options) {
|
|
5885
5891
|
super();
|
|
5886
|
-
const combinedOptions =
|
|
5892
|
+
const combinedOptions = import_lodash22.default.merge({}, defaultOptions, options);
|
|
5887
5893
|
this.options = combinedOptions;
|
|
5888
5894
|
const {
|
|
5889
5895
|
onMapReady,
|
|
@@ -5930,7 +5936,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
5930
5936
|
this.dataClient = options.dataClient;
|
|
5931
5937
|
}
|
|
5932
5938
|
setOptions(options) {
|
|
5933
|
-
const combinedOptions =
|
|
5939
|
+
const combinedOptions = import_lodash22.default.merge({}, defaultOptions, options);
|
|
5934
5940
|
this.options = combinedOptions;
|
|
5935
5941
|
const maptalksOptions = parseMaptalksOptions(combinedOptions);
|
|
5936
5942
|
this.map.setOptions(maptalksOptions);
|
|
@@ -5956,7 +5962,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
5956
5962
|
handleMapClick = ({ coordinate }) => {
|
|
5957
5963
|
const { x, y } = coordinate;
|
|
5958
5964
|
console.log(
|
|
5959
|
-
`[Coordinates]: x: ${
|
|
5965
|
+
`[Coordinates]: x: ${import_lodash22.default.round(x, 8)} y: ${import_lodash22.default.round(
|
|
5960
5966
|
y,
|
|
5961
5967
|
8
|
|
5962
5968
|
)}, [Bearing]: ${this.map.getBearing()}, [Pitch]: ${this.map.getPitch()}`
|
|
@@ -6042,7 +6048,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6042
6048
|
if (this.#isClicked) return;
|
|
6043
6049
|
this.#isClicked = true;
|
|
6044
6050
|
const onClickElement = this.#onClickElement;
|
|
6045
|
-
if (!
|
|
6051
|
+
if (!import_lodash22.default.isFunction(onClickElement)) return;
|
|
6046
6052
|
this.#onClickElement(e);
|
|
6047
6053
|
this.#isClicked = false;
|
|
6048
6054
|
};
|
|
@@ -6062,16 +6068,16 @@ var IndoorMap = class extends EventTarget {
|
|
|
6062
6068
|
for (const feature2 of this.#features) {
|
|
6063
6069
|
try {
|
|
6064
6070
|
const { feature_type: featureType, properties, id } = feature2;
|
|
6065
|
-
const layerName =
|
|
6071
|
+
const layerName = import_lodash22.default.get(
|
|
6066
6072
|
LAYER_FEATURE_TYPE_OBJ,
|
|
6067
6073
|
featureType,
|
|
6068
6074
|
featureType
|
|
6069
6075
|
);
|
|
6070
6076
|
const layer = this.map.getLayer(layerName);
|
|
6071
6077
|
let geometry;
|
|
6072
|
-
const category =
|
|
6073
|
-
const extrudeConfig =
|
|
6074
|
-
const textMarkerType =
|
|
6078
|
+
const category = import_lodash22.default.get(feature2, "properties.category");
|
|
6079
|
+
const extrudeConfig = import_lodash22.default.get(this.#mapConfig, "extrude");
|
|
6080
|
+
const textMarkerType = import_lodash22.default.get(
|
|
6075
6081
|
this.#mapConfig,
|
|
6076
6082
|
"text_marker_type",
|
|
6077
6083
|
"ui-marker"
|
|
@@ -6238,15 +6244,15 @@ var IndoorMap = class extends EventTarget {
|
|
|
6238
6244
|
}
|
|
6239
6245
|
}
|
|
6240
6246
|
updateUserLocationSymbolByLocale(locale) {
|
|
6241
|
-
const userLocationGeometry =
|
|
6247
|
+
const userLocationGeometry = import_lodash22.default.get(
|
|
6242
6248
|
this.#elements,
|
|
6243
6249
|
`${USER_LOCATION_ELEMENT_ID}.geometry`
|
|
6244
6250
|
);
|
|
6245
6251
|
if (!userLocationGeometry) return;
|
|
6246
6252
|
const currentSymbol = userLocationGeometry.getSymbol();
|
|
6247
6253
|
const localeSymbolToUpdate = currentSymbol.map((symbol) => {
|
|
6248
|
-
const localeSymbol =
|
|
6249
|
-
if (!
|
|
6254
|
+
const localeSymbol = import_lodash22.default.get(symbol, `${LOCALE_SYMBOL_KEY}.${locale}`) || import_lodash22.default.get(symbol, `${LOCALE_SYMBOL_KEY}.default`);
|
|
6255
|
+
if (!import_lodash22.default.isPlainObject(localeSymbol)) return symbol;
|
|
6250
6256
|
return {
|
|
6251
6257
|
...symbol,
|
|
6252
6258
|
...localeSymbol
|
|
@@ -6320,14 +6326,14 @@ var IndoorMap = class extends EventTarget {
|
|
|
6320
6326
|
* END of User Location
|
|
6321
6327
|
****************************/
|
|
6322
6328
|
showGeometryByElementId = (elementId) => {
|
|
6323
|
-
const geometry =
|
|
6329
|
+
const geometry = import_lodash22.default.get(
|
|
6324
6330
|
this.#elements,
|
|
6325
6331
|
`${elementId}.geometry`
|
|
6326
6332
|
);
|
|
6327
6333
|
if (geometry) geometry.show();
|
|
6328
6334
|
};
|
|
6329
6335
|
hideGeometryByElementId = (elementId) => {
|
|
6330
|
-
const geometry =
|
|
6336
|
+
const geometry = import_lodash22.default.get(this.#elements, `${elementId}.geometry`);
|
|
6331
6337
|
if (geometry) geometry.hide();
|
|
6332
6338
|
};
|
|
6333
6339
|
setSpriteMarkersOpacity = (opacity = 1) => {
|
|
@@ -6374,13 +6380,13 @@ var IndoorMap = class extends EventTarget {
|
|
|
6374
6380
|
const line = lineStrings[i];
|
|
6375
6381
|
const coords = line.geometry.coordinates;
|
|
6376
6382
|
const prevLine = lineStrings[i - 1];
|
|
6377
|
-
const firstCoord =
|
|
6383
|
+
const firstCoord = import_lodash22.default.first(coords);
|
|
6378
6384
|
const isFirstLine = i === 0;
|
|
6379
6385
|
if (isFirstLine) {
|
|
6380
6386
|
accLine.push(...coords);
|
|
6381
6387
|
continue;
|
|
6382
6388
|
}
|
|
6383
|
-
const prevLastCoord =
|
|
6389
|
+
const prevLastCoord = import_lodash22.default.last(prevLine.geometry.coordinates);
|
|
6384
6390
|
const isNearby = (0, import_distance6.default)(point(firstCoord), point(prevLastCoord)) < distance5;
|
|
6385
6391
|
if (!isNearby) {
|
|
6386
6392
|
const remainingLines = lineStrings.slice(i);
|
|
@@ -6401,8 +6407,8 @@ var IndoorMap = class extends EventTarget {
|
|
|
6401
6407
|
create3DStepPath
|
|
6402
6408
|
} = this.#styler;
|
|
6403
6409
|
const routeMarkerLayer = this.map.getLayer(HIGHLIGHT_LAYER_NAME);
|
|
6404
|
-
const linesByOrdinal = (0,
|
|
6405
|
-
const joinedLines = (0,
|
|
6410
|
+
const linesByOrdinal = (0, import_lodash22.default)(stepGeometries).filter(({ geometry }) => geometry.type === "LineString").groupBy("properties.ordinal").value();
|
|
6411
|
+
const joinedLines = (0, import_lodash22.default)(linesByOrdinal).reduce((acc, lines, key) => {
|
|
6406
6412
|
const joined = this.combineNearbyLineStrings(lines, {
|
|
6407
6413
|
properties: { ordinal: +key }
|
|
6408
6414
|
});
|
|
@@ -6430,14 +6436,14 @@ var IndoorMap = class extends EventTarget {
|
|
|
6430
6436
|
stepElement = createOriginMarker(stepGeometry).addTo(routeMarkerLayer);
|
|
6431
6437
|
break;
|
|
6432
6438
|
case "destination-marker":
|
|
6433
|
-
const extrudeConfig =
|
|
6439
|
+
const extrudeConfig = import_lodash22.default.get(this.#mapConfig, "extrude");
|
|
6434
6440
|
if (destinationFeature.feature_type === "occupant") {
|
|
6435
|
-
const stepId =
|
|
6441
|
+
const stepId = import_lodash22.default.get(stepGeometry, "id");
|
|
6436
6442
|
const normalizedDestinationFeature = {
|
|
6437
6443
|
...destinationFeature,
|
|
6438
6444
|
id: stepId
|
|
6439
6445
|
};
|
|
6440
|
-
const logoUrl =
|
|
6446
|
+
const logoUrl = import_lodash22.default.get(
|
|
6441
6447
|
normalizedDestinationFeature,
|
|
6442
6448
|
"properties.logo.url"
|
|
6443
6449
|
);
|
|
@@ -6482,15 +6488,15 @@ var IndoorMap = class extends EventTarget {
|
|
|
6482
6488
|
const routeMarkerLayer = this.map.getLayer(
|
|
6483
6489
|
HIGHLIGHT_LAYER_NAME
|
|
6484
6490
|
);
|
|
6485
|
-
const originMarkerGeometry =
|
|
6491
|
+
const originMarkerGeometry = import_lodash22.default.get(
|
|
6486
6492
|
this.#elements,
|
|
6487
6493
|
`${ORIGIN_MARKER_ID}.geometry`
|
|
6488
6494
|
);
|
|
6489
|
-
const destinationMarkerGeometry =
|
|
6495
|
+
const destinationMarkerGeometry = import_lodash22.default.get(
|
|
6490
6496
|
this.#elements,
|
|
6491
6497
|
`${DESTINATION_MARKER_ID}.geometry`
|
|
6492
6498
|
);
|
|
6493
|
-
const geometriesToRemove =
|
|
6499
|
+
const geometriesToRemove = import_lodash22.default.compact([
|
|
6494
6500
|
originMarkerGeometry,
|
|
6495
6501
|
destinationMarkerGeometry
|
|
6496
6502
|
]);
|
|
@@ -6501,7 +6507,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6501
6507
|
(obj) => !(obj instanceof NavigationPath)
|
|
6502
6508
|
);
|
|
6503
6509
|
const objects = this.#navigationGeometries || {};
|
|
6504
|
-
|
|
6510
|
+
import_lodash22.default.forEach(objects, (obj) => {
|
|
6505
6511
|
if (!obj) return;
|
|
6506
6512
|
this.#navigationGeometries[obj.properties.id] = null;
|
|
6507
6513
|
obj.remove();
|
|
@@ -6538,7 +6544,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6538
6544
|
}
|
|
6539
6545
|
if (this.threeLayer) {
|
|
6540
6546
|
const currentView = this.camera.getView();
|
|
6541
|
-
const objectOpacity =
|
|
6547
|
+
const objectOpacity = import_lodash22.default.clamp(38 - 2 * currentView.zoom, 0, 1);
|
|
6542
6548
|
this.#objects.forEach((object) => {
|
|
6543
6549
|
object.getObject3d().traverse((child) => {
|
|
6544
6550
|
if (child.isMesh) child.material.opacity = objectOpacity;
|
|
@@ -6548,7 +6554,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6548
6554
|
});
|
|
6549
6555
|
if (this.#billboardObjects) {
|
|
6550
6556
|
this.#billboardObjects.forEach((object) => {
|
|
6551
|
-
const objectScale =
|
|
6557
|
+
const objectScale = import_lodash22.default.clamp(
|
|
6552
6558
|
20 - 1 * currentView.zoom,
|
|
6553
6559
|
1,
|
|
6554
6560
|
1.05
|
|
@@ -6557,7 +6563,7 @@ var IndoorMap = class extends EventTarget {
|
|
|
6557
6563
|
});
|
|
6558
6564
|
}
|
|
6559
6565
|
if (this.#isLayersFadingOnZoom) {
|
|
6560
|
-
const layerOpacity =
|
|
6566
|
+
const layerOpacity = import_lodash22.default.clamp(1 - objectOpacity, 0, 1);
|
|
6561
6567
|
LAYERS.forEach((layerKey) => {
|
|
6562
6568
|
const layer = this.map.getLayer(layerKey);
|
|
6563
6569
|
if (layer) layer.setOpacity(layerOpacity);
|