高德加载wms图层有个问题,默认加载资源的层级是18级,再放大就是图片放大,不加载资源了,导致图层模糊。
解决方案:给地图map 加上 zooms: [3, 26], 在给wms 图层加上 detectRetina: true, dataZooms: [2, 26]。26这个值,可以调整.这样配置更高的zoom也会加载资源
const map = new AMap.Map("map", {
center: [116, 39],
zooms: [3, 26],
zoom: 18,
});
const wmsLayer = new AMap.TileLayer.WMS({
detectRetina: true,
dataZooms: [2, 26],
// 其他opts
})