vue-yandex-maps
vue-yandex-maps is a plugin for vue.js that adds yandex-map custom element.
Install
npm install vue-yandex-maps --save
CommonJS
You can use any build tool which supports commonjs
:
var yandexMap = require('vue-yandex-maps');
Vue.use(yandexMap)
var yandexMap = require('vue-yandex-maps');
new Vue({
components: {yandexMap}
})
Or in ES2015:
import yandexMap from 'vue-yandex-maps'
Vue.use(yandexMap)
import yandexMap from 'vue-yandex-maps'
new Vue({
components: {yandexMap}
})
Direct include
You can use the CDN: https://unpkg.com/vue-yandex-maps, yandexMap
is exposed to window
and will automatically install itself. Also you can use your local copy:
<script src="../node_modules/vue-yandex-maps/vue-yandex-maps.js"></script>
Usage
Use tag to enable the map instance, and use attributes to define map options.
<yandex-map :latitude=54.62896654088406
:longtitude=39.731893822753904
hint-content="Hint content 1"
balloon-content="Balloon content 1"></yandex-map>
Options
Option | Type | Description |
---|
latitude | Number | Latitude of map center |
longtitude | Number | Longtitude of map center |
hint-content | String | Tooltip content |
balloon-content | String | Balloon content |
License
MIT