mapir-vue
3,499
11
| Install | |
|---|---|
npm install mapir-vue |
|
| Latest Version: | 2.2.11 |
| Vue: | 2 |
| Last Updated: | Jan 10, 2021 |
| Links: | GitHub · npm |
Maintainer: mohammad.masumi
MapirVueComponent
Vue wrapper for mapbox-gl-js. Expose a bunch of component meant to be simple to use for Vue.
Get API Key
🔑 You should first get api key from Map.ir
Installation
npm i mapir-vue
Quick start
Template
<template>
<div id="app">
<mapir :apiKey="MapirApiKey" :center="coordinates" @load="onMapLoaded" @click="onClick"/>
</div>
</template>
Script
<script>
import { mapir } from "mapir-vue";
export default {
name: "App",
components: {
mapir
},
data() {
return {
coordinates: [51.420296, 35.732379],
MapirApiKey: "pk.Mapir" // your Api Key.
};
},
created() {
this.map = null;
},
methods: {
onMapLoaded(event) {
// in component
this.map = event.map;
// or just to store if you want have access from other components
this.$store.map = event.map;
},
onClick(e) {
console.log(e, "HIiiiiiiii");
}
}
};
</script>
Style
<style>
#app {
width: 100vw;
height: 100vh;
}
</style>
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 2.2.11 | ^2.6.6 | ||
| 2.2.10 | ^2.6.6 | ||
| 2.2.9 | ^2.6.6 | ||
| 2.2.8 | ^2.6.6 | ||
| 2.2.7 | ^2.6.6 | ||
| 2.2.6 | ^2.6.6 | ||
| 2.2.4 | ^2.6.6 | ||
| 2.2.3 | ^2.6.6 | ||
| 2.2.2 | ^2.6.6 | ||
| 2.2.1 | ^2.6.6 | ||
| 2.2.0 | ^2.6.6 | ||
| 2.1.6 | ^2.6.6 | ||
| 2.1.5 | ^2.6.6 | ||
| 2.1.4 | ^2.6.6 | ||
| 2.1.3 | ^2.6.6 | ||
| 2.1.2 | ^2.6.6 | ||
| 2.1.1 | ^2.6.6 | ||
| 2.1.0 | ^2.6.6 | ||
| 2.0.12 | ^2.6.6 | ||
| 2.0.11 | ^2.6.6 | ||
| 2.0.10 | ^2.6.6 | ||
| 2.0.9 | ^2.6.6 | ||
| 2.0.8 | ^2.6.6 | ||
| 2.0.7 | ^2.6.6 | ||
| 2.0.6 | ^2.6.6 | ||
| 2.0.5 | ^2.6.6 | ||
| 2.0.4 | ^2.6.6 | ||
| 2.0.3 | ^2.6.6 | ||
| 2.0.2 | ^2.6.6 | ||
| 2.0.1 | ^2.6.6 |
Showing the latest 30 of 58. See every release on npm