mapview is a command line tool that lets you view many kinds of geospatial data files in your web browser. Point it at a file and it opens an interactive map in a new browser tab.
Mapview UI showing a vector tileset in wireframe view, side-by-side with a stylesheet that uses that tileset
Mapview supports many different file types:
- GeoJSON
- TileJSON
- StyleJSON (MapLibre/Mapbox stylesheets)
- PMTiles
- MBTiles
- GeoTIFF (requires the
gdalbuild feature) - GPX
- KML
- Shapefile
For each supported file type, mapview attempts to "do the right thing" to display it in a useful way. Vector tilesets are shown in a wireframe style that reveals the data contained within them. Map stylesheets are rendered faithfully, with additional details about the visible elements available on click. Vector data formats like GeoJSON and Shapefile are shown as an overlay above your choice of basemap. Raster formats are shown reprojected and tiled automatically to support panning and zooming.
- Supports either local file paths or remote HTTP(S) URLs for most formats
- View and compare multiple files side by side, in single, swipe, or tile mode
- Use Cmd/Ctrl + F to filter features by a JS expression and highlight matches on the map
- Top bar shows zoom/latitude/longitude and bbox
- Right click to copy a coordinate, measure distance, or copy features as GeoJSON
- Show/hide individual layers in a tileset from the legend panel
- Enable debug tools, map rotation, pitch, or globe mode from the settings panel
- Use
--watchto automatically reload the page when files are modified
View a single file:
mapview path/to/file.geojsonPipe JSON-based data in via stdin (auto-detects GeoJSON vs TileJSON vs StyleJSON):
cat file.geojson | mapviewView multiple files together in a side-by-side comparison mode:
mapview path/to/file.geojson another/file.pmtiles a/third/style.jsonThe server runs on http://localhost:3857 and opens in your default browser automatically.
Mapview is implemented in Rust and TypeScript. The Rust part is a CLI program that launches a local Rocket web server which serves the files given as command line arguments, then opens your browser. The TypeScript part runs in your browser, fetching data from that server and displaying it. Rendering is handled by MapLibre GL JS, and the UI is written in Crank.js.
To build, you will need:
- a Rust toolchain
- Node.js + npm
- Make (GNU or BSD)
GeoTIFF support depends on GDAL which is disabled by default. You can opt in with cargo build --features gdal.
Once compiled, mapview is a single self-contained binary (the HTML, CSS, and JS are embedded into the executable), so to install it, you can just move it to /usr/local/bin or equivalent.
Mapview overlaps with a number of existing web-based tools. Depending on your needs, you may prefer:
- geojson.io for viewing and editing GeoJSON
- pmtiles.io for inspecting PMTiles archives
- mapshaper.org for viewing, simplifying and converting vector data
- stamen.github.io/maperture for viewing and comparing map styles
- gpx.studio for viewing and editing GPX files
Mapview is made available under the ISC License. See the LICENSE file for details.