代码
const map = new BMap.Map('map');
map.centerAndZoom(new BMap.Point(116.404, 39.915), 15);

var path = [
  new BMap.Point(116.399, 39.91),
  new BMap.Point(116.405, 39.92),
  new BMap.Point(116.423493, 39.907445),
];
// 绘制线
var polygon = new BMap.Polygon(path, {
  // 可以在初始化时通过 enableEditing 配置开启,默认false
  enableEditing: true,
});
map.addOverlay(polygon);

function enable() {
  polygon.enableEditing();
}

function disable() {
  polygon.disableEditing();
}
预览