mobile-map-builder-cli
TypeScript icon, indicating that this package has built-in type declarations

1.8.1 • Public • Published

Build Status Coverage Status

Mobile Map Builder

An application that helps you build maps & data for mobile applications.

Install

$ npm install -g mobile-map-builder

Quickstart

The core application is a Command Line Interface (CLI) which can be executed in any environment.

Here's how to create your first MBTile map bundle.

$ mmb --bbox '[-76.34, 44.96, -75.24, 45.53]' --min 10 --max 14 --provider bing --service imagery ottawa.mbtiles
 
  downloading [====================] 100% (2655/2655)
  All done!

Help

For more information on the optional parameters enter --help at the end.

$ mmb --help
 
  Usage: cli [options] <filename>
 
  Creates MBTiles from Web Map Tile Service
 
  Options:
 
    -h, --help                         output usage information
    -V, --version                      output the version number
    --bbox [Array<number>]             BBox extent in [minX, minY, maxX, maxY] order
    --min, --min-zoom <number>         Minimum Zoom Level
    --max, --max-zoom <number>         Maximum Zoom Level
    -p, --provider [string="imagery"]  Provider name of tile server
    --scheme [string]                  [Optional] Scheme given to MBTiles DB
    --attribution [string]             [Optional] Attribution given to MBTiles DB
    --descr [string]                   [Optional] Description given to MBTiles DB
    --format [string]                  [Optional] Tile image format [png/jpg]
    --type [string]                    [Optional] Type of MBTiles layer [baselayer/overlay]
    -v, --verbose
 
Examples:
 
    $ mmb --provider imagery --bbox Ottawa --min 8 --max 17 ottawa.mbtiles

API

index

Create MBTiles

Parameters

  • filepath string Database file path
  • metadata Metadata Metadata according to the MBTile spec v1.1 (optional, default {})
    • metadata.url string tile server URL or MBTiles filepath location
    • metadata.bounds Bounds [west, south, east, north]
    • metadata.minzoom number Minimum Zoom level
    • metadata.maxzoom number Maximum Zoom level
  • options Object Options (optional, default {})
    • options.queue number Define total d3 queue (optional, default 5)
    • options.timeout number HTTP maximum timeout in miliseconds (optional, default 20000)
    • options.interval Object Update time interval (optional, default 64)
    • options.proxy Object? use proxy connection {host, port}
    • options.headers Object? HTTP Headers
    • options.verbose boolean? Output verbose messages on internal operations

Examples

const createMBTiles = require('mobile-map-builder-cli')
const metadata = {
  name: 'Example',
  bounds: [-110, 20, 130, 70],
  minzoom: 1,
  maxzoom: 8,
  description: 'Mobile Map Builder Example',
  url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
  format: 'png'
}
download.on('start', () => console.log('Started!'))
download.on('status', message => console.log(message))
download.on('end', () => console.log('All done! :)'))
download.emit('stop')

Returns EventEmitter

Readme

Keywords

none

Package Sidebar

Install

npm i mobile-map-builder-cli

Weekly Downloads

54

Version

1.8.1

License

none

Last publish

Collaborators

  • deniscarriere