react-baidu-map
react-baidu-map copied to clipboard
DrawingManager在WebGL模式下不可用,有报错
在WebGL模式下会报错 复现方式:用这个demo并开启webgl模式
- TypeError: Cannot read properties of undefined (reading 'offset')
const { drawingManager } = useDrawingManager({
map,
isOpen: true,
enableDrawingTool: true,
drawingToolOptions: {
anchor: BMAP_ANCHOR_TOP_RIGHT, // 位置, 这个用WebGL开启会报 Cannot read properties of undefined (reading 'offset')错误,不传这个参数才能正常渲染,但是不能修改控件位置(只能用CSS修改)
offset: new BMap.Size(5, 5),
drawingModes: ['circle', 'polygon'],
},
circleOptions: styleOptions,
polylineOptions: styleOptions,
polygonOptions: styleOptions,
rectangleOptions: styleOptions
})
- 画圆时直接报错Uncaught TypeError: Cannot read properties of null (reading 'lng'),导致无法画圆