JSPM

  • Created
  • Published
  • Downloads 92
  • Score
    100M100P100Q74308F
  • License MIT

Provides a compatible WMTS Tile Server from MBTiles.

Package Exports

  • mbtiles-server

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mbtiles-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

MBTiles Server

Build Status Coverage Status npm version MIT licensed

Standard - JavaScript Style Guide

Provides a compatible WMTS Tile Server from MBTiles.

Install

$ npm install -g mbtiles-server

Quickstart

$ mbtiles-server --cache /Users/mac/mbtiles --verbose --port 3000
MBTiles Server Service

  cache:         /Users/mac/mbtiles
  protocol:      http
  port:          3000
  domain:        localhost
  verbose:       true

Background Service

You can also run this server as a native OS background service.

$ sudo mbtiles-server-service start
Starting: mbtiles-server

Environment Variables

You can also define the CLI options as environment variables using the following:

$ export MBTILES_SERVER_PROTOCOL=http
$ export MBTILES_SERVER_DOMAIN=localhost
$ export MBTILES_SERVER_CACHE=/home/ubuntu/mbtiles
$ export MBTILES_SERVER_PORT=5000
$ export MBTILES_SERVER_VERBOSE=true

Docker

A Dockerfile is provided for easy Docker deployment

$ docker pull deniscarriere/mbtiles-server
$ docker run --rm -it \
  -p 5000:5000 \
  -v /home/ubuntu/mbtiles/:/root/mbtiles \
  deniscarriere/mbtiles-server

Start containers automatically

https://docs.docker.com/engine/admin/host_integration/

$ docker run -d \
  --name mbtiles-server \
  -p 5000:5000 \
  -v /home/ubuntu/mbtiles/:/root/mbtiles \
  deniscarriere/mbtiles-server

CLI Help

For any additional help using the CLI, use the --help flag.

  Provides a compatible WMTS Tile Server from MBTiles.

  Usage
    $ mbtiles-server

  Options
    --cache           [~/mbtiles] Cache
    --protocol        [http] Protocol
    --port            [5000] Port
    --domain          [localhost] Domain
    --verbose         [false] Verbose output

  Examples
    $ mbtiles-server --cache /Users/mac/mbtiles --port 5000 --verbose

WMTS

The goal of providing a WMTS enabled service is to be performance oriented and scalable. Therefore, servers must be able to return tiles quickly. A good way to achieve that is to use locally stored pre-rendered tiles that will not require any image manipulation or geo-processing.

API

start

Start Server

Parameters

  • options [string] Server Options
    • options.cache [string] CACHE file path (optional, default ~/mbtiles)
    • options.protocol [string] URL Protocol (optional, default 'http')
    • options.domain [string] URL Domain (optional, default 'localhost')
    • options.port [string] URL Port (optional, default 5000)
    • options.verbose [string] Verbose output (optional, default false)

Examples

server.start({cache: '/Users/mac/mbtiles', port: 5000, verbose: true})

Returns void System output for logs