map-promisified
Wrapper for Mapbox Gl JS library that gives nice Promise-based API to asynchronous map functions
Usage:
const map = // … map properties … // promisify single method:const flyToPromisified = { const newPosition = await console // ⇒ { bearing: 0 // center: Object { lng: …, lat: … }, // pitch: 0, // zoom: 9 // }} // promisify all async map methods:const actions = { const newPosition = await actions console // ⇒ { 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