From 3667807a7b7418efc090ee3fa6a6b734bc3080bf Mon Sep 17 00:00:00 2001
From: xieb <vip_xiaobin810@163.com>
Date: Wed, 13 Sep 2023 20:36:29 +0800
Subject: [PATCH] Merge branch 'develop' of http://s16s652780.51mypc.cn:49896/r/yskj/iot_drone_web into develop
---
src/hooks/use-mouse-tool.ts | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/hooks/use-mouse-tool.ts b/src/hooks/use-mouse-tool.ts
index 2a5aa84..2794b7f 100644
--- a/src/hooks/use-mouse-tool.ts
+++ b/src/hooks/use-mouse-tool.ts
@@ -6,13 +6,14 @@
export function useMouseTool () {
const root = getRoot()
- const AMap = root.$aMapObj
+
const state = reactive({
pinNum: 0,
polylineNum: 0,
PolygonNum: 0,
currentType: '',
})
+
function drawPin (type:MapDoodleType, getDrawCallback:Function) {
root?.$mouseTool.marker({
title: type + state.pinNum,
@@ -21,6 +22,7 @@
state.pinNum++
root?.$mouseTool.on('draw', getDrawCallback)
}
+
function drawPolyline (type:MapDoodleType, getDrawCallback:Function) {
root?.$mouseTool.polyline({
strokeColor: '#2d8cf0',
@@ -32,6 +34,7 @@
})
root?.$mouseTool.on('draw', getDrawCallback)
}
+
function drawPolygon (type:MapDoodleType, getDrawCallback:Function) {
root?.$mouseTool.polygon({
strokeColor: '#2d8cf0',
@@ -44,10 +47,12 @@
})
root?.$mouseTool.on('draw', getDrawCallback)
}
+
function drawOff (type:MapDoodleType) {
root?.$mouseTool.close()
root?.$mouseTool.off('draw')
}
+
function mouseTool (type: MapDoodleType, getDrawCallback: Function) {
state.currentType = type
switch (type) {
@@ -65,6 +70,7 @@
break
}
}
+
return {
mouseTool
}
--
Gitblit v1.9.3