echar 地图载入有问题 无法获取coordinateSystem的type属性

如下,使用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)

1个回答

coordSys.type 改为 coordSys.bmap.type

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问