@aibee/crc-bmap 0.0.33 → 0.0.35
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.cjs.min.js +2 -2
- package/lib/bmap.cjs.min.js.map +3 -3
- package/lib/bmap.esm.js +19 -10
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +2 -2
- package/lib/bmap.esm.min.js.map +3 -3
- package/lib/bmap.min.js +2 -2
- package/lib/bmap.min.js.map +3 -3
- package/lib/src/layer/graphic-layer.d.ts +3 -0
- package/package.json +1 -1
package/lib/bmap.esm.js
CHANGED
|
@@ -178,7 +178,7 @@ function initDirectionalLight(color = 16777215, intensity = 1) {
|
|
|
178
178
|
directionalLight.castShadow = true;
|
|
179
179
|
directionalLight.shadow.radius = 8;
|
|
180
180
|
directionalLight.shadow.bias = -1e-3;
|
|
181
|
-
directionalLight.shadow.mapSize.set(
|
|
181
|
+
directionalLight.shadow.mapSize.set(64, 64);
|
|
182
182
|
directionalLight.shadow.camera.left = -200;
|
|
183
183
|
directionalLight.shadow.camera.right = 200;
|
|
184
184
|
directionalLight.shadow.camera.top = 200;
|
|
@@ -920,6 +920,19 @@ var GraphicLayer = class extends Layer {
|
|
|
920
920
|
this.graphicMap.set(options.id, graphic);
|
|
921
921
|
return graphic;
|
|
922
922
|
}
|
|
923
|
+
removeGraphic(graphic) {
|
|
924
|
+
this.remove(graphic);
|
|
925
|
+
this.graphicMap.delete(graphic.options.id);
|
|
926
|
+
graphic.dispose();
|
|
927
|
+
}
|
|
928
|
+
removeGraphicById(id) {
|
|
929
|
+
if (this.graphicMap.has(id)) {
|
|
930
|
+
this.removeGraphic(this.graphicMap.get(id));
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
getGraphicByNodeId(id) {
|
|
934
|
+
return this.graphicMap.get(id) || null;
|
|
935
|
+
}
|
|
923
936
|
/**
|
|
924
937
|
* 获取射线相交的元素
|
|
925
938
|
* @param raycaster
|
|
@@ -2434,6 +2447,7 @@ var BMap = class extends EventDispatcher6 {
|
|
|
2434
2447
|
return { curFloor, graphics: [] };
|
|
2435
2448
|
}
|
|
2436
2449
|
const grounds = data.filter((item) => item.info.group === "ground");
|
|
2450
|
+
grounds.forEach((item) => item.info.fillColor = "#F5F7F9");
|
|
2437
2451
|
const groundGraphics = grounds.map((ground) => new Graphic(this.context, ground.info));
|
|
2438
2452
|
curFloor.addGrounds(groundGraphics);
|
|
2439
2453
|
const graphicData = data.filter((item) => item.info.group !== "ground");
|
|
@@ -2659,17 +2673,12 @@ var BMap = class extends EventDispatcher6 {
|
|
|
2659
2673
|
* 根据nodeId 获取graphic
|
|
2660
2674
|
*/
|
|
2661
2675
|
getGraphicByNodeId(nodeId) {
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
}
|
|
2665
|
-
return null;
|
|
2676
|
+
var _a;
|
|
2677
|
+
return ((_a = this.context.currentFloor) == null ? void 0 : _a.graphicLayer.getGraphicByNodeId(nodeId)) || null;
|
|
2666
2678
|
}
|
|
2667
2679
|
deleteGraphic(graphic) {
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
graphic.dispose();
|
|
2671
|
-
this.context.currentFloor.graphicLayer.graphicMap.delete(graphic.options.id);
|
|
2672
|
-
}
|
|
2680
|
+
var _a;
|
|
2681
|
+
(_a = this.context.currentFloor) == null ? void 0 : _a.graphicLayer.removeGraphic(graphic);
|
|
2673
2682
|
}
|
|
2674
2683
|
createGraphicByOptions(options) {
|
|
2675
2684
|
var _a;
|