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
db28bd7d
Commit
db28bd7d
authored
Aug 19, 2021
by
纪泽龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_jzl'
parents
54e22055
5d8b5187
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
1 deletion
+47
-1
gaodeMap.js
gassafety-web/src/utils/gaodeMap.js
+47
-1
No files found.
gassafety-web/src/utils/gaodeMap.js
View file @
db28bd7d
...
...
@@ -221,7 +221,7 @@ class gaodeMap {
const
ind
=
that
.
markers
.
indexOf
(
marker
);
if
(
ind
>=
0
)
{
that
.
markers
.
splice
(
ind
,
1
);
console
.
log
(
that
.
markers
)
console
.
log
(
that
.
markers
)
;
}
}
});
...
...
@@ -968,5 +968,51 @@ class gaodeMap {
this
.
mouseTool
.
close
();
map
.
remove
(
this
.
markerOverlays
);
}
// 只上图没功能
onlyLine
(
obj
)
{
const
{
coordinates
,
pipeName
}
=
obj
;
let
polyline
=
new
AMap
.
Polyline
({
path
:
eval
(
coordinates
),
strokeColor
:
"#80d8ff"
,
strokeWeight
:
4
,
strokeOpacity
:
0.9
,
zIndex
:
50
,
bubble
:
true
,
geodesic
:
true
,
extData
:
{
type
:
"line"
,
//当前line状态 0:正常状态 1:正在编辑状态
isState
:
0
,
lineData
:
obj
}
});
let
infoWindow
=
new
AMap
.
InfoWindow
({
isCustom
:
true
,
content
:
`<span style='border:1px solid #80d8ff;background:#fff'>
${
pipeName
}
</span>`
,
anchor
:
"left-top"
,
offset
:
new
AMap
.
Pixel
(
20
,
-
20
),
});
polyline
.
on
(
"mouseover"
,
e
=>
{
const
options
=
polyline
.
getOptions
();
options
.
strokeColor
=
"#FF5A67"
;
polyline
.
setOptions
(
options
);
infoWindow
.
open
(
map
,
e
.
lnglat
);
});
polyline
.
on
(
"mouseout"
,
e
=>
{
const
options
=
polyline
.
getOptions
();
options
.
strokeColor
=
"#80d8ff"
;
polyline
.
setOptions
(
options
);
infoWindow
.
close
();
});
map
.
add
(
polyline
);
const
path
=
eval
(
coordinates
)[
0
];
// map.setFitView();
map
.
setCenter
([
+
path
[
0
],
+
path
[
1
]],
false
)
// const lntlat = eval(coordinates)[0];
// map.panTo(lntlat)
// 信息窗体
}
}
export
default
gaodeMap
;
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