An in-progress offline map style and tile server for Mapeo.
npm install @mapeo/map-server
⚠️ This is alpha software. No guarantees can be made about the stability of the API at the moment, so proceed with caution. 😄
[x] Manages tiles and tilesets (TileJSON)
[x] Manages Mapbox map styles
[x] Supports importing MBTile files as tilesets
[ ] Provides info related to downloads and storage
The default export is a function for creating a map server instance. Basic usage is as follows:
// If you're using TypeScript, you may want to use one of the following import syntaxes to get type definitions:
// - `require('@mapeo/map-server').default`
// - `import createMapServer from '@mapeo/map-server'
const createMapServer = require('@mapeo/map-server')
// Create the server instance
const mapServer = createMapServer({ storagePath: './map-server-example.db' })
// Run the server!
await mapServer.listen(3000)
createServer(opts): MapServer
Creates the map server instance
opts (required)
: Options object to customize the map server instance. Options include:
storagePath: string (required)
: Path to use for persistent map server storage. Happens to be a SQLite database under the hood, but consumers should treat this as an opaque path managed exclusively by the map server.API documentation is available in API.md.
Some notes before working on this locally:
schema.prisma
, run the following commands afterwards:
npm run prisma:migrate-dev -- --name MIGRATION_NAME_HERE
- creates a new migration in the prisma/migrations/
directory, which is used by tests and the server if running locallyMIT