Bootstrap

mapbox-gl-draw 绘制态势标绘-进攻方向(尾巴)

DrawAttackArrowTail.js

import{CreateAttackArrowTail}from"./CreateAttackArrowTail";import createVertex from"@mapbox/mapbox-gl-draw/src/lib/create_vertex";const Constants=require("@mapbox/mapbox-gl-draw/src/constants");import*as CommonSelectors from"@mapbox/mapbox-gl-draw/src/lib/common_selectors";import isEventAtCoordinates from"@mapbox/mapbox-gl-draw/src/lib/is_event_at_coordinates";const doubleClickZoom={enable(t){setTimeout(()=>{t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()},0)},disable(t){setTimeout(()=>{t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()},0)}},DrawAttackArrowTail={onSetup:function(t){const e=this.newFeature({type:Constants.geojsonTypes.FEATURE,properties:{isAttackArrowTail:!0},geometry:{type:Constants.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),doubleClickZoom.disable(this),this.updateUIClasses({mouse:Constants.cursors.ADD}),this.activateUIButton(Constants.types.POLYGON),this.setActionableState({trash:!0}),{attackArrowTail:e,currentVertexPosition:0}},onTap:function(t,e){t.attackArrowTail.properties.attackArrowTailPoint1&&this.onMouseMove(t,e),this.onClick(t,e)},onKeyUp:function(t,e){CommonSelectors.isEscapeKey(e)?(this.deleteFeature([t.attackArrowTail.id],{silent:!0}),this.changeMode(Constants.modes.SIMPLE_SELECT)):CommonSelectors.isEnterKey(e)&&this.changeMode
;