feat: load remote map config and constrain tile bounds
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user