Introducing a new way to review your PRs.

Read the announcement

maplibre / maplibre-tile-spec

Next generation map vector tiles format

View on GitHub

20 documents · Updated Nov 23, 2026

docs / inspector-views-and-annotations

Inspector views and annotations

The inspector explains a decoded tile by connecting its raw bytes to named regions, decoded values, geometry, and byte-use statistics. Its Vue views keep these representations in sync so an engineer can move from a byte to the structure that owns it, then to the feature or encoding that gives it meaning. See the tile inspector page for the full product flow and inspector inputs and sharing for tile sources and shared view state.

Inspector workspace

The workspace presents one tile through several related views. The annotated region tree and hex view describe the wire data. The detail panel explains the current region. Optional geometry and statistics panels connect that wire data to decoded features and byte cost.

This diagram shows how one annotated tile supplies the views and how pointer or selection actions move between them.

flowchart LR
    T[Annotated tile] --> H[Hex view]
    T --> R[Region tree]
    T --> D[Region detail]
    T --> G[Geometry view]
    T --> S[Statistics]
    H <--> R
    H --> D
    R --> D
    H --> G
    R --> G
    H --> S
    R --> S

The main composition is defined by home/…/HexdumpView.vue. App.vue supplies the annotated tree, original bytes, decoded features, and view choices. The controls can show or hide geometry and statistics, select one layer, and enable matching tints across the byte map and region tree.

Byte views

Hex view

The hex view presents the tile as byte offsets, hexadecimal values, and printable characters. Each byte belongs to the smallest annotated region that covers it, so hover and click actions can identify the structure responsible for that byte. A selected region highlights its full byte span in both the hexadecimal and text columns.

The view keeps large tiles usable by drawing only the visible rows. It also marks data payloads, metadata, region starts, and bytes that the annotation walk did not reach. The column count follows the available pane width rather than a fixed terminal layout.

References: inspector/…/HexMap.vue• L17-50 inspector/…/HexMap.vue• L81-105 inspector/…/HexMap.vue• L114-189 inspector/…/hex.ts• L5-16

Region tree

The region tree turns the annotated byte ranges into a browsable hierarchy. Containers represent nested tile structure and leaves represent fields or data payloads. The tree folds wrappers that add no useful context, starts with large sections closed when needed, and shows the byte size of each visible region.

The tree is a second navigation surface for the same regions as the hex view. Selecting a row highlights and scrolls to its bytes. Hovering a row updates the detail panel and the geometry or statistics context. The expand and collapse controls let the reader choose between a layer summary and a full structural view.

References: inspector/…/RegionTree.vue• L21-64 inspector/…/RegionTree.vue• L82-116 inspector/…/RegionTree.vue• L127-189 inspector/…/RegionTree.vue• L192-259

Byte annotations

Byte annotations are the shared link between raw bytes and tile meaning. The tile decoder supplies regions, nesting, labels, values, bit fields, and data-stream descriptions. The inspector derives byte ownership from those regions and uses the result to keep highlights, paths, hover tips, and selections consistent.

Annotations can explain a field without decoding its payload. When a region has a decodable stream, the inspector can show a short value sample and the logical and physical encodings. If the walk stops early, the remaining range is shown as <unannotated> instead of being presented as understood data.

References: inspector/…/annotate.ts• L1-12 inspector/…/hex.ts• L69-105 inspector/…/HexdumpView.vue• L145-180 inspector/…/HexdumpView.vue• L258-304

Region explanations

Detail panel

The detail panel is the persistent explanation for the active region. It shows the region path, byte span, stored value, and any layer summary that can be read from the annotation. For stream regions it adds the stream kind, logical and physical forms, value count, and the decoder's result.

The panel keeps large payloads readable by showing a bounded sample first. A reader can reveal more values or characters when needed. Repeated values can be grouped, and enum streams can show both their names and stored numbers. When a region has a matching encoding section, the panel also links the byte explanation to the relevant specification text.

References: inspector/…/RegionDetail.vue• L12-30 inspector/…/RegionDetail.vue• L33-149 inspector/…/RegionDetail.vue• L152-263 inspector/…/blob.ts• L6-24 inspector/…/blob.ts• L60-93

Hover annotation

The hover tip gives a short explanation without changing the pinned selection. It identifies the region path and byte span, shows a stored value or a small decoded sample, and can include the same specification links as the detail panel. This supports quick scanning across a byte run while the detail panel remains available for a selected region.

References: inspector/…/HexTip.vue• L12-23 inspector/…/HexTip.vue• L39-72 inspector/…/HexTip.vue• L76-90

Encoding references

Encoding references connect region labels and stream names to sections of the tile encoding documentation. The mapping accounts for the tile version and for the difference between logical and physical encodings. The panel loads the matching documentation only when a selected or hovered region needs it, so the byte view remains the primary source of facts about the tile.

References: inspector/…/encodingDocs.ts• L19-64 inspector/…/encodingDocs.ts• L171-175 inspector/…/encodingDocs.ts• L269-291 inspector/…/EncodingDocs.vue• L7-24 inspector/…/EncodingDocs.vue• L27-52

Geometry views

Geometry view

The geometry view shows the decoded tile in its tile coordinate space. It draws feature shapes by layer and geometry type, dims unrelated layers when the pointer identifies one, and highlights the feature under the pointer. The feature tip reports its type, layer, vertex count, properties, and per-vertex values.

Geometry is a decoded view rather than a second interpretation of the bytes. It appears when the tile can be decoded to a feature collection. The region tree and hex map can scope the view to the layer under the pointer, which lets a reader compare a wire section with the feature shapes it produces.

References: inspector/…/GeometryView.vue• L10-23 inspector/…/GeometryView.vue• L66-104 inspector/…/GeometryView.vue• L155-177 inspector/…/GeometryView.vue• L303-347 inspector/…/geometry.ts• L11-35 inspector/…/geometry.ts• L63-89

Geometry annotations

Geometry annotations preserve the product meaning that is easy to lose in a raw feature collection. Layer and extent metadata identify the tile coordinate space. Geometry type colors, vertex counts, properties, and runs of equal per-vertex values make the selected feature useful for checking both content and shape cost.

References: inspector/…/geometry.ts• L15-26 inspector/…/geometry.ts• L38-60 inspector/…/geometry.ts• L73-104

Tile statistics

Statistics panel

The statistics panel summarizes how the tile spends its bytes and what the decoded tile contains. The top bar separates geometry, properties, IDs, and metadata. Layer rows then show each layer's size, byte categories, columns, feature count, extent, and decoded vertex count when available.

The panel uses the annotated region tree for byte sizes and the decoded feature collection for feature and geometry counts. This makes it possible to compare storage cost with decoded shape content. A layer under the pointer is highlighted in the statistics list, but the panel still keeps the whole-tile summary visible.

References: inspector/…/StatsView.vue• L16-73 inspector/…/StatsView.vue• L75-195 inspector/…/tileStats.ts• L8-41 inspector/…/tileStats.ts• L51-95 inspector/…/tileStats.ts• L128-159

Shared visual language

Optional tints give one structural block the same color in the hex view and region tree. The statistics panel reuses the palette for byte categories and geometry types. These colors are cues for following a region across views; the labels, offsets, and values remain the source of truth.

References: inspector/…/hex.ts• L79-105 inspector/…/HexMap.vue• L125-143 inspector/…/RegionTree.vue• L127-149 inspector/…/StatsView.vue• L27-47

View coordination

The views share two kinds of context: the active region and the pointer's layer. A selection is pinned and drives the detail panel. A hover follows the pointer and drives short tips plus the related geometry and statistics emphasis. Arrow keys move through leaf regions, while the views scroll to keep the active region visible.

Layer filtering changes the region tree that is shown. Because region numbers are local to that filtered tree, changing the layer clears the current selection. The view keeps the original whole-tile mapping behind the scenes so decoded stream requests still address the correct tile region.

References: inspector/…/HexdumpView.vue• L145-210 inspector/…/HexdumpView.vue• L221-255 inspector/…/App.vue• L53-77 inspector/…/App.vue• L282-285

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep byte ownership, region highlighting, tree rows, and hover paths aligned when the annotation shape changes.
  • Keep filtered-tree region indices mapped to whole-tile decode indices when layer selection changes.
  • Keep geometry layer names and annotation layer labels compatible so pointer scope and per-layer statistics still match.
  • Keep byte category rules in tileStats.ts aligned with the region labels emitted by the tile decoder.
  • Keep encoding label and stream-id mappings aligned with the specification anchors used by the detail panel and hover tip.

Important failure modes

TriggerConsequenceGuard
The annotation walk stops before the end of the bufferThe remaining bytes show as <unannotated>, and statistics report their size separately.Treat the warning as an incomplete explanation. Do not infer structure from the unannotated range.
The tile cannot be decoded to a feature collectionThe hex view, tree, and region detail can still work, but geometry and decoded feature counts are absent.Use region and stream data for wire inspection, then check the decode error before judging geometry.
A layer filter changesThe visible region indices change and the old selection is cleared.Re-select a region after changing the layer.
A tile has no drawable featuresThe geometry panel has no scene to draw and reports that the tile draws no geometry.Use the byte and region views for metadata-only or empty-geometry tiles.
Encoding documentation is unavailableRegion facts remain visible, but the specification section is not shown.Use the region label, stream fields, and stored values as the local explanation.

Key files

FileWhy to read it
inspector/…/App.vueConnects loaded tile data and view state to the inspector workspace.
inspector/…/HexdumpView.vueCoordinates the hex map, region tree, detail panel, geometry view, and statistics.
inspector/…/HexMap.vueDefines byte ownership, highlighting, scrolling, and pointer actions.
inspector/…/RegionTree.vueDefines the structural region navigation and its folding behavior.
inspector/…/RegionDetail.vueDefines persistent region facts, decoded samples, and specification links.
inspector/…/GeometryView.vueDefines decoded feature rendering and feature hover facts.
inspector/…/StatsView.vueDefines the tile and layer storage summary.
inspector/…/annotate.tsNames the decoded annotation data shared by the views.
inspector/…/hex.tsHolds the shared byte, region, tint, and navigation rules.
inspector/…/tileStats.tsConverts annotated regions and decoded features into statistics.
inspector/…/encodingDocs.tsMaps region and stream names to encoding documentation.