# map-tiles-crawler

> Memory efficient and synchronous downloader of map tiles. Allows for a fast and easy approach to make map tiles (from a WMS) available offline.

Latest version **1.0.2** (published 2019-02-17) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install map-tiles-crawler
pnpm add map-tiles-crawler
yarn add map-tiles-crawler
bun add map-tiles-crawler
```

Provides the command `mtc`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-02-17 |
| First published | 2017-02-28 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Stefan Huber |
| Maintainers | stefan.huber |
| Keywords | map, tiles, crawler, web mapping |

## Links

- npm: https://www.npmjs.com/package/map-tiles-crawler
- Repository: https://github.com/stefanhuber/map-tiles-crawler
- Homepage: https://github.com/stefanhuber/map-tiles-crawler#readme
- Issues: https://github.com/stefanhuber/map-tiles-crawler/issues
- npm.io page: https://npm.io/package/map-tiles-crawler

## Dependencies (2)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [commander](https://npm.io/package/commander.md) ^2.19.0

## Recent versions

- 1.0.2 (latest) — 2019-02-17
- 1.0.1 — 2019-02-17
- 1.0.0 — 2017-02-28

## README

# Map Tiles Crawler

Memory efficient and synchronous downloader of map tiles. Allows for a fast and easy approach to make map tiles (from a WMS) available offline.

## Install

```
npm i map-tiles-crawler (-g for global install)
```

## Usage from CLI

```
mtc --url http://maps.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg \
    --target ./.tmp/ \
    --level 18 \
    --topLeft 47.46465597:11.91329956 \
    --bottomRight 47.46140645:11.9243288 \
    --wait 100
```

## Usage (programmatic)

```javascript
var crawler = require('map-tiles-crawler');
crawler.crawl({
    url: 'http://maps.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg' ,
    targetFolder: './.tmp' ,
    level : 18 ,
    topLeft: [47.46575119, 11.92384601] ,
    bottomRight: [47.46068834, 11.91423297] ,
    wait: 100 ,
    progress : (tile) => { // callback after tile download } ,
    success : () => { // callback after all tiles are downloaded } ,
    error : (tile) => { // callback if a tile couldn't be downloaded }
});
```

## Params

| Param | Description |
| --- | --- |
| url | the url of the WMS endpoint with coordinates as placeholders in the url e.g.: http://maps.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg |
| targetFolder | The filesystem folder, where all files will be downloaded to |
| level | The zoom level for the crawling |
| topLeft | the top-left geo-coordinate of the area to crawl as array |
| bottomRight | the bottom-right geo-coordinate of the area to crawl as array |
| wait | waiting time after each tile download, this allows for throttling the downloads |
| progress | callback after each tile download |
| success | callback after all tiles were downloaded successfully |
| error | callback after a error happened |

---
_Source: https://npm.io/package/map-tiles-crawler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
