#header-mark#
Geoman Draw Control
GeomanDrawControl allows one to draw various shapes on the map. The drawing functionality on the front-end is provided by geoman.
The following shapes are supported: - marker - circlemarker - circle - polyline - rectangle - polygon - text
Additionally, there are modes that allow editing of previously drawn shapes:
- edit
- drag
- remove
- cut
- rotate
To have a drawing tool active on the map, pass it a non-empty dictionary with the desired options, see geoman documentation for details.
基础用法
API
属性
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| position | 控件位置 | enum | 'topleft' |
| draw | 绘制选项 | object | {} |
| edit | 编辑选项 | object | {} |
Events
| 事件名 | 说明 | 类型 |
|---|---|---|
| draw | 绘制完成时触发 | (layer: any) => void |
Slots
| 插槽名 | 说明 |
|---|
方法
| 方法名 | 说明 | 类型 |
|---|---|---|
| clear_text() | 清除所有文字 |
src/examples/vleaflet/controls/GeomanDraw