Commit 913d8557 authored by youjie's avatar youjie

no message

parent 7888e0a0
......@@ -241,7 +241,7 @@ export default {
this.TripMapList.push(JSON.parse(JSON.stringify(obj)));
}
console.log(this.TripMapList, "----TripMapList");
// console.log(this.TripMapList, "----TripMapList");
},
deep: true,
immediate: true
......@@ -367,7 +367,6 @@ export default {
this.SearchCity(x.MId);
}
});
console.log(this.countriesData,'------=====')
},
// 清除已有源
ClearSource(Id,type){
......@@ -413,7 +412,9 @@ export default {
this.map.fitBounds(bounds,{
padding: 150, // 可选:在地图边界周围添加一些内边距
});
// this.map.setCenter(bounds.getCenter());
if(this.countriesData&&this.countriesData.length>0&&this.countriesData.length==1){
this.map.setCenter(bounds.getCenter());
}
this.addMarker(); //标记
this.createLineHandler(); //连线
await this.addCountriesMaker(); //标记国家
......@@ -912,9 +913,13 @@ export default {
});
marker.setLngLat(result);
marker.addTo(this.map);
let currentMarkerLngLat = marker.getLngLat();
let TripMapList = that.TripMapList.filter(y=> y.MName==x.MName)
TripMapList[0].Lng = currentMarkerLngLat.lng;
TripMapList[0].Lat = currentMarkerLngLat.lat;
marker.on("dragend", function() {
let currentMarkerLngLat = marker.getLngLat();
let TripMapList = that.TripMapList.filter(y=> y.MName==x.MName)
currentMarkerLngLat = marker.getLngLat();
TripMapList = that.TripMapList.filter(y=> y.MName==x.MName)
TripMapList[0].Lng = currentMarkerLngLat.lng;
TripMapList[0].Lat = currentMarkerLngLat.lat;
});
......
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