如下,使用echart进行绘制地图,但无法正常运行,报错是无法获取coordinateSystem的type属性,可是相同代码在echart的实例网站上可以运行,不知道是什么问题?
animation: false,
bmap: {
type: 'cartesian2d',
center: [120.13066322374, 30.240018034923],
zoom: 14,
roam: true
},
visualMap: {
show: false,
top: 'top',
min: 0,
max: 5,
seriesIndex: 0,
calculable: true,
inRange: {
color: ['blue', 'blue', 'green', 'yellow', 'red']
}
},
series: [{
type: 'heatmap',
coordinateSystem: 'bmap',
data: [[120,30]],
pointSize: 50,
blurSize: 6
}]
报错行:
if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {
this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());
}
报错信息:
Uncaught TypeError: Cannot read property 'type' of null
at ExtendedClass.render (echarts.js:64473)
at Task.progress (echarts.js:24193)
at doProgress (echarts.js:23115)
at Task.taskProto.perform (echarts.js:23038)
at echarts.js:27882
at ExtendedClass. (echarts.js:21073)
at Array.forEach ()
at each$1 (echarts.js:528)
at ExtendedClass.eachSeries (echarts.js:21071)
at renderSeries (echarts.js:27871)