Socket
Socket
Sign inDemoInstall

vue2-baidu-map

Package Overview
Dependencies
22
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue2-baidu-map

vue-baidu-map的vue2版本(支持v2.0、v3.0和webGl api)。Baidu Map Component for Vue 2.0 (support v2.0 、 v3.0 and webGl api)


Version published
Weekly downloads
17
increased by41.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

VUE3 BAIDU MAP

baidu-map组件通过webpack构建的vue2版本(支持地图v2.0、v3.0和webGl)

baidu-map组件vue3版本移步(支持地图v2.0、v3.0和webGl)

vue-baidu-map-3x

基于 VUE 2.x 的百度地图组件

npm

语言

文档(和vue-baidu-map-3x公用,文档中vue-baidu-3x自行脑补为vue2-baidu-map)

https://yangjianfei.github.io/vue-baidu-map-3x/

开始

安装

npm i --save vue2-baidu-map

初始化

import Vue from 'vue'
import BaiduMap from 'vue2-baidu-map'

Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'YOUR_APP_KEY',
  // v:'2.0',  // 默认使用3.0
  // type: 'WebGL' // ||API 默认API  (使用此模式 BMap=BMapGL)
});

使用

<template>
  <baidu-map class="map" :center="{lng: 118.454, lat: 32.955}" :zoom="5" @ready="ready" >
  </baidu-map>
</template>

<script>
export default {
  methods: {
    ready({BMap,map})=>{
      //  对地图进行自定义操作
    };
  }
}
</script>

<style>
/* 地图容器必须设置宽和高属性 */
.map {
  width: 400px;
  height: 300px;
}
</style>

离线地图

安装插件使用npm i vue-baidu-map-offline

废弃

BmView 废弃了BmView组件

全国地区编码坐标点数据集

import AreaCodePoint from 'vue-baidu-map-3x/dist/areaCodePoint.json';

// 示例:
{
  "110000": {
    "lat": 39.91101332265389,
    "lng": 116.413554023728
  }
  // 其他地区。。。
}

协议

MIT 许可证

版权所有 (c) 2016至今, YangJianFei 1294485765@qq.com

关于我

扫描添加下方的微信(yjf163163)并回复加群,即可加入”前端男海群“。交流学习,及时获取代码最新动态。

如果对你有帮助送我一颗小星星(づ ̄3 ̄)づ╭❤~

任务清单

  • 按需加载
  • treeshaking
  • 箭头绘制,区域划分

更新日志

更新日志

Keywords

FAQs

Last updated on 07 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc