@aibee/crc-bmap 0.0.123 → 0.0.125

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
@@ -454,7 +454,7 @@ var require_Graph = __commonJS({
454
454
  });
455
455
 
456
456
  // src/bmap.ts
457
- import { EventDispatcher as EventDispatcher7, Vector3 as Vector318 } from "three";
457
+ import { EventDispatcher as EventDispatcher7, Vector3 as Vector319 } from "three";
458
458
 
459
459
  // src/utils/timer.ts
460
460
  var Timer = class {
@@ -1619,11 +1619,11 @@ function toWebWorker(obj) {
1619
1619
  import {
1620
1620
  EventDispatcher as EventDispatcher6,
1621
1621
  Box2,
1622
- Vector3 as Vector317,
1622
+ Vector3 as Vector318,
1623
1623
  Vector2 as Vector26,
1624
1624
  Raycaster as Raycaster3,
1625
1625
  Box3 as Box39,
1626
- Color as Color5,
1626
+ Color as Color6,
1627
1627
  AmbientLight as AmbientLight2
1628
1628
  } from "three";
1629
1629
  import { Group as TweenGroup, Tween } from "@tweenjs/tween.js";
@@ -2956,12 +2956,14 @@ var Floor = class extends Object3D8 {
2956
2956
  this.textureLayer = new Layer(this.context);
2957
2957
  this.glbModelLayer = new Layer(this.context);
2958
2958
  this.laneLayer = new Layer(this.context);
2959
+ this.mergeGraphicLayer = new Layer(this.context);
2959
2960
  this.groundUpper.add(this.graphicLayer);
2960
2961
  this.groundUpper.add(this.poiLayer);
2961
2962
  this.groundUpper.add(this.wallLayer);
2962
2963
  this.groundUpper.add(this.textureLayer);
2963
2964
  this.groundUpper.add(this.glbModelLayer);
2964
2965
  this.groundUpper.add(this.laneLayer);
2966
+ this.groundUpper.add(this.mergeGraphicLayer);
2965
2967
  this.add(this.groundUpper);
2966
2968
  this.add(this.groundLayer);
2967
2969
  this.add(this.models);
@@ -2972,6 +2974,7 @@ var Floor = class extends Object3D8 {
2972
2974
  textureLayer;
2973
2975
  glbModelLayer;
2974
2976
  laneLayer;
2977
+ mergeGraphicLayer;
2975
2978
  grounds = /* @__PURE__ */ new Set();
2976
2979
  groundLayer;
2977
2980
  shadow = new Shadow();
@@ -3062,6 +3065,7 @@ var Floor = class extends Object3D8 {
3062
3065
  this.textureLayer.dispose();
3063
3066
  this.glbModelLayer.dispose();
3064
3067
  this.laneLayer.dispose();
3068
+ this.mergeGraphicLayer.dispose();
3065
3069
  this.grounds.forEach((ground) => ground.dispose());
3066
3070
  this.heatmap?.dispose();
3067
3071
  this.groundUpper.clear();
@@ -3834,7 +3838,7 @@ var Lane = class extends Object3D12 {
3834
3838
  this.initLineGeometry();
3835
3839
  this.createBorder();
3836
3840
  this.initDoubleLine();
3837
- this.position.z += 1e-3 + (this.options[0].deltaHeight || 0);
3841
+ this.position.z += 2e-3 + (this.options[0].deltaHeight || 0);
3838
3842
  }
3839
3843
  dispose() {
3840
3844
  this.geometry?.dispose();
@@ -3843,6 +3847,172 @@ var Lane = class extends Object3D12 {
3843
3847
  }
3844
3848
  };
3845
3849
 
3850
+ // src/elements/merge-graphic.ts
3851
+ import {
3852
+ Object3D as Object3D13,
3853
+ ExtrudeGeometry as ExtrudeGeometry5,
3854
+ Mesh as Mesh7,
3855
+ Vector3 as Vector314,
3856
+ BufferGeometry as BufferGeometry4,
3857
+ LineSegments as LineSegments4,
3858
+ ShaderMaterial as ShaderMaterial3,
3859
+ Color as Color4
3860
+ } from "three";
3861
+ import { mergeGeometries as mergeGeometries3 } from "three/examples/jsm/utils/BufferGeometryUtils";
3862
+ var MergeGraphic = class extends Object3D13 {
3863
+ constructor(context, options) {
3864
+ super();
3865
+ this.context = context;
3866
+ this.options = options.map((option) => ({ ...defaultGraphicOptions, ...option }));
3867
+ this.init();
3868
+ }
3869
+ geometry;
3870
+ material;
3871
+ mesh;
3872
+ line;
3873
+ lineMaterial;
3874
+ lineGeometry;
3875
+ options;
3876
+ init() {
3877
+ this.geometry = this.initGeometry();
3878
+ this.initMaterial();
3879
+ this.initMesh();
3880
+ this.mesh.position.z = this.options[0].deltaHeight;
3881
+ this.initLineMaterial();
3882
+ this.initLineGeometry();
3883
+ this.createBorder();
3884
+ }
3885
+ initGeometry() {
3886
+ const geometries = this.options.map((option) => {
3887
+ const shape = initShape(
3888
+ option.geometry.coords[0],
3889
+ option.geometry.coords.slice(1)
3890
+ );
3891
+ const geometry2 = new ExtrudeGeometry5(shape, {
3892
+ steps: 1,
3893
+ bevelEnabled: false,
3894
+ depth: option.height,
3895
+ curveSegments: 4
3896
+ });
3897
+ return geometry2;
3898
+ });
3899
+ const geometry = mergeGeometries3(geometries);
3900
+ geometries.forEach((geometry2) => geometry2.dispose());
3901
+ return geometry;
3902
+ }
3903
+ initMaterial() {
3904
+ const vertexShader = `
3905
+ varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
3906
+ uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
3907
+ uniform vec3 uColor;
3908
+ uniform vec3 uColor2;
3909
+ uniform float uOpacity;
3910
+
3911
+ void main() {
3912
+ vPosition = position; // \u5411\u7247\u6BB5\u7740\u8272\u5668\u4F20\u9012\u4F4D\u7F6E
3913
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
3914
+ }
3915
+ `;
3916
+ const fragmentShader = `
3917
+ varying vec3 vPosition; // \u63A5\u6536\u9876\u70B9\u4F4D\u7F6E
3918
+ uniform float maxZ;
3919
+ uniform vec3 uColor;
3920
+ uniform vec3 uColor2;
3921
+ uniform float uOpacity;
3922
+
3923
+ void main() {
3924
+ // \u5224\u65AD\u5F53\u524D\u9876\u70B9\u662F\u5426\u4E3A\u9876\u9762
3925
+ if (vPosition.z >= maxZ) {
3926
+ gl_FragColor = vec4(uColor, uOpacity); //\uFF08\u9876\u9762\u989C\u8272\uFF09
3927
+ } else {
3928
+ gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
3929
+ }
3930
+ }
3931
+ `;
3932
+ let maxZ = -Infinity;
3933
+ const positionAttribute = this.geometry.getAttribute("position");
3934
+ if (positionAttribute) {
3935
+ for (let i = 0; i < positionAttribute.count; i++) {
3936
+ const z = positionAttribute.getZ(i);
3937
+ if (z > maxZ) {
3938
+ maxZ = z;
3939
+ }
3940
+ }
3941
+ }
3942
+ const shaderMaterial = new ShaderMaterial3({
3943
+ uniforms: {
3944
+ maxZ: { value: maxZ },
3945
+ // 初始化maxZ的值
3946
+ uColor: { value: new Color4(this.options[0].fillColor).convertLinearToSRGB() },
3947
+ // 顶面颜色
3948
+ uColor2: { value: new Color4(darkenColor(this.options[0].fillColor)).convertLinearToSRGB() },
3949
+ // 侧面颜色
3950
+ uOpacity: { value: this.options[0].fillOpacity }
3951
+ // 透明度
3952
+ },
3953
+ vertexShader,
3954
+ fragmentShader
3955
+ });
3956
+ this.material = shaderMaterial;
3957
+ }
3958
+ initLineMaterial() {
3959
+ const lineMaterial = this.context.materialFactory.createLineMaterial({
3960
+ color: this.options[0].strokeColor,
3961
+ opacity: this.options[0].strokeOpacity
3962
+ });
3963
+ this.lineMaterial = lineMaterial;
3964
+ return lineMaterial;
3965
+ }
3966
+ initMesh() {
3967
+ if (this.mesh) {
3968
+ this.remove(this.mesh);
3969
+ }
3970
+ this.mesh = new Mesh7(this.geometry, this.material);
3971
+ this.add(this.mesh);
3972
+ }
3973
+ getBorderPoints() {
3974
+ const points = [];
3975
+ const height = this.options[0].height + this.options[0].deltaHeight;
3976
+ this.options.map((option) => {
3977
+ const { coords } = option.geometry;
3978
+ for (let j = 0; j < coords.length; j++) {
3979
+ const curCds = coords[j];
3980
+ for (let i = 0; i < curCds.length; i++) {
3981
+ const cur = curCds[i];
3982
+ const next = i + 1 === curCds.length ? curCds[0] : curCds[i + 1];
3983
+ points.push(new Vector314(cur[0], cur[1], height));
3984
+ points.push(new Vector314(next[0], next[1], height));
3985
+ }
3986
+ }
3987
+ });
3988
+ return points;
3989
+ }
3990
+ initLineGeometry() {
3991
+ if (this.lineGeometry) {
3992
+ this.lineGeometry.dispose();
3993
+ }
3994
+ const points = this.getBorderPoints();
3995
+ const lineGeometry = new BufferGeometry4().setFromPoints(points);
3996
+ this.lineGeometry = lineGeometry;
3997
+ }
3998
+ createBorder() {
3999
+ if (this.line) {
4000
+ this.remove(this.line);
4001
+ }
4002
+ const line = new LineSegments4(this.lineGeometry, this.lineMaterial);
4003
+ line.position.z = 0.01;
4004
+ this.line = line;
4005
+ this.add(line);
4006
+ return line;
4007
+ }
4008
+ dispose() {
4009
+ this.geometry.dispose();
4010
+ this.material.dispose();
4011
+ this.line?.geometry.dispose();
4012
+ this.clear();
4013
+ }
4014
+ };
4015
+
3846
4016
  // src/operations/selection/box-selection.ts
3847
4017
  import { Frustum } from "three";
3848
4018
  var BoxSelection = class extends BaseSvg {
@@ -4203,11 +4373,11 @@ var HoverHelper = class extends EventDispatcher5 {
4203
4373
  // src/factory/material.ts
4204
4374
  import { LineMaterial } from "three/examples/jsm/lines/LineMaterial";
4205
4375
  import {
4206
- Color as Color4,
4207
- LineBasicMaterial as LineBasicMaterial4,
4376
+ Color as Color5,
4377
+ LineBasicMaterial as LineBasicMaterial5,
4208
4378
  MeshStandardMaterial as MeshStandardMaterial2,
4209
4379
  MeshBasicMaterial as MeshBasicMaterial5,
4210
- ShaderMaterial as ShaderMaterial3,
4380
+ ShaderMaterial as ShaderMaterial4,
4211
4381
  DoubleSide as DoubleSide3,
4212
4382
  Vector2 as Vector25
4213
4383
  } from "three";
@@ -4232,8 +4402,8 @@ var MaterialFactory = class {
4232
4402
  if (this.lineMaterialMap.has(key)) {
4233
4403
  return this.lineMaterialMap.get(key);
4234
4404
  }
4235
- const lineMaterial = new LineBasicMaterial4({
4236
- color: new Color4(color).convertLinearToSRGB(),
4405
+ const lineMaterial = new LineBasicMaterial5({
4406
+ color: new Color5(color).convertLinearToSRGB(),
4237
4407
  transparent: true,
4238
4408
  opacity
4239
4409
  });
@@ -4246,7 +4416,7 @@ var MaterialFactory = class {
4246
4416
  return this.meshStandardMaterialMap.get(key);
4247
4417
  }
4248
4418
  const material = new MeshStandardMaterial2({
4249
- color: new Color4(color).convertLinearToSRGB(),
4419
+ color: new Color5(color).convertLinearToSRGB(),
4250
4420
  roughness: 1,
4251
4421
  transparent: true,
4252
4422
  opacity,
@@ -4323,13 +4493,13 @@ var MaterialFactory = class {
4323
4493
  gl_FragColor = vec4(vColor.x, vColor.y, vColor.z, opacity);
4324
4494
  }
4325
4495
  `;
4326
- const material = new ShaderMaterial3({
4496
+ const material = new ShaderMaterial4({
4327
4497
  uniforms: {
4328
4498
  uColor: {
4329
- value: new Color4(gradualColor[0]).convertLinearToSRGB()
4499
+ value: new Color5(gradualColor[0]).convertLinearToSRGB()
4330
4500
  },
4331
4501
  uGradualColor: {
4332
- value: new Color4(gradualColor[1]).convertLinearToSRGB()
4502
+ value: new Color5(gradualColor[1]).convertLinearToSRGB()
4333
4503
  },
4334
4504
  center: {
4335
4505
  value: center2
@@ -4419,7 +4589,7 @@ var MaterialFactory = class {
4419
4589
  };
4420
4590
 
4421
4591
  // src/utils/camera-bound.ts
4422
- import { Box3 as Box38, Vector3 as Vector316 } from "three";
4592
+ import { Box3 as Box38, Vector3 as Vector317 } from "three";
4423
4593
  var CameraBound = class {
4424
4594
  constructor(context) {
4425
4595
  this.context = context;
@@ -4427,9 +4597,9 @@ var CameraBound = class {
4427
4597
  this.changePrevCamera();
4428
4598
  }
4429
4599
  prevCamera = {
4430
- position: new Vector316(),
4600
+ position: new Vector317(),
4431
4601
  zoom: 1,
4432
- target: new Vector316()
4602
+ target: new Vector317()
4433
4603
  };
4434
4604
  enable = true;
4435
4605
  setEnable(enable) {
@@ -4471,8 +4641,8 @@ var CameraBound = class {
4471
4641
  const { min, max } = box;
4472
4642
  const lb = vector3ToDevice(min, camera, w, h);
4473
4643
  const rt = vector3ToDevice(max, camera, w, h);
4474
- const lt = vector3ToDevice(new Vector316(min.x, max.y, max.z), camera, w, h);
4475
- const rb = vector3ToDevice(new Vector316(max.x, min.y, min.z), camera, w, h);
4644
+ const lt = vector3ToDevice(new Vector317(min.x, max.y, max.z), camera, w, h);
4645
+ const rb = vector3ToDevice(new Vector317(max.x, min.y, min.z), camera, w, h);
4476
4646
  const left = Math.min(lb.x, rt.x, lt.x, rb.x);
4477
4647
  const right = Math.max(lb.x, rt.x, lt.x, rb.x);
4478
4648
  const top = Math.min(lb.y, rt.y, lt.y, rb.y);
@@ -4602,7 +4772,7 @@ var Context = class extends EventDispatcher6 {
4602
4772
  /**
4603
4773
  * 获取两个点之间的像素数
4604
4774
  */
4605
- getRatio(point1 = new Vector317(0, 0, 0), point22 = new Vector317(100, 0, 0)) {
4775
+ getRatio(point1 = new Vector318(0, 0, 0), point22 = new Vector318(100, 0, 0)) {
4606
4776
  const { clientWidth, clientHeight } = this.container;
4607
4777
  const device1 = vector3ToDevice(point1, this.camera, clientWidth, clientHeight);
4608
4778
  const device2 = vector3ToDevice(point22, this.camera, clientWidth, clientHeight);
@@ -4611,7 +4781,7 @@ var Context = class extends EventDispatcher6 {
4611
4781
  changeAmbientLightColor(color) {
4612
4782
  this.lights.children.forEach((item) => {
4613
4783
  if (item instanceof AmbientLight2) {
4614
- item.color = new Color5(color);
4784
+ item.color = new Color6(color);
4615
4785
  }
4616
4786
  });
4617
4787
  }
@@ -4803,7 +4973,7 @@ var Context = class extends EventDispatcher6 {
4803
4973
  );
4804
4974
  }
4805
4975
  getCameraLookAt() {
4806
- return new Vector317().subVectors(this.control.target, this.camera.position);
4976
+ return new Vector318().subVectors(this.control.target, this.camera.position);
4807
4977
  }
4808
4978
  /**
4809
4979
  * 按照一个中心点设置相机的放大缩小
@@ -4858,10 +5028,10 @@ var Context = class extends EventDispatcher6 {
4858
5028
  const boundingBox = new Box39().setFromObject(object);
4859
5029
  this.setPolarAngle(polar, 0);
4860
5030
  const { max, min } = boundingBox;
4861
- const leftTop = new Vector317(min.x, max.y, max.z);
4862
- const rightTop = new Vector317(max.x, max.y, max.z);
4863
- const rightBottom = new Vector317(max.x, min.y, min.z);
4864
- const leftBottom = new Vector317(min.x, min.y, min.z);
5031
+ const leftTop = new Vector318(min.x, max.y, max.z);
5032
+ const rightTop = new Vector318(max.x, max.y, max.z);
5033
+ const rightBottom = new Vector318(max.x, min.y, min.z);
5034
+ const leftBottom = new Vector318(min.x, min.y, min.z);
4865
5035
  const leftTop2d = vector3ToDevice(leftTop, this.camera, width, height);
4866
5036
  const rightTop2d = vector3ToDevice(rightTop, this.camera, width, height);
4867
5037
  const leftBottom2d = vector3ToDevice(leftBottom, this.camera, width, height);
@@ -4876,7 +5046,7 @@ var Context = class extends EventDispatcher6 {
4876
5046
  const xScale = (width - right - left) / size.x;
4877
5047
  const yScale = (height - top - bottom) / size.y;
4878
5048
  const scale = Math.min(xScale, yScale);
4879
- const center2 = new Vector317((max.x + min.x) / 2, (max.y + min.y) / 2, (max.z + min.z) / 2);
5049
+ const center2 = new Vector318((max.x + min.x) / 2, (max.y + min.y) / 2, (max.z + min.z) / 2);
4880
5050
  return { zoom: scale * this.camera.zoom, center: center2 };
4881
5051
  }
4882
5052
  /**
@@ -5427,7 +5597,7 @@ var BMap = class extends EventDispatcher7 {
5427
5597
  } = this.context;
5428
5598
  const device = vector3ToDevice(position, camera, width, height);
5429
5599
  const offsetX = device.x - width / 2;
5430
- const v3 = new Vector318();
5600
+ const v3 = new Vector319();
5431
5601
  v3.setFromMatrixColumn(this.context.camera.matrix, 0);
5432
5602
  v3.normalize();
5433
5603
  v3.multiplyScalar(offsetX / this.context.camera.zoom);
@@ -5800,32 +5970,32 @@ function Worker2() {
5800
5970
 
5801
5971
  // src/plugins/navigation/path.ts
5802
5972
  import {
5803
- Mesh as Mesh7,
5804
- Object3D as Object3D15,
5973
+ Mesh as Mesh8,
5974
+ Object3D as Object3D16,
5805
5975
  TextureLoader as TextureLoader2,
5806
- Color as Color7,
5976
+ Color as Color8,
5807
5977
  Vector2 as Vector28,
5808
- Vector3 as Vector320,
5978
+ Vector3 as Vector321,
5809
5979
  NormalBlending,
5810
5980
  RepeatWrapping
5811
5981
  } from "three";
5812
5982
 
5813
5983
  // src/external/meshLine.js
5814
5984
  import {
5815
- BufferGeometry as BufferGeometry4,
5985
+ BufferGeometry as BufferGeometry5,
5816
5986
  Matrix4,
5817
- Vector3 as Vector319,
5987
+ Vector3 as Vector320,
5818
5988
  Ray as Ray2,
5819
5989
  Sphere,
5820
- LineSegments as LineSegments4,
5990
+ LineSegments as LineSegments5,
5821
5991
  BufferAttribute,
5822
5992
  ShaderChunk,
5823
- ShaderMaterial as ShaderMaterial4,
5993
+ ShaderMaterial as ShaderMaterial5,
5824
5994
  UniformsLib,
5825
- Color as Color6,
5995
+ Color as Color7,
5826
5996
  Vector2 as Vector27
5827
5997
  } from "three";
5828
- var MeshLine = class extends BufferGeometry4 {
5998
+ var MeshLine = class extends BufferGeometry5 {
5829
5999
  constructor() {
5830
6000
  super();
5831
6001
  this.isMeshLine = true;
@@ -5894,7 +6064,7 @@ MeshLine.prototype.setPoints = function(points, wcb) {
5894
6064
  this.widthCallback = wcb;
5895
6065
  this.positions = [];
5896
6066
  this.counters = [];
5897
- if (points.length && points[0] instanceof Vector319) {
6067
+ if (points.length && points[0] instanceof Vector320) {
5898
6068
  for (var j = 0; j < points.length; j++) {
5899
6069
  var p = points[j];
5900
6070
  var c = j / points.length;
@@ -5918,7 +6088,7 @@ function MeshLineRaycast(raycaster, intersects) {
5918
6088
  var inverseMatrix = new Matrix4();
5919
6089
  var ray = new Ray2();
5920
6090
  var sphere = new Sphere();
5921
- var interRay = new Vector319();
6091
+ var interRay = new Vector320();
5922
6092
  var geometry = this.geometry;
5923
6093
  if (!geometry.boundingSphere) geometry.computeBoundingSphere();
5924
6094
  sphere.copy(geometry.boundingSphere);
@@ -5928,10 +6098,10 @@ function MeshLineRaycast(raycaster, intersects) {
5928
6098
  }
5929
6099
  inverseMatrix.copy(this.matrixWorld).invert();
5930
6100
  ray.copy(raycaster.ray).applyMatrix4(inverseMatrix);
5931
- var vStart = new Vector319();
5932
- var vEnd = new Vector319();
5933
- var interSegment = new Vector319();
5934
- var step = this instanceof LineSegments4 ? 2 : 1;
6101
+ var vStart = new Vector320();
6102
+ var vEnd = new Vector320();
6103
+ var interSegment = new Vector320();
6104
+ var step = this instanceof LineSegments5 ? 2 : 1;
5935
6105
  var index = geometry.index;
5936
6106
  var attributes = geometry.attributes;
5937
6107
  if (index !== null) {
@@ -5984,8 +6154,8 @@ MeshLine.prototype.getDistance = function(i) {
5984
6154
  let maxLength = 0;
5985
6155
  for (let k = 0; k < i; k++) {
5986
6156
  const index = 6 * k;
5987
- const p0 = new Vector319(this.positions[index], this.positions[index + 1], this.positions[index + 2]);
5988
- const p1 = new Vector319(this.positions[index + 6], this.positions[index + 7], this.positions[index + 8]);
6157
+ const p0 = new Vector320(this.positions[index], this.positions[index + 1], this.positions[index + 2]);
6158
+ const p1 = new Vector320(this.positions[index + 6], this.positions[index + 7], this.positions[index + 8]);
5989
6159
  const distance = p0.distanceTo(p1);
5990
6160
  maxLength += distance;
5991
6161
  }
@@ -6242,7 +6412,7 @@ ShaderChunk["meshline_frag"] = [
6242
6412
  ShaderChunk.fog_fragment,
6243
6413
  "}"
6244
6414
  ].join("\n");
6245
- var MeshLineMaterial = class extends ShaderMaterial4 {
6415
+ var MeshLineMaterial = class extends ShaderMaterial5 {
6246
6416
  constructor(parameters) {
6247
6417
  super({
6248
6418
  uniforms: Object.assign({}, UniformsLib.fog, {
@@ -6251,7 +6421,7 @@ var MeshLineMaterial = class extends ShaderMaterial4 {
6251
6421
  useMap: { value: 0 },
6252
6422
  alphaMap: { value: null },
6253
6423
  useAlphaMap: { value: 0 },
6254
- color: { value: new Color6(16777215) },
6424
+ color: { value: new Color7(16777215) },
6255
6425
  opacity: { value: 1 },
6256
6426
  resolution: { value: new Vector27(1, 1) },
6257
6427
  sizeAttenuation: { value: 1 },
@@ -6419,7 +6589,7 @@ var MeshLineMaterial = class extends ShaderMaterial4 {
6419
6589
  }
6420
6590
  };
6421
6591
  MeshLineMaterial.prototype.copy = function(source) {
6422
- ShaderMaterial4.prototype.copy.call(this, source);
6592
+ ShaderMaterial5.prototype.copy.call(this, source);
6423
6593
  this.lineWidth = source.lineWidth;
6424
6594
  this.map = source.map;
6425
6595
  this.useMap = source.useMap;
@@ -6448,7 +6618,7 @@ var defaultConfig2 = {
6448
6618
  lineWidth: 8,
6449
6619
  color: 16777215
6450
6620
  };
6451
- var Path2 = class extends Object3D15 {
6621
+ var Path2 = class extends Object3D16 {
6452
6622
  constructor(navigation, config) {
6453
6623
  super();
6454
6624
  this.navigation = navigation;
@@ -6497,7 +6667,7 @@ var Path2 = class extends Object3D15 {
6497
6667
  }
6498
6668
  } = this;
6499
6669
  const screenPoints = points.map(
6500
- ([x, y]) => vector3ToDevice(new Vector320(x, y, 0), camera, width, height)
6670
+ ([x, y]) => vector3ToDevice(new Vector321(x, y, 0), camera, width, height)
6501
6671
  ).map(({ x, y }) => [x, y]);
6502
6672
  const pointLength = getPathLength(screenPoints);
6503
6673
  return pointLength / 32;
@@ -6540,7 +6710,7 @@ var Path2 = class extends Object3D15 {
6540
6710
  }
6541
6711
  const material = this.material = new MeshLineMaterial({
6542
6712
  useMap: true,
6543
- color: new Color7(this.config.color),
6713
+ color: new Color8(this.config.color),
6544
6714
  transparent: true,
6545
6715
  resolution: new Vector28(
6546
6716
  this.navigation.bmap.context.clientSize.width,
@@ -6553,7 +6723,7 @@ var Path2 = class extends Object3D15 {
6553
6723
  blending: NormalBlending,
6554
6724
  repeat: new Vector28(this.getRepeat(), 1)
6555
6725
  });
6556
- const mesh = this.mesh = new Mesh7(lineGeometry, material);
6726
+ const mesh = this.mesh = new Mesh8(lineGeometry, material);
6557
6727
  this.add(mesh);
6558
6728
  return mesh;
6559
6729
  }
@@ -6730,7 +6900,7 @@ var Navigation = class extends Plugin {
6730
6900
  } else {
6731
6901
  this.path = new Path2(this, this.options.path);
6732
6902
  this.path.create(cPath);
6733
- this.path.position.z = this.bmap.context.currentFloor.groundMaxHeight + 1;
6903
+ this.path.position.z = this.bmap.context.currentFloor.groundMaxHeight + 0.5;
6734
6904
  this.bmap.context.scene.add(this.path);
6735
6905
  }
6736
6906
  if (this.startPoi) {
@@ -7241,9 +7411,12 @@ var AibeeLoader = class {
7241
7411
  const graphics = [];
7242
7412
  const graphicMap = /* @__PURE__ */ new Map();
7243
7413
  transformGraphicData(layer.elements, center2);
7414
+ const canMergeGraphics = [];
7244
7415
  layer.elements.forEach((options) => {
7245
7416
  if (options.group === "ground") {
7246
7417
  floor.createGround(options);
7418
+ } else if (options.canMerge) {
7419
+ canMergeGraphics.push(options);
7247
7420
  } else {
7248
7421
  const graphic = floor.addGraphic(options);
7249
7422
  graphics.push(graphic);
@@ -7252,6 +7425,20 @@ var AibeeLoader = class {
7252
7425
  });
7253
7426
  floor.userData.graphics = graphics;
7254
7427
  floor.userData.graphicMap = graphicMap;
7428
+ const group = canMergeGraphics.reduce((obj, options) => {
7429
+ const { fillColor, fillOpacity, strokeColor, strokeOpacity, height } = options;
7430
+ const key = `${fillColor}-${fillOpacity}-${strokeColor}-${strokeOpacity}-${height}`;
7431
+ if (obj[key]) {
7432
+ obj[key].push(options);
7433
+ } else {
7434
+ obj[key] = [options];
7435
+ }
7436
+ return obj;
7437
+ }, {});
7438
+ Object.values(group).forEach((options) => {
7439
+ const mergeGeometries4 = new MergeGraphic(this.bmap.context, options);
7440
+ floor.mergeGraphicLayer.add(mergeGeometries4);
7441
+ });
7255
7442
  break;
7256
7443
  case "ground":
7257
7444
  transformGraphicData(layer.elements, center2);
@@ -7313,23 +7500,37 @@ var AibeeLoader = class {
7313
7500
  });
7314
7501
  break;
7315
7502
  case "store":
7503
+ transformGraphicData(layer.elements, center2);
7316
7504
  layer.elements.map((options) => {
7317
7505
  const pos = translatePosToCenter([options.center_x, options.center_y], center2);
7506
+ const graphic = floor.addGraphic(options);
7507
+ floor.userData.graphics.push(graphic);
7508
+ floor.userData.graphicMap.set(options.id, graphic);
7318
7509
  floor.poiLayer.createPoi({
7510
+ id: options.id,
7319
7511
  icon: options.poi_info.icon,
7320
7512
  texts: [{ text: options.store_name || options.poi_info.name }],
7321
- position: { x: pos[0], y: pos[1], z: options.airHeight }
7513
+ position: { x: pos[0], y: pos[1], z: options.airHeight },
7514
+ icon_size: [18, 18]
7322
7515
  });
7323
7516
  });
7324
7517
  break;
7325
7518
  case "facility":
7519
+ transformGraphicData(layer.elements, center2);
7326
7520
  layer.elements.map((options) => {
7327
7521
  const pos = translatePosToCenter(options.geometry.cds, center2);
7328
- floor.poiLayer.createPoi({
7329
- icon: options.poi_info.icon,
7330
- texts: [{ text: options.store_name || options.poi_info.name }],
7331
- position: { x: pos[0], y: pos[1], z: options.airHeight }
7332
- });
7522
+ const graphic = floor.addGraphic(options);
7523
+ floor.userData.graphics.push(graphic);
7524
+ floor.userData.graphicMap.set(options.id, graphic);
7525
+ if (options.poi_info) {
7526
+ floor.poiLayer.createPoi({
7527
+ id: options.id,
7528
+ icon: options.poi_info.icon,
7529
+ texts: [{ text: options.store_name || options.poi_info.name }],
7530
+ position: { x: pos[0], y: pos[1], z: options.airHeight },
7531
+ icon_size: [18, 18]
7532
+ });
7533
+ }
7333
7534
  });
7334
7535
  break;
7335
7536
  case "parkingSpace":
@@ -7341,10 +7542,13 @@ var AibeeLoader = class {
7341
7542
  parkingSpacesGraphics.push(graphic);
7342
7543
  parkingSpacesGraphicMap.set(options.id, graphic);
7343
7544
  const pos = translatePosToCenter([options.center_x, options.center_y], center2);
7344
- floor.poiLayer.createPoi({
7345
- texts: [{ text: options.text[0] }],
7346
- position: { x: pos[0], y: pos[1], z: options.airHeight }
7347
- });
7545
+ if (options.texts[0]) {
7546
+ floor.poiLayer.createPoi({
7547
+ id: options.id,
7548
+ texts: [{ text: options.texts[0] }],
7549
+ position: { x: pos[0], y: pos[1], z: options.airHeight }
7550
+ });
7551
+ }
7348
7552
  });
7349
7553
  floor.userData.parkingSpaces = parkingSpacesGraphics;
7350
7554
  floor.userData.parkingSpacesGraphicMap = parkingSpacesGraphicMap;
@@ -7353,6 +7557,7 @@ var AibeeLoader = class {
7353
7557
  });
7354
7558
  floor.userData.center = center2;
7355
7559
  floor.userData.height = data.floorHeight;
7560
+ floor.name = data.floor;
7356
7561
  return floor;
7357
7562
  }
7358
7563
  clear() {
@@ -7380,6 +7585,7 @@ export {
7380
7585
  Lane,
7381
7586
  Layer,
7382
7587
  MapTypePolar,
7588
+ MergeGraphic,
7383
7589
  Model,
7384
7590
  MulFloors,
7385
7591
  Navigation,