@aibee/crc-bmap 0.0.58 → 0.0.59
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/example/src/main.ts +2 -2
- package/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +3 -3
- package/lib/bmap.esm.js +22 -14
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +1 -1
- package/lib/bmap.esm.min.js.map +3 -3
- package/lib/bmap.min.js +1 -1
- package/lib/bmap.min.js.map +3 -3
- package/lib/src/config.d.ts +3 -0
- package/lib/src/elements/floor.d.ts +1 -0
- package/lib/src/types/index.d.ts +1 -0
- package/package.json +1 -1
package/lib/bmap.esm.js
CHANGED
|
@@ -453,6 +453,7 @@ var defaultOptions = {
|
|
|
453
453
|
layerType: "",
|
|
454
454
|
zIndex: 0,
|
|
455
455
|
stroke: true,
|
|
456
|
+
deltaHeight: 0,
|
|
456
457
|
userData: {}
|
|
457
458
|
};
|
|
458
459
|
var Graphic = class extends Object3D {
|
|
@@ -565,7 +566,7 @@ var Graphic = class extends Object3D {
|
|
|
565
566
|
const geometry = new ExtrudeGeometry(shape, {
|
|
566
567
|
steps: 1,
|
|
567
568
|
bevelEnabled: false,
|
|
568
|
-
depth: this.options.height,
|
|
569
|
+
depth: this.options.height + this.options.deltaHeight,
|
|
569
570
|
curveSegments: 4
|
|
570
571
|
});
|
|
571
572
|
return geometry;
|
|
@@ -595,7 +596,7 @@ var Graphic = class extends Object3D {
|
|
|
595
596
|
}
|
|
596
597
|
getBorderPoints() {
|
|
597
598
|
const points = [];
|
|
598
|
-
const height = this.options.height;
|
|
599
|
+
const height = this.options.height + this.options.deltaHeight;
|
|
599
600
|
const { cds, curveIndex } = this.options.geometry;
|
|
600
601
|
for (let j = 0; j < cds.length; j++) {
|
|
601
602
|
const curCds = cds[j];
|
|
@@ -1018,6 +1019,7 @@ var GraphicLayer = class extends Layer {
|
|
|
1018
1019
|
return box.getCenter(new Vector35());
|
|
1019
1020
|
}
|
|
1020
1021
|
createGraphic(options) {
|
|
1022
|
+
options.deltaHeight = 1e-5 * this.graphicMap.size;
|
|
1021
1023
|
const graphic = new Graphic(this.context, options);
|
|
1022
1024
|
this.add(graphic);
|
|
1023
1025
|
this.graphicMap.set(options.id, graphic);
|
|
@@ -1312,10 +1314,14 @@ var Floor = class extends Object3D7 {
|
|
|
1312
1314
|
this.groundUpper.add(this.poiLayer);
|
|
1313
1315
|
this.add(this.groundUpper);
|
|
1314
1316
|
}
|
|
1317
|
+
createGround(options) {
|
|
1318
|
+
options.deltaHeight = 1e-5 * this.grounds.size;
|
|
1319
|
+
const ground = new Graphic(this.context, options);
|
|
1320
|
+
this.addGrounds([ground]);
|
|
1321
|
+
}
|
|
1315
1322
|
addGrounds(grounds) {
|
|
1316
1323
|
grounds.forEach((ground) => {
|
|
1317
1324
|
if (!this.grounds.has(ground)) {
|
|
1318
|
-
ground.options.height += ground.options.zIndex / 1e4;
|
|
1319
1325
|
ground.mesh.castShadow = true;
|
|
1320
1326
|
this.grounds.add(ground);
|
|
1321
1327
|
this.groundUpper.add(ground);
|
|
@@ -1343,7 +1349,6 @@ var Floor = class extends Object3D7 {
|
|
|
1343
1349
|
this.add(this.shadow);
|
|
1344
1350
|
}
|
|
1345
1351
|
addGraphic(graphicOptions) {
|
|
1346
|
-
graphicOptions.height += this.graphicLayer.graphicMap.size * 1e-5;
|
|
1347
1352
|
return this.graphicLayer.createGraphic(graphicOptions);
|
|
1348
1353
|
}
|
|
1349
1354
|
addPoi(poiOptions) {
|
|
@@ -2564,6 +2569,9 @@ var defaultConfig = {
|
|
|
2564
2569
|
stroke: false,
|
|
2565
2570
|
strokeColor: "#000",
|
|
2566
2571
|
strokeOpacity: 1
|
|
2572
|
+
},
|
|
2573
|
+
graphic: {
|
|
2574
|
+
fillOpacity: 1
|
|
2567
2575
|
}
|
|
2568
2576
|
};
|
|
2569
2577
|
function getConfig(config) {
|
|
@@ -2714,7 +2722,7 @@ var BMap = class extends EventDispatcher7 {
|
|
|
2714
2722
|
item.info.transformToBuildingGround = true;
|
|
2715
2723
|
});
|
|
2716
2724
|
}
|
|
2717
|
-
const { ground, markGraphic } = this.config;
|
|
2725
|
+
const { ground, markGraphic, graphic } = this.config;
|
|
2718
2726
|
for (const item of data) {
|
|
2719
2727
|
if (item.info.group === "ground") {
|
|
2720
2728
|
item.info.fillColor = ground.color;
|
|
@@ -2723,15 +2731,15 @@ var BMap = class extends EventDispatcher7 {
|
|
|
2723
2731
|
item.info.stroke = ground.stroke;
|
|
2724
2732
|
item.info.strokeColor = ground.strokeColor;
|
|
2725
2733
|
item.info.strokeOpacity = ground.strokeOpacity;
|
|
2734
|
+
} else if (item.info.userData.mark) {
|
|
2735
|
+
item.info.height = markGraphic.height;
|
|
2736
|
+
item.info.fillColor = markGraphic.color;
|
|
2737
|
+
item.info.fillOpacity = markGraphic.opacity;
|
|
2738
|
+
item.info.stroke = markGraphic.stroke;
|
|
2739
|
+
item.info.strokeColor = markGraphic.strokeColor;
|
|
2740
|
+
item.info.strokeOpacity = markGraphic.strokeOpacity;
|
|
2726
2741
|
} else {
|
|
2727
|
-
|
|
2728
|
-
item.info.height = markGraphic.height;
|
|
2729
|
-
item.info.fillColor = markGraphic.color;
|
|
2730
|
-
item.info.fillOpacity = markGraphic.opacity;
|
|
2731
|
-
item.info.stroke = markGraphic.stroke;
|
|
2732
|
-
item.info.strokeColor = markGraphic.strokeColor;
|
|
2733
|
-
item.info.strokeOpacity = markGraphic.strokeOpacity;
|
|
2734
|
-
}
|
|
2742
|
+
item.info.fillOpacity = graphic.fillOpacity;
|
|
2735
2743
|
}
|
|
2736
2744
|
}
|
|
2737
2745
|
if (!this.config.useFloorCache) {
|
|
@@ -2750,7 +2758,7 @@ var BMap = class extends EventDispatcher7 {
|
|
|
2750
2758
|
const graphics = [];
|
|
2751
2759
|
for (const item of data) {
|
|
2752
2760
|
if (item.info.group === "ground") {
|
|
2753
|
-
curFloor.
|
|
2761
|
+
curFloor.createGround(item.info);
|
|
2754
2762
|
} else {
|
|
2755
2763
|
const graphic = curFloor.addGraphic(item.info);
|
|
2756
2764
|
graphic.userData.data = item;
|