combine-tiles

Combine map tiles into a single large image.

Usage no npm install needed!

<script type="module">
  import combineTiles from 'https://cdn.skypack.dev/combine-tiles';
</script>

README

combine-tiles

Combine map tiles into a single large image. Uses the great sharp package for efficiency. Similar to abacus and merge-tiles.

npm version build status ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installing

npm install combine-tiles

Usage

Check out the example directory!

const combineTiles = require('combine-tiles')

const size = 300
const tiles = [
    {x: 0, y: 0, file: '/path/to/0-0.png'},
    {x: 1, y: 0, file: '/path/to/1-0.png'},
    {x: 0, y: 1, file: '/path/to/0-1.png'},
    {x: 1, y: 1, file: '/path/to/1-1.png'}
]
const dest = '/path/to/combined.png'

combineTiles(tiles, size, size, dest)
.catch(console.error)

You may want to use tilebelt to convert bounding boxes into [x, y, zoom] tiles or tile-cover to generate a list of tiles in a bounding box.

Contributing

If you have a question or have difficulties using combine-tiles, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.