vue-baidu-map-api-v3
v1.0.1
Published
Baidu Map Component for Vue 2.0 (API v3)
Downloads
104
Maintainers
Readme
VUE BAIDU MAP (API v3)
⚠️ Special Instruction
The current package is copied from the Vue-Baidu-Map of Dafrok. Since the original author has not maintained the Vue-Baidu-Map package, I copied it for personal use and changed the BAIDU Map API to 3.0.
- Original repository: https://github.com/Dafrok/vue-baidu-map
- This is a maintained fork with API 3.0 support
Languages
Documentation
https://dafrok.github.io/vue-baidu-map
Get Start
Installation
npm i --save vue-baidu-map-api-v3Initialization
import Vue from 'vue'
import BaiduMap from 'vue-baidu-map-api-v3'
Vue.use(BaiduMap, {
/* Visit http://lbsyun.baidu.com/apiconsole/key for details about app key. */
ak: 'YOUR_APP_KEY',
/* Optional: specify Baidu Map API version (default: '3.0') */
apiV: '3.0'
})Global Configuration Options:
ak(required): Your Baidu Map API keyapiV(optional): Baidu Map API version (default: '3.0')
Usage
Basic Usage
<template>
<baidu-map class="map">
</baidu-map>
</template>
<style>
/* The container of BaiduMap must be set width & height. */
.map {
width: 100%;
height: 300px;
}
</style>Override API Version in Component
You can also specify the apiV prop directly on the map component to override the global configuration:
<template>
<baidu-map class="map" ak="YOUR_APP_KEY" api-v="3.0">
</baidu-map>
</template>Contributing
License
Copyright (c) 2016-present, Dafrok [email protected]
