From 884e980100f8b60751e9a4e269d6dedce324e25b Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Wed, 5 Oct 2022 22:34:50 +0800 Subject: [PATCH] inspector GL map uses fitBounds --- app/src/MaplibreMap.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/MaplibreMap.tsx b/app/src/MaplibreMap.tsx index 95af9c5..148c1a9 100644 --- a/app/src/MaplibreMap.tsx +++ b/app/src/MaplibreMap.tsx @@ -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);