diff --git a/app/src/Inspector.tsx b/app/src/Inspector.tsx index bc0f4534..c3749460 100644 --- a/app/src/Inspector.tsx +++ b/app/src/Inspector.tsx @@ -326,7 +326,7 @@ function Inspector(props: { file: PMTiles }) { let tilePreview =
; if (selectedEntry && header?.tileType) { if (selectedEntry.runLength === 0) { - console.log("Display leaf dir view"); + // do nothing } else if (header.tileType === TileType.Mvt) { tilePreview = ( (); + let [header, setHeader] = useState
(null); useEffect(() => { let pmtiles = props.file; const fetchData = async () => { - let m = await pmtiles.getMetadata(); - setMetadata(m); + setMetadata(await pmtiles.getMetadata()); + setHeader(await pmtiles.getHeader()); }; fetchData(); }, [props.file]); return ( + { header ? +
root directory: offset={header.rootDirectoryOffset} len={header.rootDirectoryLength}
+
metadata: offset={header.jsonMetadataOffset} len={header.jsonMetadataLength}
+
leaf directories: offset={header.leafDirectoryOffset} len={header.leafDirectoryLength}
+
tile data: offset={header.tileDataOffset} len={header.tileDataLength}
+
num addressed tiles: {header.numAddressedTiles}
+
num tile entries: {header.numTileEntries}
+
num tile contents: {header.numTileContents}
+
clustered: {header.clustered ? "true" : "false"}
+
internal compression: {header.internalCompression}
+
tile compression: {header.tileCompression}
+
tile type: {header.tileType}
+
min zoom: {header.minZoom}
+
max zoom: {header.maxZoom}
+
min lon, min lat, max lon, max lat: {header.minLon}, {header.minLat}, {header.maxLon}, {header.maxLat}
+
center zoom: {header.centerZoom}
+
center lon, center lat: {header.centerLon}, {header.centerLat}
+
: null } +
);