@aibee/crc-bmap 0.0.57 → 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/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) {
@@ -2473,6 +2478,8 @@ var Context = class extends EventDispatcher6 {
2473
2478
  this.control.target.copy(position.clone().add(lookAtVector));
2474
2479
  }).onComplete(() => {
2475
2480
  this.tweenGroup.remove(tween);
2481
+ this.camera.position.copy(start.clone().sub(lookAtVector));
2482
+ this.control.target.copy(position.clone());
2476
2483
  this.control.update();
2477
2484
  this.control.enabled = true;
2478
2485
  resolve(true);
@@ -2562,6 +2569,9 @@ var defaultConfig = {
2562
2569
  stroke: false,
2563
2570
  strokeColor: "#000",
2564
2571
  strokeOpacity: 1
2572
+ },
2573
+ graphic: {
2574
+ fillOpacity: 1
2565
2575
  }
2566
2576
  };
2567
2577
  function getConfig(config) {
@@ -2712,7 +2722,7 @@ var BMap = class extends EventDispatcher7 {
2712
2722
  item.info.transformToBuildingGround = true;
2713
2723
  });
2714
2724
  }
2715
- const { ground, markGraphic } = this.config;
2725
+ const { ground, markGraphic, graphic } = this.config;
2716
2726
  for (const item of data) {
2717
2727
  if (item.info.group === "ground") {
2718
2728
  item.info.fillColor = ground.color;
@@ -2721,15 +2731,15 @@ var BMap = class extends EventDispatcher7 {
2721
2731
  item.info.stroke = ground.stroke;
2722
2732
  item.info.strokeColor = ground.strokeColor;
2723
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;
2724
2741
  } else {
2725
- if (item.info.userData.mark) {
2726
- item.info.height = markGraphic.height;
2727
- item.info.fillColor = markGraphic.color;
2728
- item.info.fillOpacity = markGraphic.opacity;
2729
- item.info.stroke = markGraphic.stroke;
2730
- item.info.strokeColor = markGraphic.strokeColor;
2731
- item.info.strokeOpacity = markGraphic.strokeOpacity;
2732
- }
2742
+ item.info.fillOpacity = graphic.fillOpacity;
2733
2743
  }
2734
2744
  }
2735
2745
  if (!this.config.useFloorCache) {
@@ -2748,7 +2758,7 @@ var BMap = class extends EventDispatcher7 {
2748
2758
  const graphics = [];
2749
2759
  for (const item of data) {
2750
2760
  if (item.info.group === "ground") {
2751
- curFloor.addGrounds([new Graphic(this.context, item.info)]);
2761
+ curFloor.createGround(item.info);
2752
2762
  } else {
2753
2763
  const graphic = curFloor.addGraphic(item.info);
2754
2764
  graphic.userData.data = item;