明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jt_front
Project
Project
Details
Activity
Releases
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
Administrator
jt_front
Commits
47077233
Commit
47077233
authored
Dec 03, 2025
by
chenron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清除标记
parent
32460c79
Pipeline
#104091
passed with stage
in 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
CommonMap.vue
src/components/CommonMap.vue
+12
-0
No files found.
src/components/CommonMap.vue
View file @
47077233
...
@@ -172,6 +172,13 @@ const handleAddMarket = (selectName) => {
...
@@ -172,6 +172,13 @@ const handleAddMarket = (selectName) => {
currentMarkers
=
[];
currentMarkers
=
[];
}
}
// 额外确保清除所有标记(防止其他地方创建的标记)
if
(
map
)
{
map
.
getAllOverlays
(
"marker"
).
forEach
((
marker
)
=>
{
map
.
remove
(
marker
);
});
}
// 根据不同状态定义标记数据
// 根据不同状态定义标记数据
const
markerData
=
{
const
markerData
=
{
建设
:
[
建设
:
[
...
@@ -219,6 +226,11 @@ const handleAddMarket = (selectName) => {
...
@@ -219,6 +226,11 @@ const handleAddMarket = (selectName) => {
const
positionsList
=
markerData
[
selectName
]
||
[];
const
positionsList
=
markerData
[
selectName
]
||
[];
// 如果是"立项"或者没有数据,直接返回,不创建任何标记
if
(
!
positionsList
||
positionsList
.
length
===
0
)
{
return
;
}
// 创建新的标记
// 创建新的标记
for
(
var
i
=
0
;
i
<
positionsList
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
positionsList
.
length
;
i
++
)
{
const
marker
=
new
AMap
.
Marker
({
const
marker
=
new
AMap
.
Marker
({
...
...
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