描述:禁止拖拽 默认值:undefined disableSelect?: boolean 描述:禁止选中 默认值:undefined measureOptions?: MapboxDrawOptions['measureOptions'] 描述:测量配置 默认值:undefined enable?: boolean 描述:是否启用测量功能 默认值:undefined unit?: object
重写direct_select 这里是编辑模式控制拖拽圆的可编辑顶点时改变圆的半径(否则圆会被当成普通多边形拽变形) letDirectModeOverride=MapboxDraw.modes.direct_select;// 拖拽顶点改变圆的半径DirectModeOverride.dragVertex=function(state, e, delta) {constselectedCoords = state.selectedCoordPaths.map((coord_path) =...
自定义绘制类CustomDraw.js export defaultclassCustomDraw{constructor(drawType) {this._map = window.map;this._draw = window.draw;this.drawType = drawType ||"single";// 默认单图形模式,即新画出新图形时清除之前画的图形if(this.drawType ==="view") {// view 仅查看模式,禁止编辑this.enableEdit(...