@aibee/crc-bmap 0.0.35 → 0.0.37

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
@@ -146,20 +146,18 @@ function initCamera(width, height) {
146
146
  }
147
147
  function initLight() {
148
148
  const lights = new Group();
149
- const hemisphereLight = new HemisphereLight(16777215, 15658734, 1);
149
+ const hemisphereLight = new HemisphereLight(16777215, 16777215, 2);
150
150
  hemisphereLight.intensity = 1;
151
151
  hemisphereLight.position.set(0, 0, 10);
152
152
  hemisphereLight.up.set(0, 0, 1);
153
153
  lights.add(hemisphereLight);
154
- const ambientLight = new AmbientLight(16777215);
154
+ const ambientLight = new AmbientLight(16777215, 1);
155
155
  lights.add(ambientLight);
156
156
  return lights;
157
157
  }
158
158
  function initControl(camera, domElement) {
159
159
  const control = new MapControls(camera, domElement);
160
160
  control.enableDamping = false;
161
- control.maxPolarAngle = 0;
162
- control.minPolarAngle = 0;
163
161
  control.zoomSpeed = 2;
164
162
  return control;
165
163
  }
@@ -374,6 +372,11 @@ function sleepOnePromise() {
374
372
  return Promise.resolve();
375
373
  }
376
374
 
375
+ // src/utils/color.ts
376
+ function strToNumber(str) {
377
+ return parseInt(str.replace("#", "0x"), 16);
378
+ }
379
+
377
380
  // src/context.ts
378
381
  import {
379
382
  EventDispatcher as EventDispatcher5,
@@ -623,7 +626,7 @@ var Shadow = class extends Object3D2 {
623
626
  });
624
627
  const mesh = new Mesh2(geometry, material);
625
628
  mesh.receiveShadow = true;
626
- mesh.position.z = -5;
629
+ mesh.position.z = -7;
627
630
  this.add(mesh);
628
631
  this.plane = mesh;
629
632
  return mesh;
@@ -2042,6 +2045,7 @@ var Context = class extends EventDispatcher5 {
2042
2045
  this.camera = initCamera(w, h);
2043
2046
  this.renderer.setSize(w, h);
2044
2047
  this.control = initControl(this.camera, this.renderer.domElement);
2048
+ this.control.maxPolarAngle = this.config.control.maxPolar;
2045
2049
  this.container.appendChild(this.renderer.domElement);
2046
2050
  this.scene.add(this.lights);
2047
2051
  this.basicRatio = this.getRatio();
@@ -2142,6 +2146,8 @@ var Context = class extends EventDispatcher5 {
2142
2146
  this.control.update();
2143
2147
  }).onComplete(() => {
2144
2148
  this.control.enabled = true;
2149
+ this.control.maxPolarAngle = this.config.control.maxPolar;
2150
+ this.control.minPolarAngle = 0;
2145
2151
  this.tweenGroup.remove(tween);
2146
2152
  resolve(true);
2147
2153
  }).onStart(() => {
@@ -2290,7 +2296,7 @@ var defaultConfig = {
2290
2296
  },
2291
2297
  useFloorCache: true,
2292
2298
  control: {
2293
- maxPolar: 1.2
2299
+ maxPolar: 1
2294
2300
  },
2295
2301
  svg: {
2296
2302
  circle: {
@@ -2447,10 +2453,19 @@ var BMap = class extends EventDispatcher6 {
2447
2453
  return { curFloor, graphics: [] };
2448
2454
  }
2449
2455
  const grounds = data.filter((item) => item.info.group === "ground");
2450
- grounds.forEach((item) => item.info.fillColor = "#F5F7F9");
2456
+ grounds.forEach((item) => {
2457
+ item.info.fillColor = "#F5F7F9";
2458
+ item.info.fillOpacity = 1;
2459
+ item.info.strokeOpacity = 0;
2460
+ item.info.height = 5;
2461
+ });
2451
2462
  const groundGraphics = grounds.map((ground) => new Graphic(this.context, ground.info));
2452
2463
  curFloor.addGrounds(groundGraphics);
2453
2464
  const graphicData = data.filter((item) => item.info.group !== "ground");
2465
+ graphicData.forEach((item) => {
2466
+ item.info.airHeight = 5;
2467
+ item.info.height = 5;
2468
+ });
2454
2469
  const legacyToGraphicMap = /* @__PURE__ */ new Map();
2455
2470
  const graphics = graphicData.map((item) => {
2456
2471
  const graphic = curFloor.addGraphic(item.info);
@@ -2553,7 +2568,7 @@ var BMap = class extends EventDispatcher6 {
2553
2568
  if (type === "2d") {
2554
2569
  this.context.setPolarAngle(0);
2555
2570
  } else {
2556
- this.context.setPolarAngle(1.2);
2571
+ this.context.setPolarAngle(1);
2557
2572
  }
2558
2573
  }
2559
2574
  /**
@@ -2777,6 +2792,7 @@ export {
2777
2792
  setLineStartEnd,
2778
2793
  setRectPosition,
2779
2794
  sleepOnePromise,
2795
+ strToNumber,
2780
2796
  timeoutPromise,
2781
2797
  vector3ToDevice
2782
2798
  };