Commit b61084f2 authored by 黄奎's avatar 黄奎
parents 92a1c719 ccd60ee4
...@@ -323,10 +323,9 @@ export default { ...@@ -323,10 +323,9 @@ export default {
// 更新数据时再标记 // 更新数据时再标记
if(type==2){ if(type==2){
this.addMarker(); //标记 this.addMarker(); //标记
this.createLineHandler(); //连线
await this.addCountriesMaker(); //标记国家
} }
this.createLineHandler(); //连线
await this.addCountriesMaker(); //标记国家
//this.addDocumentEventListener(); //this.addDocumentEventListener();
}, },
...@@ -827,24 +826,28 @@ export default { ...@@ -827,24 +826,28 @@ export default {
} }
] ]
}; };
that.map&&that.map.addSource("curve-source-" + p.MId, { setTimeout(()=>{
type: "geojson", if(this.map&&!this.map.getLayer("curve-layer-" + p.MId)){
data: geojson that.map&&that.map.addSource("curve-source-" + p.MId, {
}); type: "geojson",
that.map&&that.map.addLayer({ data: geojson
id: "curve-layer-" + p.MId, });
type: "line", that.map&&that.map.addLayer({
source: "curve-source-" + p.MId, id: "curve-layer-" + p.MId,
layout: { type: "line",
"line-cap": "round", source: "curve-source-" + p.MId,
"line-join": "round" layout: {
}, "line-cap": "round",
paint: { "line-join": "round"
"line-color": ["rgba", 0, 0, 0, 0.3], },
"line-width": 1.5 paint: {
//'line-dasharray': [2, 4], "line-color": ["rgba", 0, 0, 0, 0.3],
"line-width": 1.5
//'line-dasharray': [2, 4],
}
});
} }
}); },300)
} }
}); });
}, },
......
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