@alvarcarto/mosaic
Stitch map tiles to form a bigger map image
Last updated 20 days ago by kimmobrunfeldt .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @alvarcarto/mosaic 
SYNC missed versions from official npm registry.

mosaic

A tool to stich map tiles to form a bigger map. Give it a URL template and bounding box, it will generate a map for you.

npm install -g @alvarcarto/mosaic

Examples

const fs = require('fs');
const { tile } = require('@alvarcarto/mosaic');

tile({
  // Parameters below are required
  width: 700,
  height: 1000,
  template: 'http://yourtileserver.com/{z}/{x}/{y}.png',
  swLat: 32.473,
  swLng: -15.594,
  neLat: 45.298,
  neLng: 8.056,
})
  .then((image) => {
    // PNG as Buffer
    fs.writeFileSync(`map.png`, image, { encoding: null });
  });

This module uses Mapnik's GROW_BBOX method to fit the given coordinates to given width and height. The implementation in Mapnik's repository: https://github.com/mapnik/mapnik/blob/e9ebc938e08686c8b5364dbd61827dc9d68589d5/src/map.cpp#L587.

Contributors

Release

  • Commit all changes.

  • Use np to automate the release:

    np

  • Edit GitHub release notes.

License

MIT

Current Tags

  • 3.0.1                                ...           latest (20 days ago)

14 Versions

  • 3.0.1                                ...           20 days ago
  • 3.0.0                                ...           23 days ago
  • 2.0.2                                ...           23 days ago
  • 2.0.1                                ...           23 days ago
  • 2.0.0                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
Downloads
Today 0
This Week 14
This Month 111
Last Day 0
Last Week 1
Last Month 43
Dependencies (9)
Dev Dependencies (1)
  • np ^2.19.0
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |