react-baidu-map icon indicating copy to clipboard operation
react-baidu-map copied to clipboard

DrawingManager在WebGL模式下不可用,有报错

Open sknightq opened this issue 11 months ago • 2 comments

在WebGL模式下会报错 复现方式:用这个demo并开启webgl模式

  1. TypeError: Cannot read properties of undefined (reading 'offset') image
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
  })
  1. 画圆时直接报错Uncaught TypeError: Cannot read properties of null (reading 'lng'),导致无法画圆 image

sknightq avatar Jul 12 '23 01:07 sknightq