Commit 202ba035 authored by 黄奎's avatar 黄奎
parents 7b2e370f 9f0bb087
......@@ -43,7 +43,7 @@
id="thirdAnchor" @featureCallBack="getFeature" :FeatureData="FeatureData" :TeamType="TeamType"
:isNewConfig="isNewConfig" @unlockFormCommit="unlockFormCommit" :CurrentUserInfo="CurrentUserInfo">
</TravelFeature>
<Tripmap :dataAll="PostConfig"></Tripmap>
<Tripmap :dataAll="PostConfig" :ConfigId="ConfigId"></Tripmap>
<TravelNotice :class="{'showOther':TeamType==3}" ref="TravelNotice" id="fourAnchor" @headCallBack="getNotice"
:subArray="NoticeParameters" :NoticeData="NoticeData" v-bind:PostConfig="PostConfig"
v-bind:AllCityList="AllCityList" v-bind:CountryID="PostConfig.CountryID"></TravelNotice>
......
......@@ -60,7 +60,7 @@ import worldGeoJSON from "../../../utils/geojson.json";
mapboxgl.accessToken =
"pk.eyJ1IjoiYWxleDkwMTIiLCJhIjoiY2xtOGw4NHdkMGFndTNjcnFkeWZncGc2dyJ9.lVrAdPHE0Dg5zoWFidfj4Q";
export default {
props: ["dataAll"],
props: ["dataAll","ConfigId"],
data() {
return {
deviceMarkers: [],
......@@ -112,7 +112,7 @@ export default {
{ name: "米哈斯", longitude: -4.637519, latitude: 36.595747 },
{ name: "格拉纳达", longitude: -3.599534, latitude: 37.1735 }
],
TripMapList: null
TripMapList: []
};
},
watch: {
......@@ -125,7 +125,8 @@ export default {
},
dataAll: {
handler(val, oldVal) {
this.getAddress(1);
// 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=>{
......@@ -134,6 +135,8 @@ export default {
// x.CityListIds = []
// })
// }
if(val.TripMapList.length>0){
this.TripMapList = JSON.parse(JSON.stringify(val.TripMapList))
// arrList(this.TripMapList)
let listCity = [];
......@@ -156,6 +159,7 @@ export default {
this.SearchCity(x.MId)
}
})
}
},
deep: true,
immediate: true
......@@ -163,7 +167,33 @@ export default {
},
computed: {},
mounted() {
if(this.dataAll.TripMapList.length==0){
let obj = {
CityList: [],
CityListAll: [],
CityListIds: [],
NationList: this.NationList,
ColorStr: this.dataAll.TripColor?this.dataAll.TripColor:'#409eff',
ConfigId: this.ConfigId,
Id: 0,
MId: null,
MName: null,
MType: 1,
MapLevel: 0,
MapUrl:"",
ParentId: null,
PositionStr:{
Bottom: 0,
Left: 0,
Right: 0,
Top: 0,
}
}
this.TripMapList.push(JSON.parse(JSON.stringify(obj)))
}
this.initializeData()
},
methods: {
// 更新数据
......@@ -189,10 +219,18 @@ export default {
}
})
this.countriesData.forEach((x, i) => {
if(this.map.getLayer('world-layer-'+i)) {
if(this.map&&this.map.getLayer('world-layer-'+i)) {
this.map.removeLayer('world-layer-'+i)
}
})
let poilines = this.pois.split(",");
poilines.forEach((p, i) => {
if (i < poilines.length - 1) {
this.map.removeLayer('curve-layer-'+i)
this.map.removeSource('curve-source-'+i)
}
})
if (this.pois&&this.pois!=''&&this.citys&&this.citys.length>0
&& this.countriesData &&this.countriesData.length > 0&&this.TripMapList.length==this.countriesData.length) {
......@@ -392,6 +430,9 @@ export default {
},
addCountryFillRange() {
this.countriesData.forEach((x, i) => {
if(x.MName=='中国'){
x.MName = '中华人民共和国'
}
this.map.addLayer({
id: "world-layer-" + i,
type: "fill",
......
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