【解决办法】重写重写了maplibregl加载瓦片的方案,加载EPSG4326的iServer的tmsrest服务正常了
transformRequest: (url, resourceType, e) =>{
if(resourceType === "Tile" && url.startsWith("http://localhost:8090/iserver/services/map-China100/tmsrest/1.0.0/China_4326")){
console.log(url);
var regZ = /([0-9]+)-1/;
var regY = new RegExp(/([0-9]+).png/);
var matchZ = new RegExp(regZ).exec(url);
var matchY = new RegExp(regY).exec(url);
if(matchZ) {
var z = +matchZ[1] -1;
var y = +matchY[1];
var tmsY = Math.pow(2, z) - 1 - y;
return {
url: url.replace(regZ, z).replace(regY, tmsY + '.png')
}
}
return url;
}
},