|
@@ -47,8 +47,20 @@ export default {
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
- async GetLegend(vdata) {
|
|
|
- let url = `${vdata.url}/legend.json?bbox=108.99,18.2,109.81,18.59`;
|
|
|
+ async Getbbox(vdata) {
|
|
|
+ let url = `${vdata.url}.json`;
|
|
|
+ let res = await axios.get(url);
|
|
|
+ if (res.data && res.data.bounds) {
|
|
|
+ let bbox = `
|
|
|
+ ${res.data.bounds.left.toFixed(2)},
|
|
|
+ ${res.data.bounds.bottom.toFixed(2)},
|
|
|
+ ${res.data.bounds.right.toFixed(2)},
|
|
|
+ ${res.data.bounds.top.toFixed(2)}`;
|
|
|
+ this.GetLegend(vdata, bbox);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async GetLegend(vdata, bbox) {
|
|
|
+ let url = `${vdata.url}/legend.json?bbox=${bbox}`;
|
|
|
let res = await axios.get(url);
|
|
|
let legends = [];
|
|
|
res.data.layerLegends.forEach((la) => {
|
|
@@ -64,7 +76,7 @@ export default {
|
|
|
this.vectors = [];
|
|
|
// let vectors = this.checkeds.filter((ci) => ci.type == "Vector");
|
|
|
this.checkedVector.forEach((ve) => {
|
|
|
- this.GetLegend(ve);
|
|
|
+ this.Getbbox(ve);
|
|
|
});
|
|
|
},
|
|
|
},
|