Commit 34cb439d authored by youjie's avatar youjie

no message

parent dbbb12cb
......@@ -300,16 +300,6 @@ export default {
this.SearchCity(x.MId);
}
});
this.countriesData.forEach((x, i) => {
if(this.map && this.map.getLayer("world-layer-" + x.MId)) {
this.map.removeLayer("world-layer-" + x.MId);
this.map.removeSource("word-source" + x.MId);
}
if (this.map && this.map.getLayer("world-layer-" + x.MId)) {
this.map.removeLayer("world-layer-" + x.MId);
}
});
let poilines = this.pois.split(",");
if (
this.TripMapList &&
......@@ -383,6 +373,17 @@ export default {
if (type) {
this.TripMapList.push(JSON.parse(JSON.stringify(obj)));
} else {
let MId = this.countriesData[index].MId
if(this.map.getLayer("curve-layer-" + MId)) {
this.map.removeLayer("curve-layer-" + MId);
this.map.removeSource("curve-source-" + MId);
}
if(this.map&&this.map.getLayer("world-layer-" + MId)) {
this.map.removeLayer("world-layer-" + MId);
this.map.removeSource("word-source");
// this.map.removePaintProperty("world-layer-" + x.MId);
// this.map.removeSource("word-source-" + x.MId);
}
this.TripMapList.splice(index, 1);
this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
}
......@@ -463,19 +464,19 @@ export default {
},
clearCountryFillRange(){
//删除图层
if (this.layerIds.length) {
this.layerIds.forEach(id => {
this.map.removeLayer(id)
})
this.layerIds = [];
}
// if (this.layerIds.length) {
// this.layerIds.forEach(id => {
// this.map.removeLayer(id)
// })
// this.layerIds = [];
// }
//删除数据源
if (this.sourceIds.length) {
this.sourceIds.forEach(id =>{
this.map.removeSource(id)
})
this.sourceIds = [];
}
// if (this.sourceIds.length) {
// this.sourceIds.forEach(id =>{
// this.map.removeSource(id)
// })
// this.sourceIds = [];
// }
},
addCountryFillRange() {
this.countriesData.forEach((x, i) => {
......@@ -485,7 +486,7 @@ export default {
this.map.addLayer({
id: "world-layer-" + x.MId,
type: "fill",
source: "word-source" + x.MId,
source: "word-source",
filter: ["==", "NAME_ZH", x.MName]
});
this.map.setPaintProperty("world-layer-" + x.MId, "fill-color", [
......
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