Commit ee990886 authored by youjie's avatar youjie

no message

parent 16a30f72
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<el-color-picker <el-color-picker
style="vertical-align: middle;" style="vertical-align: middle;"
v-model="x.ColorStr" v-model="x.ColorStr"
@change="AssemblyData" @change="getColorStr"
></el-color-picker> ></el-color-picker>
<div style="margin-left: 5px; font-size: 23px;cursor: pointer;"> <div style="margin-left: 5px; font-size: 23px;cursor: pointer;">
<i <i
...@@ -153,14 +153,6 @@ export default { ...@@ -153,14 +153,6 @@ export default {
handler(val, oldVal) { handler(val, oldVal) {
// console.log(val,'-------') // console.log(val,'-------')
if (this.NationList.length == 0) this.getAddress(1); 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.SearchCity(2);
if (val.TripMapList.length > 0) { if (val.TripMapList.length > 0) {
this.TripMapList = JSON.parse(JSON.stringify(val.TripMapList)); this.TripMapList = JSON.parse(JSON.stringify(val.TripMapList));
...@@ -233,7 +225,7 @@ export default { ...@@ -233,7 +225,7 @@ export default {
this.map.fitBounds(bounds, { this.map.fitBounds(bounds, {
padding: 150 // 可选:在地图边界周围添加一些内边距 padding: 150 // 可选:在地图边界周围添加一些内边距
}); });
this.map.setCenter(bounds.getCenter()); // this.map.setCenter(bounds.getCenter());
this.addMarker(); //标记 this.addMarker(); //标记
this.createLineHandler(); //连线 this.createLineHandler(); //连线
await this.addCountriesMaker(); //标记名称 await this.addCountriesMaker(); //标记名称
...@@ -244,6 +236,7 @@ export default { ...@@ -244,6 +236,7 @@ export default {
// this.initializeData() // this.initializeData()
}, },
methods: { methods: {
// 导出地图片
getResultImg() { getResultImg() {
this.setLoading = true this.setLoading = true
let that = this let that = this
...@@ -306,15 +299,6 @@ export default { ...@@ -306,15 +299,6 @@ export default {
} }
}); });
let poilines = this.pois.split(","); 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 ( if (
this.TripMapList && this.TripMapList &&
...@@ -333,7 +317,7 @@ export default { ...@@ -333,7 +317,7 @@ export default {
bounds.extend([city.longitude, city.latitude]); bounds.extend([city.longitude, city.latitude]);
}); });
this.map.fitBounds(bounds); this.map.fitBounds(bounds);
this.map.setCenter(bounds.getCenter()); // this.map.setCenter(bounds.getCenter());
this.addMarker(); //标记 this.addMarker(); //标记
this.createLineHandler(); //连线 this.createLineHandler(); //连线
await this.addCountriesMaker(); //标记名字 await this.addCountriesMaker(); //标记名字
...@@ -361,6 +345,7 @@ export default { ...@@ -361,6 +345,7 @@ export default {
err => {} err => {}
); );
}, },
// 添加、删除
alterCity(x, index, type) { alterCity(x, index, type) {
let obj = { let obj = {
CityList: [], CityList: [],
...@@ -387,9 +372,12 @@ export default { ...@@ -387,9 +372,12 @@ export default {
this.TripMapList.push(JSON.parse(JSON.stringify(obj))); this.TripMapList.push(JSON.parse(JSON.stringify(obj)));
} else { } else {
this.TripMapList.splice(index, 1); 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) { getCityListIds(x, index) {
x.CityList = []; x.CityList = [];
let obj = { let obj = {
...@@ -421,9 +409,8 @@ export default { ...@@ -421,9 +409,8 @@ export default {
} }
}); });
}); });
this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
this.$forceUpdate(); this.$forceUpdate();
this.AssemblyData(); this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
}, },
SearchCity(MId, x, index) { SearchCity(MId, x, index) {
if (x) { if (x) {
...@@ -465,6 +452,9 @@ export default { ...@@ -465,6 +452,9 @@ export default {
if (x.MName == "中国") { if (x.MName == "中国") {
x.MName = "中华人民共和国"; x.MName = "中华人民共和国";
} }
if (this.map.getLayer("world-layer-" + x.MId)) {
this.map.removeLayer("world-layer-" + x.MId);
}
this.map.addLayer({ this.map.addLayer({
id: "world-layer-" + x.MId, id: "world-layer-" + x.MId,
type: "fill", type: "fill",
...@@ -558,6 +548,10 @@ export default { ...@@ -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, { this.map.addSource("curve-source-" + p.MId, {
type: "geojson", type: "geojson",
data: geojson data: geojson
...@@ -714,7 +708,7 @@ export default { ...@@ -714,7 +708,7 @@ export default {
left: 0; left: 0;
right: 0; right: 0;
background: #FFF; background: #FFF;
z-index: 5000; /* z-index: 5000; */
} }
body { body {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment