Commit ce43791c authored by youjie's avatar youjie

no message

parent ee990886
......@@ -151,7 +151,6 @@ export default {
},
dataAll: {
handler(val, oldVal) {
// console.log(val,'-------')
if (this.NationList.length == 0) this.getAddress(1);
if (val.TripMapList.length == 0) this.SearchCity(2);
if (val.TripMapList.length > 0) {
......@@ -192,6 +191,11 @@ export default {
},
computed: {},
mounted() {
this.initMap()
},
methods: {
// 初始化地图
initMap(){
this.map = new mapboxgl.Map({
container: "trip_map",
style: "mapbox://styles/alex9012/clm92pvs1011j01qzexlh6g2b", // 'mapbox://styles/mapbox/light-v9','mapbox://styles/alex9012/clm92pvs1011j01qzexlh6g2b'
......@@ -232,10 +236,7 @@ export default {
}
});
//this.addDocumentEventListener();
// this.initializeData()
},
methods: {
// 导出地图片
getResultImg() {
this.setLoading = true
......@@ -323,6 +324,7 @@ export default {
await this.addCountriesMaker(); //标记名字
}
},
// 获取国家
async getAddress(Type) {
this.loading = true;
await this.apipost(
......@@ -378,6 +380,7 @@ export default {
getColorStr(){
this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
},
// 城市ids
getCityListIds(x, index) {
x.CityList = [];
let obj = {
......@@ -412,6 +415,7 @@ export default {
this.$forceUpdate();
this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
},
// 查询城市
SearchCity(MId, x, index) {
if (x) {
x.NationList.forEach(item => {
......@@ -660,7 +664,7 @@ export default {
.setLngLat(result)
.addTo(this.map);
const offset = marker.getOffset();
console.log(offset, "----");
console.log(offset, "----offset");
}
})
);
......
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