UNPKG

vue-mapbox

Version:

> Combine powers of [Vue.js](https://vuejs.org/) and [Mapbox Gl JS](https://mapbox.com/mapbox-gl-js)

30 lines (26 loc) 668 B
import promisify from "map-promisified"; export default { created() { this.actions = {}; }, methods: { $_registerAsyncActions(map) { this.actions = { ...promisify(map), stop() { this.map.stop(); const updatedProps = { pitch: this.map.getPitch(), zoom: this.map.getZoom(), bearing: this.map.getBearing(), center: this.map.getCenter() }; Object.entries(updatedProps).forEach(prop => { this.$_updateSyncedPropsFabric(prop[0], prop[1])(); }); return Promise.resolve(updatedProps); } }; } } };