Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
gassafety
Commits
714b524f
Commit
714b524f
authored
Jul 20, 2021
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备管理 gengdidi
parent
d4d3b9f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
gaodeMap.js
gassafety-web/src/utils/gaodeMap.js
+22
-4
index.vue
gassafety-web/src/views/enterprise/map/index.vue
+3
-0
No files found.
gassafety-web/src/utils/gaodeMap.js
View file @
714b524f
...
@@ -95,8 +95,6 @@ export const DEVICE_TYPE = {
...
@@ -95,8 +95,6 @@ export const DEVICE_TYPE = {
position
:
lnglats
[
i
],
position
:
lnglats
[
i
],
map
:
map
,
map
:
map
,
offset
:
new
AMap
.
Pixel
(
-
13
,
-
30
),
offset
:
new
AMap
.
Pixel
(
-
13
,
-
30
),
// 设置是否可以拖拽
draggable
:
true
,
cursor
:
'move'
,
cursor
:
'move'
,
// 设置拖拽效果
// 设置拖拽效果
raiseOnDrag
:
true
raiseOnDrag
:
true
...
@@ -122,9 +120,11 @@ export const DEVICE_TYPE = {
...
@@ -122,9 +120,11 @@ export const DEVICE_TYPE = {
}
}
});
});
marker
.
on
(
'dragend'
,
function
(
e
)
{
marker
.
on
(
'dragend'
,
function
(
e
)
{
alert
(
e
.
lnglat
);
editWindow
.
editForm
.
longitude
=
e
.
lnglat
.
lng
;
editWindow
.
editForm
.
latitude
=
e
.
lnglat
.
lat
;
console
.
log
(
e
.
lnglat
,
"rrrr===="
);
});
});
//
this.markers.push(marker);
this
.
markers
.
push
(
marker
);
}
}
map
.
setFitView
();
map
.
setFitView
();
...
@@ -139,6 +139,24 @@ export const DEVICE_TYPE = {
...
@@ -139,6 +139,24 @@ export const DEVICE_TYPE = {
}
}
/**
* marker添加拖拽事件
*/
addMarkerDragg
(){
for
(
var
i
=
0
;
i
<
this
.
markers
.
length
;
i
++
){
this
.
markers
[
i
].
setDraggable
(
true
);
}
}
/**
* marker移除拖拽事件
*/
removeMarkerDragg
(){
for
(
var
i
=
0
;
i
<
this
.
markers
.
length
;
i
++
){
this
.
markers
[
i
].
setDraggable
(
false
);
}
}
/**
/**
...
...
gassafety-web/src/views/enterprise/map/index.vue
View file @
714b524f
...
@@ -73,14 +73,17 @@
...
@@ -73,14 +73,17 @@
addDevice
(){
addDevice
(){
this
.
deviceType
=
true
;
this
.
deviceType
=
true
;
this
.
gaoMap
.
mapOperateType
=
"add"
;
this
.
gaoMap
.
mapOperateType
=
"add"
;
this
.
gaoMap
.
removeMarkerDragg
();
},
},
editDevice
(){
editDevice
(){
this
.
deviceType
=
false
;
this
.
deviceType
=
false
;
this
.
gaoMap
.
mapOperateType
=
"edit"
;
this
.
gaoMap
.
mapOperateType
=
"edit"
;
this
.
gaoMap
.
addMarkerDragg
();
},
},
deleteDevice
(){
deleteDevice
(){
this
.
deviceType
=
false
;
this
.
deviceType
=
false
;
this
.
gaoMap
.
mapOperateType
=
"delete"
;
this
.
gaoMap
.
mapOperateType
=
"delete"
;
this
.
gaoMap
.
removeMarkerDragg
();
},
},
selectDeviceType
(
val
){
selectDeviceType
(
val
){
// if("add" == this.operationType){
// if("add" == this.operationType){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment