billy-poon / echarts-amap

an echarts extension to support AMap(http://lbs.amap.com/)
MIT License
60 stars 31 forks source link

How to use AMap api in React project? #9

Open szu-bee opened 5 years ago

szu-bee commented 5 years ago

How can I apply following code for my react project? Where is AMap from?

let map = echart.getModel().getComponent('amap').getAMap();

AMap.plugin(["AMap.ControlBar"], function () {
  let bar = new AMap.ControlBar();   
  map.addControl(bar);
});
billy-poon commented 5 years ago

AMap是来自高德地图的JS SDK,参考:https://lbs.amap.com/api/javascript-api/summary/