feat: load remote map config and constrain tile bounds

This commit is contained in:
2026-03-20 16:19:12 +08:00
parent 8e6291885d
commit 1ecb4809df
8 changed files with 552 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
import { createTileGrid, type TileItem } from '../../utils/tile'
import { isTileWithinBounds } from '../../utils/remoteMapConfig'
import { getTileSizePx, type CameraState } from '../camera/camera'
import { type MapScene } from '../renderer/mapRenderer'
import { type TileStore } from '../tile/tileStore'
@@ -52,7 +53,7 @@ export class TileLayer implements MapLayer {
viewportHeight: scene.viewportHeight,
tileSize,
overdraw: scene.overdraw,
})
}).filter((tile) => isTileWithinBounds(scene.tileBoundsByZoom, scene.zoom, tile.x, tile.y))
}
tileStore.queueVisibleTiles(this.cachedTiles, scene, gridKey)
@@ -122,3 +123,4 @@ export class TileLayer implements MapLayer {
}
}
}