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
f5576e06
Commit
f5576e06
authored
Dec 14, 2021
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纬度拾取修改 gengdidi
parent
b40cfd04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
checkDeviceLoaction.vue
...fety-web/src/components/mapDialog/checkDeviceLoaction.vue
+9
-7
No files found.
gassafety-web/src/components/mapDialog/checkDeviceLoaction.vue
View file @
f5576e06
...
...
@@ -32,6 +32,7 @@
</el-dialog>
</
template
>
<
script
>
import
gaodeMap
from
"./js/gaodeMapDialog.js"
;
export
default
{
props
:
{
dialogTableVisible
:
false
,
...
...
@@ -54,7 +55,7 @@
let
that
=
this
;
that
.
$nextTick
(()
=>
{
//初始化地图
let
map
=
new
AMap
.
Map
(
"container1"
,
{
/*
let map = new AMap.Map("container1", {
center: [114.72995, 38.37417],
// resizeEnable: true,
disableSocket: true,
...
...
@@ -62,7 +63,8 @@
showLabel: true,
pitch: 8,
zoom: 12
});
});*/
let
gaode
=
new
gaodeMap
(
process
.
env
.
VUE_APP_MAP_CENTER
);
var
overlays
=
[];
//坐标回显
if
(
typeof
that
.
slng
==
"number"
&&
that
.
slng
!=
0
)
{
...
...
@@ -71,16 +73,16 @@
let
marker
=
new
AMap
.
Marker
({
position
:
[
that
.
slng
,
that
.
slat
]
});
marker
.
setMap
(
m
ap
);
m
ap
.
setCenter
([
that
.
slng
,
that
.
slat
]);
marker
.
setMap
(
gaode
.
myM
ap
);
gaode
.
myM
ap
.
setCenter
([
that
.
slng
,
that
.
slat
]);
overlays
.
push
(
marker
);
}
//点击获取坐标点
var
mouseTool
=
new
AMap
.
MouseTool
(
m
ap
);
var
mouseTool
=
new
AMap
.
MouseTool
(
gaode
.
myM
ap
);
//监听draw事件可获取画好的覆盖物
mouseTool
.
on
(
'draw'
,
function
(
e
){
m
ap
.
remove
(
overlays
);
gaode
.
myM
ap
.
remove
(
overlays
);
overlays
.
push
(
e
.
obj
);
that
.
lnglat
.
lat
=
e
.
obj
.
_position
.
lat
;
that
.
lnglat
.
lng
=
e
.
obj
.
_position
.
lng
;
...
...
@@ -90,7 +92,7 @@
//搜索功能
AMap
.
plugin
([
"AMap.AutoComplete"
,
"AMap.PlaceSearch"
],
function
()
{
that
.
placeSearch
=
new
AMap
.
PlaceSearch
({
map
:
m
ap
map
:
gaode
.
myM
ap
});
});
})
...
...
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