New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@alvarcarto/mosaic

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alvarcarto/mosaic

Stitch map tiles to form a bigger map image

3.0.1
latest
Source
npm
Version published
Weekly downloads
1
-80%
Maintainers
2
Weekly downloads
 
Created
Source

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

Keywords

tile

FAQs

Package last updated on 11 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts