From d8b1c86a025f4ab44cb46dd15c9c5e0d82f28fba Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 14 Dec 2021 15:18:18 +0800
Subject: [PATCH] +包Draw引出
---
src/components/map/main.vue | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/components/map/main.vue b/src/components/map/main.vue
index 3585e8f..f92a1aa 100644
--- a/src/components/map/main.vue
+++ b/src/components/map/main.vue
@@ -68,7 +68,7 @@
import VectorSource from "ol/source/Vector";
import { OSM, TileWMS, Vector } from "ol/source";
-import Draw from "ol/interaction/Draw";
+import Draw from "./Draw";
import Feature from "ol/Feature.js";
import Point from "ol/geom/Point.js";
@@ -364,9 +364,9 @@
}),
coordinate: function (res) {
//画线中的点
- that.coordinates.push(res.coordinate_);
+ that.coordinates.push(res);
that.tipTitle = "可继续,或选择最终位置双击结束";
- // console.log(res.coordinate_, 123456);
+ // console.log(res, 123456);
},
coordinateOver: function (res) {
// 结束绘画 处理数据
@@ -402,6 +402,7 @@
}
}
str += ")";
+ // console.log(str, 111);
return str;
},
addLinesDraw(val) {
@@ -464,7 +465,7 @@
if (that.draw != null) {
that.beginDraw = false;
that.butTitle = "重新绘画";
- that.draw.controlDrawing(true);
+ that.draw.abortDrawing_();
that.tipTitle = "已结束绘画,点击重新绘画清除上次内容并开始绘画";
$("#map").unbind("mousemove");
// setTimeout(() => {
--
Gitblit v1.9.3