Introducing a new way to review your PRs.

Read the announcement

maplibre / martin

Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling.

View on GitHub

22 documents · Updated Nov 23, 2026

docs / martin-web-dashboard

Martin web dashboard

The Martin web dashboard is an in-browser view of the tile server and its published map assets. It combines live server activity with catalog views for tile sources, styles, fonts, and sprites so an engineer can check what Martin serves, inspect how map data renders, and copy the URLs needed by map clients. It is part of the wider operations and quality view of Martin.

Dashboard purpose

The dashboard presents the server as a working map service rather than as a set of separate endpoints. It reads the server catalog for available assets and reads the metrics endpoint for request and cache activity. The page keeps catalog tabs and dialogs shareable through URL parameters, so a useful view can be reopened or passed to another engineer.

Dashboard role

The dashboard joins published resources, service activity, and client handoff actions in one place. A catalog failure and a metrics failure stay separate, so one unavailable server view does not hide the other.

References: crates/…/Dashboard.tsx• L16-35 crates/…/Dashboard.tsx• L57-118 crates/…/dashboard-content.tsx• L25-67 crates/…/api.ts• L1-24

Dashboard flow

The main workflow moves from a server summary to an asset catalog and then to an asset-specific preview or tool. This diagram shows how the dashboard turns Martin's published resources and metrics into investigation paths.

flowchart TD
    A[Martin server] --> B[Catalog and metrics]
    B --> C[Server activity]
    B --> D[Tile sources]
    B --> E[Styles]
    B --> F[Fonts]
    B --> G[Sprites]
    D --> H[Tile inspection]
    E --> I[Style preview or editor]
    G --> J[Sprite preview or download]
    C --> K[Request and cache view]

References: crates/…/Dashboard.tsx• L71-118 crates/…/dashboard-content.tsx• L33-150

Catalog exploration

The catalog area groups published resources by the role they play in a map. Each tab gives a filtered view of one resource type, shows how many entries match the search, and reports a server error instead of presenting incomplete data as a valid catalog.

Catalog navigation

The four catalog tabs are Tiles, Styles, Fonts, and Sprites. Search stays with the active tab and uses fields that help identify that resource type. The selected tab, search text, and open actions are stored in the URL, which makes catalog views easy to share.

References: crates/…/dashboard-content.tsx• L35-100 crates/…/dashboard-content.tsx• L103-146 crates/…/catalog-header.tsx• L1-25 crates/…/catalog-search.tsx• L6-41 crates/…/use-url-params.ts• L3-78

Tile source catalog

The tile source catalog helps an engineer find the source behind a map layer and choose the next inspection step. A source entry can show its content type, layer count, geographic scope, zoom range, description, and a direct TileJSON link. Search covers the source name and the descriptive fields exposed by the catalog.

References: crates/…/tiles.tsx• L158-182 crates/…/tiles.tsx• L291-379 crates/…/tiles.tsx• L428-492

Style catalog

The style catalog connects a named map style to a visual preview and to the information needed to use that style in a client. A style entry can show its source path, type, layer count, version, last change time, and color set. The entry also opens an integration guide or the full style editor.

References: crates/…/styles.tsx• L18-87 crates/…/styles.tsx• L135-245

Font and sprite catalogs

The font catalog checks that text assets are available and gives a small glyph preview with the family, style, format, and glyph count. The sprite catalog checks icon collections and gives a sheet preview, icon count, file size, and actions for a full preview or download. Both catalogs support search and expose links that clients can use directly.

References: crates/…/font.tsx• L15-124 crates/…/sprite.tsx• L64-159

Tile inspection

Tile inspection is the dashboard's map-level diagnostic view for one tile source. It uses the source's TileJSON to set the map extent and zoom limits, then shows raster data directly or adds an inspector for vector data. The view lets an engineer compare the data with a basemap, zoom to the data bounds, and inspect feature properties when vector features are present.

Tile inspection flow

When an engineer opens a source, the dashboard loads its TileJSON before it frames the map. It then applies the source limits and view, adds the right raster or vector display, and reports whether the current view contains features.

sequenceDiagram
    participant E as Engineer
    participant D as Dashboard
    participant M as Martin
    E->>D: Open tile source
    D->>M: Request TileJSON
    M-->>D: Bounds, center, and zoom limits
    D->>M: Request map tiles
    M-->>D: Raster or vector data
    D-->>E: Map, inspector, and source details

References: crates/…/tile-inspect.tsx• L41-106 crates/…/tile-inspect-map.tsx• L29-49 crates/…/tile-inspect-map.tsx• L149-224 crates/…/tile-inspect-map.tsx• L226-301

The inspector exposes the two client-facing forms of the source: its TileJSON URL and its XYZ tile URL. If the current view has no features, the dashboard reports that state and points the user toward changing the map view rather than treating it as a failed source.

References: crates/…/tile-inspect.tsx• L41-105 crates/…/tile-inspect-map.tsx• L359-387

Style previews and tools

Style entries provide a quick rendering check before an engineer opens the full editor. The preview loads the served style into a map and distinguishes a usable style from one that only defines a background or cannot be read. This makes missing or empty map content visible without requiring a client application.

Style preview

The preview is a fast check of the served style rather than a replacement for a map client. It shows drawable layers when they exist, marks a background-only style as empty, and reports a load failure when the style itself cannot be read.

References: crates/…/styles.tsx• L18-87

Style integration and editing

The integration guide turns a style into a client handoff. It shows the style URL and example setup paths for web, native, and React Native MapLibre clients. The editor opens the served style in an in-dashboard workspace, where an engineer can inspect layers on the map, change style and layer settings, review colors and checks, compare versions, inspect features, and use x-ray or vision views. Edits remain in memory until the engineer copies or downloads the style JSON; the editor can also open Maputnik with the same style URL.

References: crates/…/style-integration-guide.tsx• L82-123 crates/…/style-integration-guide.tsx• L194-331 crates/…/index.tsx• L85-137 crates/…/index.tsx• L140-210 crates/…/index.tsx• L316-571 crates/…/index.tsx• L643-755

Sprite previews and downloads

Sprite tools show how an icon collection will look to MapLibre and provide the asset forms that a style can consume. The preview can switch between normal PNG rendering and SDF rendering. The download view separates standard, high-resolution, and SDF sheets from their JSON indexes and lets the user copy each URL.

Sprite preview

The catalog gives each sprite sheet a compact visual check before the engineer opens the full preview. The full view renders the icons in the way MapLibre expects and keeps download access close to the preview.

References: crates/…/sprite.tsx• L64-123 crates/…/sprite-preview.tsx• L20-50

Sprite delivery formats

The download view presents PNG for fixed, full-color sprites and SDF for sprites that need runtime color changes. Each format includes its image sheet and JSON index, with high-resolution variants for retina displays.

References: crates/…/sprite-download.tsx• L22-70 crates/…/sprite-download.tsx• L124-215

Server activity analytics

The analytics area gives a live, server-side view of the four asset request groups: tiles, styles, fonts, and sprites. It shows the number of published resources, average response time since server start, request count, a small duration distribution, and the cache hit rate where a cache applies. Tile and PMTiles cache results can be viewed by zoom, while styles are shown as not cached when no cache backs that group.

Analytics groups

The dashboard reads Prometheus text from /_/metrics and groups endpoint labels into the four user-facing resource types. It combines request totals with duration histograms and cache hit or miss counters, so the cards describe a service class rather than one individual route.

References: crates/…/Dashboard.tsx• L16-35 crates/…/prometheus.ts• L61-88 crates/…/prometheus.ts• L150-187 crates/…/prometheus.ts• L223-286

Analytics refresh

The summary and catalog counts refresh every 15 seconds. A metrics error is shown separately from a catalog error, and a resource with no recorded requests is shown as idle rather than as a failed service.

References: crates/…/Dashboard.tsx• L71-114 crates/…/analytics-section.tsx• L112-271

Display preferences

The dashboard separates display choices from server data. Theme and basemap choices change how maps are viewed without changing the published catalog or the analytics source.

Theme preference

The dashboard supports light, dark, and system themes. The theme affects the page and the map previews, while the header provides links to Martin documentation, MapLibre, and the source repository. The theme control cycles through the three choices instead of opening a separate settings page.

References: crates/…/App.tsx• L1-19 crates/…/header.tsx• L9-18 crates/…/header.tsx• L137-155 crates/…/theme-switcher.tsx• L7-54

Basemap preference

The tile inspector also has a basemap preference. A user can choose a supported underlay or no underlay, and the choice is retained in the browser and represented in the URL so a shared inspection link can preserve the map context.

References: crates/…/tile-inspect-map.tsx• L100-109 crates/…/tile-inspect-map.tsx• L319-357 crates/…/use-underlay-preference.ts• L3-87 crates/…/underlay-providers.ts• L1-28

Change checklist

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

  • Keep the catalog resource groups aligned with the catalog counts and the analytics endpoint groups. A new asset route can otherwise appear in one view but not the other.
  • Keep tile inspection behavior aligned with the TileJSON fields used for bounds, center, and zoom limits. A contract change can leave the map at the wrong extent without a clear request error.
  • Keep style and sprite URLs aligned between previews, integration guidance, and download actions. These links are copied into external map clients.
  • Keep persisted underlay IDs aligned with the valid provider list. An invalid URL or browser value must continue to fall back safely.
  • Keep URL-owned dashboard state separate from the underlay state. Updating one must not remove the other from a shared link.
  • Keep style-editor changes aligned with its in-memory export path. An editing change must not imply that Martin's served style changed when only a local copy changed.

Important failure modes

TriggerConsequenceGuard
The catalog request failsCatalog tabs cannot describe the server's published assetsShow the server error state instead of empty catalog results
The metrics request failsActivity cards do not provide current request or cache dataKeep analytics failure separate and show an analytics error state
TileJSON bounds or zoom data is missingInspection starts with less precise map framingUse the available center or world view and keep direct source URLs visible
A style contains no drawable layersThe preview has no map content to showMark the preview as empty and explain that it only defines a background
A style cannot be loadedStyle preview or editor cannot validate the styleShow a load failure and retain a retry or external-editor path
A tile view has no rendered featuresAn engineer may mistake an empty view for a broken sourceReport the empty view and prompt the user to pan or zoom
A shared underlay ID is not supportedThe inspection map could load with an invalid basemap choiceAccept only known provider IDs and fall back to the default or no underlay
A style editor export is not usedLocal edits are mistaken for server-side changesKeep edits local and require copy or download for handoff

Key files

FileWhy to read it
crates/…/Dashboard.tsxShows the top-level relationship between catalog counts, metrics refresh, and dashboard content.
crates/…/dashboard-content.tsxShows the catalog tabs, URL-backed actions, and style-editor transition.
crates/…/tiles.tsxExplains tile source discovery, visual previews, search, and the inspection entry point.
crates/…/tile-inspect-map.tsxExplains the map inspection experience for raster and vector sources.
crates/…/styles.tsxExplains style previews and the main style actions.
crates/…/index.tsxExplains local style editing, map inspection modes, checks, history, and export actions.
crates/…/style-integration-guide.tsxShows how the dashboard hands a served style to client applications.
crates/…/sprite.tsxExplains sprite collection previews and user actions.
crates/…/sprite-download.tsxDefines the supported sprite and SDF download choices.
crates/…/analytics-section.tsxExplains the user-facing server activity and cache displays.
crates/…/prometheus.tsShows how raw server metrics become resource-group summaries.
crates/…/use-underlay-preference.tsExplains how tile inspector basemap choices persist and travel in links.