this.$axios.get(url+'/fields.json').then(res => {
console.log(res.data.childUriList,'ssssss444444444444')
let resData=res.data
let index=0
await self.ccc(resData.childUriList,arr)
console.log(arr)
resData.childUriList.forEach(ele=>{
this.$axios.get(ele+'.json').then(res => {
index++
let info=res.data.fieldInfo
var aaa={
name:info.name,
type:info.type
}
arr.push(aaa)
// console.log(res.data.fieldInfo,'ssss5555555555555')
}, err => {
this.$message.error("获取信息失败!");
return false;
})
})
//方式一:
setTimeout(()=>{
if(resData.childUriList.length==index){
console.log(arr,'rrrrrrrrrrrrrrr')
}
},1000)
}, err => {
this.$message.error("获取信息失败!");
return false;
})
let tileLayer = new TileLayer({
id:'ArcGIS瓦片',
visible:true,
zIndex:1,
source: new XYZ({
tileUrlFunction: function (coordinate) {
// var x = 'C' + _self.zeroFill(coordinate[1], 8, 16);
// var y = 'R' + _self.zeroFill(-coordinate[2] - 1, 8, 16);
// var z = 'L' + _self.zeroFill(coordinate[0], 2, 10);
// console.log(coordinate,z,x,y)
var z = coordinate[0];
var x = coordinate[1];
var y = coordinate[2];
// var yy = Math.pow(2, z) + coordinate[2];
// var y = Math.abs(coordinate[2]);
console.log('arcgis:',coordinate[2],z,x,process.env.VUE_APP_TILE_URL+ '/'+ z + '/' + y + '/' + x + '.png')
return process.env.VUE_APP_TILE_URL + '/'+ z + '/' + y + '/' + x + '.png';
// // var x = '' + _self.zeroFill(coordinate[1], 8, 10);
// // var y = '' + _self.zeroFill(-coordinate[2] - 1, 8, 10);
// // var z = '' + _self.zeroFill(coordinate[0], 2, 10);
// console.log('http://localhost:8884/image/satellite/' + z + '/' + x + '/' + y + '.jpg')
// // return 'http://localhost:8884/image/satellite/' + z + '/' + x + '/' + y + '.jpg';
},
// projection: 'EPSG:3857'
})
});
openlayer 文字标注 重叠