mobile-map-builder-cli
v1.8.1
Published
An application that helps you build map data (MBTiles & GeoPackages) from Tile Servers.
Downloads
22
Readme
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 pathmetadata
Metadata Metadata according to the MBTile spec v1.1 (optional, default{}
)options
Object Options (optional, default{}
)options.queue
number Define total d3 queue (optional, default5
)options.timeout
number HTTP maximum timeout in miliseconds (optional, default20000
)options.interval
Object Update time interval (optional, default64
)options.proxy
Object? use proxy connection {host, port}options.headers
Object? HTTP Headersoptions.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