Skip to content

ShapeEdit

ShapeEdit

图形编辑器

Examples

javascript
const map = new Map({...})
const shapeEdit = new ShapeEdit(map)
shapeEdit.edit('Polygon', true) // 多边形编辑+吸附

constructor

Parameters

  • map Map 地图实例
  • options ShapeEditOptions? 编辑选项

edit

启动或结束编辑

Parameters

  • type string 编辑类型 "Polygon" | "Line" | "Circle" | "Rectangle"
  • options EditOptions? 可选参数对象 (optional, default {})

Returns void

remove

删除选中的图形

Returns void

clearAll

删除地图上所有图形

Returns void

getSelectedPoints

获得当前编辑图形的点串

Returns (Array<[number, number]> | undefined)