inspector GL map uses fitBounds

This commit is contained in:
Brandon Liu
2022-10-05 22:34:50 +08:00
parent 15be9a6c07
commit 884e980100

View File

@@ -156,10 +156,11 @@ function MaplibreMap(props: { file: PMTiles }) {
if (map) {
let header = await props.file.getHeader();
// map.fitBounds([
// [header.minLon, header.minLat],
// [header.maxLon, header.maxLat],
// ]);
map.fitBounds([
[header.minLon, header.minLat],
[header.maxLon, header.maxLat],
],{animate:false});
let style: any; // TODO maplibre types (not any)
if (header.tileType === TileType.Png || header.tileType == TileType.Jpeg) {
map.setStyle(rasterStyle(props.file) as any);