Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
ee990886
Commit
ee990886
authored
Sep 13, 2023
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
16a30f72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
24 deletions
+18
-24
tripmap.vue
...omponents/newTravelmanager/TravelGroupControl/tripmap.vue
+18
-24
No files found.
src/components/newTravelmanager/TravelGroupControl/tripmap.vue
View file @
ee990886
...
...
@@ -44,7 +44,7 @@
<el-color-picker
style=
"vertical-align: middle;"
v-model=
"x.ColorStr"
@
change=
"
AssemblyData
"
@
change=
"
getColorStr
"
></el-color-picker>
<div
style=
"margin-left: 5px; font-size: 23px;cursor: pointer;"
>
<i
...
...
@@ -153,14 +153,6 @@ export default {
handler
(
val
,
oldVal
)
{
// console.log(val,'-------')
if
(
this
.
NationList
.
length
==
0
)
this
.
getAddress
(
1
);
// console.log(val.TripCountryList,'TripCountryList====',val.TripCitwlist,'----------')
// let arrList = function(list){
// list.forEach(x=>{
// x.NationList = []
// x.CityListAll = []
// x.CityListIds = []
// })
// }
if
(
val
.
TripMapList
.
length
==
0
)
this
.
SearchCity
(
2
);
if
(
val
.
TripMapList
.
length
>
0
)
{
this
.
TripMapList
=
JSON
.
parse
(
JSON
.
stringify
(
val
.
TripMapList
));
...
...
@@ -233,7 +225,7 @@ export default {
this
.
map
.
fitBounds
(
bounds
,
{
padding
:
150
// 可选:在地图边界周围添加一些内边距
});
this
.
map
.
setCenter
(
bounds
.
getCenter
());
//
this.map.setCenter(bounds.getCenter());
this
.
addMarker
();
//标记
this
.
createLineHandler
();
//连线
await
this
.
addCountriesMaker
();
//标记名称
...
...
@@ -244,6 +236,7 @@ export default {
// this.initializeData()
},
methods
:
{
// 导出地图片
getResultImg
()
{
this
.
setLoading
=
true
let
that
=
this
...
...
@@ -306,15 +299,6 @@ export default {
}
});
let
poilines
=
this
.
pois
.
split
(
","
);
this
.
listCity
.
forEach
((
p
,
i
)
=>
{
if
(
this
.
map
.
getLayer
(
"curve-layer-"
+
p
.
MId
))
{
this
.
map
.
removeLayer
(
"curve-layer-"
+
p
.
MId
);
this
.
map
.
removeSource
(
"curve-source-"
+
p
.
MId
);
}
// if (i
<
poilines
.
length
-
1
)
{
// }
});
if
(
this
.
TripMapList
&&
...
...
@@ -333,7 +317,7 @@ export default {
bounds
.
extend
([
city
.
longitude
,
city
.
latitude
]);
});
this
.
map
.
fitBounds
(
bounds
);
this
.
map
.
setCenter
(
bounds
.
getCenter
());
//
this.map.setCenter(bounds.getCenter());
this
.
addMarker
();
//标记
this
.
createLineHandler
();
//连线
await
this
.
addCountriesMaker
();
//标记名字
...
...
@@ -361,6 +345,7 @@ export default {
err
=>
{}
);
},
// 添加、删除
alterCity
(
x
,
index
,
type
)
{
let
obj
=
{
CityList
:
[],
...
...
@@ -387,9 +372,12 @@ export default {
this
.
TripMapList
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
obj
)));
}
else
{
this
.
TripMapList
.
splice
(
index
,
1
);
this
.
AssemblyData
()
this
.
dataAll
.
TripMapList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
TripMapList
));
}
},
getColorStr
(){
this
.
dataAll
.
TripMapList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
TripMapList
));
},
getCityListIds
(
x
,
index
)
{
x
.
CityList
=
[];
let
obj
=
{
...
...
@@ -421,9 +409,8 @@ export default {
}
});
});
this
.
dataAll
.
TripMapList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
TripMapList
));
this
.
$forceUpdate
();
this
.
AssemblyData
(
);
this
.
dataAll
.
TripMapList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
TripMapList
)
);
},
SearchCity
(
MId
,
x
,
index
)
{
if
(
x
)
{
...
...
@@ -465,6 +452,9 @@ export default {
if
(
x
.
MName
==
"中国"
)
{
x
.
MName
=
"中华人民共和国"
;
}
if
(
this
.
map
.
getLayer
(
"world-layer-"
+
x
.
MId
))
{
this
.
map
.
removeLayer
(
"world-layer-"
+
x
.
MId
);
}
this
.
map
.
addLayer
({
id
:
"world-layer-"
+
x
.
MId
,
type
:
"fill"
,
...
...
@@ -558,6 +548,10 @@ export default {
}
]
};
if
(
this
.
map
.
getLayer
(
"curve-layer-"
+
p
.
MId
))
{
this
.
map
.
removeLayer
(
"curve-layer-"
+
p
.
MId
);
this
.
map
.
removeSource
(
"curve-source-"
+
p
.
MId
);
}
this
.
map
.
addSource
(
"curve-source-"
+
p
.
MId
,
{
type
:
"geojson"
,
data
:
geojson
...
...
@@ -714,7 +708,7 @@ export default {
left
:
0
;
right
:
0
;
background
:
#FFF
;
z-index
:
5000
;
/* z-index: 5000; */
}
body
{
...
...
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