@aibee/crc-bmap 0.0.33 → 0.0.34
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 +17 -9
- 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
|
@@ -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
|
|
@@ -2659,17 +2672,12 @@ var BMap = class extends EventDispatcher6 {
|
|
|
2659
2672
|
* 根据nodeId 获取graphic
|
|
2660
2673
|
*/
|
|
2661
2674
|
getGraphicByNodeId(nodeId) {
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
}
|
|
2665
|
-
return null;
|
|
2675
|
+
var _a;
|
|
2676
|
+
return ((_a = this.context.currentFloor) == null ? void 0 : _a.graphicLayer.getGraphicByNodeId(nodeId)) || null;
|
|
2666
2677
|
}
|
|
2667
2678
|
deleteGraphic(graphic) {
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
graphic.dispose();
|
|
2671
|
-
this.context.currentFloor.graphicLayer.graphicMap.delete(graphic.options.id);
|
|
2672
|
-
}
|
|
2679
|
+
var _a;
|
|
2680
|
+
(_a = this.context.currentFloor) == null ? void 0 : _a.graphicLayer.removeGraphic(graphic);
|
|
2673
2681
|
}
|
|
2674
2682
|
createGraphicByOptions(options) {
|
|
2675
2683
|
var _a;
|