先上一段我结合高德1.4.15版本和echarts的代码:
let amap;
amap = {
viewMode: '2D',
center: [this.mapAttr.x, this.mapAttr.y],
zoom: this.mapAttr.scale,
disableSocket: false,
resizeEnable: true,
renderOnMoving: true,
labelzIndex: 111,
mask: mask,
mapStyle: 'amap://styles/darkblue'
};
this.myChart = echarts.init(document.getElementById('container'));
this.myChart.setOption({
amap: amap,
animation: false,
series: []
});
this.map = this.myChart.getModel().getComponent('amap').getAMap();
这段代码当时跑的是没有问题的,但现在script中使用了v=2.0后就报了这个错(图片上传不上来抱歉):
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'render' of undefined
TypeError: Cannot read property 'render' of undefined
at ur.or [as constructor] (maps?v=2.0&key=285d48939f946821e756e3cb7deadb12&plugin=AMap.DistrictSearch:1)
at new ur (maps?v=2.0&key=285d48939f946821e756e3cb7deadb12&plugin=AMap.DistrictSearch:1)
at echarts-amap.min.js:15
at Array.forEach (<anonymous>)
at E (echarts.min.js:22)
at eachComponent (echarts.min.js:22)
at Function.r.create (echarts-amap.min.js:12)
at echarts.min.js:22
at E (echarts.min.js:22)
at lh.create (echarts.min.js:22)
at Rd.update (echarts.min.js:22)
at Rd.zd.setOption (echarts.min.js:22)
at GDEditorPublicPanel.initMap (gdEditor.component.ts:361)
at GDEditorPublicPanel.onloadMap (gdEditor.component.ts:265)
at gdEditor.component.ts:255
at resolvePromise (zone-evergreen.js:798) [angular]
at :3001/polyfills.js:10900:21 [angular]
at Object.onInvokeTask (core.js:41686) [angular]
at drainMicroTaskQueue (zone-evergreen.js:569) [<root>]
core.js:6241 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'hide' of undefined
TypeError: Cannot read property 'hide' of undefined
at echarts-amap.min.js:17
at Array.forEach (<anonymous>)
at E (echarts.min.js:22)
at eachComponent (echarts.min.js:22)
at Function.r.create (echarts-amap.min.js:12)
at echarts.min.js:22
at E (echarts.min.js:22)
at lh.create (echarts.min.js:22)
at Rd.update (echarts.min.js:22)
at Rd.zd.setOption (echarts.min.js:22)
at GDEditorPublicPanel.initMap (gdEditor.component.ts:361)
at GDEditorPublicPanel.onloadMap (gdEditor.component.ts:265)
at gdEditor.component.ts:255
at ZoneDelegate.invoke (zone-evergreen.js:364)
at Object.onInvoke (core.js:41708)
at resolvePromise (zone-evergreen.js:798) [angular]
at :3001/polyfills.js:10900:21 [angular]
at Object.onInvokeTask (core.js:41686) [angular]
at drainMicroTaskQueue (zone-evergreen.js:569) [<root>]
地图加载不出来了
所以各位有没有什么思路?