A Styled Map Package (.smp) file is a Zip archive containing all the resources needed to serve a Maplibre vector styled map offline. This includes the style JSON, vector and raster tiles, glyphs (fonts), the sprite image, and the sprite metadata.
This monorepo contains two packages:
| Package | Description |
|---|---|
styled-map-package |
CLI for creating, viewing, and converting .smp files |
styled-map-package-api |
JavaScript API for reading, writing, and serving .smp files |
Install the CLI globally:
npm install --global styled-map-packageDownload an online map to a .smp file:
smp download https://demotiles.maplibre.org/style.json \
--bbox '-180,-80,180,80' \
--zoom 5 \
--output demotiles.smpPreview in a browser:
smp view demotiles.smp --openValidate a .smp file:
smp validate map.smpOr use the API programmatically:
npm install styled-map-package-apiimport { Reader } from 'styled-map-package-api/reader'
import { createServer } from 'styled-map-package-api/server'
const reader = new Reader('demotiles.smp')
const server = createServer()
// server.fetch(request, reader) returns a WHATWG ResponseSee spec/1.0/.
MIT