使用切片图层时、地图拖拽会有空白图片,为了减少空白等待时间,我们可以开始图层预加载。
const map_top = new Map({
layers: [
new TileLayer({
preload:Infinity, //预加载
source: new StadiaMaps({
layer: "outdoors",
}),
}),
],
target: "map_top",
view: view,
});