Giter Club home page Giter Club logo

vue-echarts-bmap-demo's Introduction

vue + echarts + bmap

1. 安装echarts(使用3.x, 4.x版本)

npm install [email protected] --save

如果需要在线定制适合自己项目的echarts包,可以使用<script>引入。建议开发环境使用echarts.js

<script src="echarts.min.js"></script>

在调用echarts的组件内引入,也可以在mian.js里面全局引入 import echarts from 'echarts'

如果项目使用typescript, 需要npm install @types/echarts --save

ECharts 目前暂停地图下载,所以使用百度地图作为底图,需要安装百度地图扩展

2. 安装百度地图扩展

bmap.js 下载地址https://github.com/apache/incubator-echarts/tree/master/extension/bmap

如果安装的是echarts完整包,里面包含百度地图扩展,路径为 echarts/extension/bmap/bmap.js

在项目里引入:

import 'echarts/extension/bmap/bmap' 或者 <script src="dist/extension/bmap.min.js"></script>

3. 引入百度地图jssdk

使用百度地图JavaScript API,需要先注册申请秘钥: http://lbsyun.baidu.com/apiconsole/key/create

<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=秘钥"></script>

百度地图的个性地图支持用户使用JavaScript API设置地图底图的样式风格以及控制组成地图底图的元素类的显示和隐藏。可以在个性化编辑平台定制适合自己项目的地图。编辑生成的JSON就是bmap.mapStyle.styleJson的值

百度地图个性化编辑器

4. 绘制地图

项目代码里面包括echarts地图常用的带有起点和终点信息的线路图散点图带有涟漪特效动画的散点图

vue-echarts-bmap-demo's People

Contributors

licong-site avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.