All Projects → plainheart → echarts-extension-amap

plainheart / echarts-extension-amap

Licence: MIT license
🚩 An AMap (https://lbs.amap.com) extension for Apache ECharts (https://github.com/apache/echarts)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to echarts-extension-amap

Echarts3 Chinese Map Drill Down
Echarts3中国地图下钻至县级 🌏
Stars: ✭ 421 (+133.89%)
Mutual labels:  map, echarts
AmapLike
【高仿】高德地图 包含定位、搜索、路径规划等功能 map bottomsheet
Stars: ✭ 51 (-71.67%)
Mutual labels:  map, amap
L7
🌎 Large-scale WebGL-powered Geospatial Data Visualization analysis framework which relies on Mapbox GL or AMap to render basemaps.
Stars: ✭ 2,517 (+1298.33%)
Mutual labels:  map, amap
AMapMarker-master
提供一种高德地图自定义marker的解决方案以及改善高德官方点聚合功能
Stars: ✭ 63 (-65%)
Mutual labels:  amap, gaode
jh-weapp-demo
微信小程序项目- 实现一些常用效果、封装通用组件和工具类
Stars: ✭ 60 (-66.67%)
Mutual labels:  map, echarts
City Vein
Urban structure characterized by 🚌 public lines
Stars: ✭ 644 (+257.78%)
Mutual labels:  map, echarts
Ol3echarts
🌏 📊 ol3Echarts | a openlayers extension to echarts
Stars: ✭ 229 (+27.22%)
Mutual labels:  map, echarts
Real-time-log-analysis-system
🐧基于spark streaming+flume+kafka+hbase的实时日志处理分析系统(分为控制台版本和基于springboot、Echarts等的Web UI可视化版本)
Stars: ✭ 31 (-82.78%)
Mutual labels:  echarts
Co-ronaBD.info
Interactive Dashboard of Bangladesh for the Covid-19 Pandemic
Stars: ✭ 28 (-84.44%)
Mutual labels:  map
ping-vue-admin
用vue做的一个后台管理系统模板,可以用此项目作为一个脚手架工程
Stars: ✭ 50 (-72.22%)
Mutual labels:  echarts
echarts-map
Echarts中国地图三级钻取
Stars: ✭ 62 (-65.56%)
Mutual labels:  echarts
myblog
An Open Source Multi-user Blog System that Powered by Flask.
Stars: ✭ 19 (-89.44%)
Mutual labels:  echarts
unist-util-map
utility to create a new tree by mapping all nodes
Stars: ✭ 30 (-83.33%)
Mutual labels:  map
admin-work
Vue3 和 NaiveUI 的完美结合—Admin Work,拥有漂亮、强大、完善的功能。采用 Vue3 Vite2 Typescript NaiveUI Pinia编写的中后台框架。全面的系统配置,优质模板,常用组件,真正一站式开箱即用。持续更新,不断完善,一直在前进~~
Stars: ✭ 394 (+118.89%)
Mutual labels:  echarts4
coronavirus-map-dashboard
🦠 Coronavirus (COVID-19) Map Dashboard using coronavirus-tracker-api
Stars: ✭ 41 (-77.22%)
Mutual labels:  map
aws-map
Make a network graph of an AWS region
Stars: ✭ 79 (-56.11%)
Mutual labels:  map
vue-echarts-v3-demo
Vue.js(v2.x+) component wrap for ECharts.js(v3.x+) demo
Stars: ✭ 52 (-71.11%)
Mutual labels:  echarts
react-amap
基于 React 封装的高德地图组件,助你轻松的接入高德地图到 React 项目中。
Stars: ✭ 73 (-59.44%)
Mutual labels:  amap
pics-by-echarts
some pics by echarts.js
Stars: ✭ 32 (-82.22%)
Mutual labels:  echarts
dashing
Something beautiful inside and out.
Stars: ✭ 19 (-89.44%)
Mutual labels:  echarts

NPM version Build Status NPM Downloads jsDelivr Downloads License

AMap extension for Apache ECharts

中文说明

Online example on CodePen

This is an AMap extension for Apache ECharts which is used to display visualizations such as Scatter, Lines, Heatmap, and Pie.

Examples

Scatter: examples/scatter.html

Preview-Scatter

Heatmap: examples/heatmap.html

Preview-Heatmap

Lines: examples/lines.html

Preview-Lines

Pie: examples/pie.html (Since v1.11.0)

Preview-Pie

Installation

npm install echarts-extension-amap --save

Import

Import packaged distribution file echarts-extension-amap.min.js and add AMap API script and ECharts script.

<!-- import JavaScript API of AMap, please replace the ak with your own key and specify the version and plugins you need -->
<!-- Plugin `AMap.CustomLayer` is required if you are using a version of library less than v1.9.0 -->
<script src="https://webapi.amap.com/maps?v=1.4.15&key={ak}&plugin=AMap.Scale,AMap.ToolBar"></script>
<!-- import ECharts -->
<script src="/path/to/echarts.min.js"></script>
<!-- import echarts-extension-amap -->
<script src="dist/echarts-extension-amap.min.js"></script>

You can also import this extension by require or import if you are using webpack or any other bundler.

// use require
require('echarts');
require('echarts-extension-amap');

// use import
import * as echarts from 'echarts';
import 'echarts-extension-amap';

If importing dynamically the API script is needed, it's suggested to use amap-jsapi-loader or wrap a dynamic and asynchronized script loader manually through Promise.

Use CDN

jsDelivr

Use the latest version

https://cdn.jsdelivr.net/npm/echarts-extension-amap/dist/echarts-extension-amap.min.js

Use a specific version

https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-extension-amap.min.js

unpkg

Use the latest version

https://unpkg.com/echarts-extension-amap/dist/echarts-extension-amap.min.js

Use a specific version

https://unpkg.com/[email protected]/dist/echarts-extension-amap.min.js

This extension will register itself as a component of echarts after it is imported.

Apache ECharts 5 import on demand

Apache ECharts has provided us the new tree-shaking API since v5.0.1. This is how to use it in this extension:

// import scatter, effectScatter and amap extension component on demand
import * as echarts from 'echarts/core';
import {
  ScatterChart,
  ScatterSeriesOption,
  EffectScatterChart,
  EffectScatterSeriesOption
} from 'echarts/charts';
import {
  TooltipComponent,
  TitleComponentOption
} from 'echarts/components';
import { CanvasRenderer } from 'echarts/renderers';
import {
  install as AMapComponent,
  AMapComponentOption
} from 'echarts-extension-amap/export';

// import the official type definition for AMap 2.0
import '@amap/amap-jsapi-types';

// compose required options
type ECOption = echarts.ComposeOption<
  | ScatterSeriesOption
  | EffectScatterSeriesOption
  | TitleComponentOption
  // unite AMapComponentOption with the initial options of AMap `AMap.MapOptions`
> & AMapComponentOption<AMap.MapOptions>;

// register renderers, components and charts
echarts.use([
  CanvasRenderer,
  TooltipComponent,
  AMapComponent,
  ScatterChart,
  EffectScatterChart
]);

// define ECharts option
const option: ECOption = {
  // AMap extension option
  amap: {
    // ...
  },
  title: {
    // ...
  },
  series: [
    {
      type: 'scatter',
      // Use AMap coordinate system
      coordinateSystem: 'amap',
      // ...
    }
  ]
  // ...
};

Usage

option = {
  // load amap component
  amap: {
    // enable 3D mode
    // Note that it's suggested to enable 3D mode to improve echarts rendering.
    viewMode: '3D',
    // initial options of AMap
    // See https://lbs.amap.com/api/javascript-api/reference/map#MapOption for details
    // initial map center [lng, lat]
    center: [108.39, 39.9],
    // initial map zoom
    zoom: 4,
    // whether the map and echarts automatically handles browser window resize to update itself.
    resizeEnable: true,
    // customized map style, see https://lbs.amap.com/dev/mapstyle/index for details
    mapStyle: 'amap://styles/dark',
    // whether echarts layer should be rendered when the map is moving. Default is true.
    // if false, it will only be re-rendered after the map `moveend`.
    // It's better to set this option to false if data is large.
    renderOnMoving: true,
    // the zIndex of echarts layer for AMap, default value is 2000.
    // deprecated since v1.9.0, use `echartsLayerInteractive` instead.
    echartsLayerZIndex: 2019,
    // whether echarts layer is interactive. Default value is true
    // supported since v1.9.0
    echartsLayerInteractive: true,
    // whether to enable large mode. Default value is false
    // supported since v1.9.0
    largeMode: false
    // Note: Please DO NOT use the initial option `layers` to add Satellite/RoadNet/Other layers now.
    // There are some bugs about it, we can use `amap.add` instead.
    // Refer to the codes at the bottom.

    // More initial options...
  },
  series: [
    {
      type: 'scatter',
      // use `amap` as the coordinate system
      coordinateSystem: 'amap',
      // data items [[lng, lat, value], [lng, lat, value], ...]
      data: [[120, 30, 8], [120.1, 30.2, 20]],
      encode: {
        // encode the third element of data item as the `value` dimension
        value: 2
      }
    }
  ]
};

// Get AMap extension component
var amapComponent = chart.getModel().getComponent('amap');
// Get the instance of AMap
var amap = amapComponent.getAMap();
// Add some controls provided by AMap.
amap.addControl(new AMap.Scale());
amap.addControl(new AMap.ToolBar());
// Add SatelliteLayer and RoadNetLayer to map
var satelliteLayer = new AMap.TileLayer.Satellite();
var roadNetLayer = new AMap.TileLayer.RoadNet();
amap.add([satelliteLayer, roadNetLayer]);
// Add a marker to map
amap.add(new AMap.Marker({
  position: [115, 35]
}));
// Make the overlay layer of AMap interactive
amapComponent.setEChartsLayerInteractive(false);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].