# map-promisified

> Wrapper for Mapbox Gl JS library that gives nice Promise-based API to asynchronous map functions

Latest version **0.4.0** (published 2018-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install map-promisified
pnpm add map-promisified
yarn add map-promisified
bun add map-promisified
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2018-12-08 |
| First published | 2018-11-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Author | soal |
| Maintainers | soal |

## Links

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

## Recent versions

- 0.4.0 (latest) — 2018-12-08
- 0.3.0 — 2018-12-01
- 0.2.0 — 2018-11-24
- 0.1.1 — 2018-11-21
- 0.1.0 — 2018-11-18

## README

# map-promisified
Wrapper for Mapbox Gl JS library that gives nice Promise-based API to asynchronous map functions

Usage:
```javascript
import promisify from 'map-promisified'
import Mapbox from 'mapbox-gl'

const map = new Mapbox.Map({
  // … map properties …
})

// promisify single method:
const flyToPromisified = promisify(map, 'flyTo')

async function flyToPosition () {
  const newPosition = await flyToPromisified([10, 20])
  console.log(newPosition)
  // ⇒ { bearing: 0
  //​      center: Object { lng: …, lat: … },
  //      pitch: 0,
  //      zoom: 9
  //    }
}

// promisify all async map methods:
const actions = promisify(map)

async function flyToPositionAction () {
  const newPosition = await actions.flyTo([10, 20])
  console.log(newPosition)
  // ⇒ { bearing: 0
  //​      center: Object { lng: …, lat: … },
  //      pitch: 0,
  //      zoom: 9
  //    }
}
```

Promisified methods:
  * setCenter
  * panBy
  * panTo
  * setZoom
  * zoomTo
  * zoomIn
  * zoomOut
  * setBearing
  * rotateTo
  * resetNorth
  * snapToNorth
  * setPitch
  * fitBounds
  * fitScreenCoordinates
  * jumpTo
  * easeTo
  * flyTo

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