Commit ee990886 authored by youjie's avatar youjie

no message

parent 16a30f72
......@@ -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 {
......
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