|
@@ -13,6 +13,7 @@ import { unByKey } from 'ol/Observable'
|
|
import {createBox} from "ol/interaction/Draw";
|
|
import {createBox} from "ol/interaction/Draw";
|
|
import {Circle, LineString, Polygon} from "ol/geom";
|
|
import {Circle, LineString, Polygon} from "ol/geom";
|
|
import {formatPosition} from '@/utils/easyMap'
|
|
import {formatPosition} from '@/utils/easyMap'
|
|
|
|
+import store from "@/store";
|
|
|
|
|
|
const layerFlag = ['layerName', 'selectDrawLayer']
|
|
const layerFlag = ['layerName', 'selectDrawLayer']
|
|
let drawTooltipElement;
|
|
let drawTooltipElement;
|
|
@@ -181,6 +182,7 @@ export default function SelectDraw (map, typeSelect) {
|
|
let listener;
|
|
let listener;
|
|
//绑定交互绘制工具开始绘制的事件
|
|
//绑定交互绘制工具开始绘制的事件
|
|
const drawstartHandle = (evt) => {
|
|
const drawstartHandle = (evt) => {
|
|
|
|
+ store.dispatch('gis/LOAD_IS_TOOLING', true)
|
|
sketch = evt.feature; //绘制的要素
|
|
sketch = evt.feature; //绘制的要素
|
|
let tooltipCoord = evt.coordinate;// 绘制的坐标
|
|
let tooltipCoord = evt.coordinate;// 绘制的坐标
|
|
//绑定change事件,根据绘制几何类型得到测量长度值或面积值,并将其设置到测量工具提示框中显示
|
|
//绑定change事件,根据绘制几何类型得到测量长度值或面积值,并将其设置到测量工具提示框中显示
|
|
@@ -212,6 +214,9 @@ export default function SelectDraw (map, typeSelect) {
|
|
document.body.removeChild(str)
|
|
document.body.removeChild(str)
|
|
}
|
|
}
|
|
const drawendHandle = (evt) => {
|
|
const drawendHandle = (evt) => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ store.dispatch('gis/LOAD_IS_TOOLING', false)
|
|
|
|
+ }, 300)
|
|
map.removeInteraction(map.getInteractions().getArray().filter(v => v.get(drawId) === drawId)[0]);
|
|
map.removeInteraction(map.getInteractions().getArray().filter(v => v.get(drawId) === drawId)[0]);
|
|
// const del = document.createElement("div");
|
|
// const del = document.createElement("div");
|
|
// del.className = "lineDel";
|
|
// del.className = "lineDel";
|