开发者社区> 问答> 正文

echarts迁徙图动态加载数据,出现错误,求助?报错

主要代码如下,不知是给的拼接数据错误还是什么问题。。报错和拼接后的数据在二楼截图

var geoCoord = {};
  var markPoint = new Array(); //{ name : '常州', value : 10 }
  var markLine = new Array(); //[ { name : '北京' }, { name : '长春', value : 40 }]
  $.ajax({
          url:fullpath + '/phone_poi_clusterController.do?queryCenter',
          type:'post',
          dataType:'json',
          success:function(json){
    $.each(json.rows,function(i,bean){ 
     var geo = new Array();
     var line = new Array();
     var points = new Array();
     
     geo.push(bean.latitude);
     geo.push(bean.longitude);
     line.push({'name':'祈福新村'});
     line.push({'name':bean.classification,'value':bean.count});
     
     points.push({'name':bean.classification});
     points.push({'value':bean.count});
     markPoint.push(points);
     markLine.push(line);
     geoCoord[bean.classification] = geo;
     
       });
  option = {
            color: ['gold','aqua','lime'],
            title : {
                text: '模拟迁徙',
                subtext:'数据纯属虚构',
                x:'center',
                textStyle : {
                    color: '#fff'
                }
            },
            tooltip : {
                trigger: 'item',
                formatter: function (v) {
                    return v[1].replace(':', ' > ');
                }
            },
            legend: {
                orient: 'vertical',
                x:'left',
                data:['祈福新村'],
                selectedMode: 'single',
                textStyle : {
                    color: '#fff'
                }
            },
            toolbox: {
                show : true,
                orient : 'vertical',
                x: 'right',
                y: 'center',
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            dataRange: {
                min : 0,
                max : 100,
                x: 'right',
                calculable : true,
                color: ['#ff3333', 'orange', 'yellow','lime','aqua'],
                textStyle:{
                    color:'#fff'
                }
            },
            series : [
                {
                    name:'祈福新村',
                    type:'map',
                    mapType: 'none',
                    data:[],
                    geoCoord: geoCoord,

                    markLine : {
                        smooth:true,
                        effect : {
                            show: true,
                            scaleSize: 1,
                            period: 30,
                            color: '#fff',
                            shadowBlur: 10
                        },
                        itemStyle : {
                            normal: {
                                borderWidth:1,
                                lineStyle: {
                                    type: 'solid',
                                    shadowBlur: 10
                                }
                            }
                        },
                        data : markLine
                    },
                    markPoint : {
                        symbol:'emptyCircle',
                        symbolSize : function (v){
                            return 10 + v/10
                        },
                        effect : {
                            show: true,
                            shadowBlur : 0
                        },
                        itemStyle:{
                            normal:{
                                label:{show:false}
                            }
                        },
                        data : markPoint
                    }              
                }]
                };
    console.log(option);
    var myChart = BMapExt.initECharts(container);
       BMapExt.setOption(option);

展开
收起
爱吃鱼的程序员 2020-06-12 14:46:07 667 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    <imgalt=""src="http://static.oschina.net/uploads/space/2015/0812/164548_sJve_2434709.png"><imgalt=""src="http://static.oschina.net/uploads/space/2015/0812/164616_lByt_2434709.png">哥们我也遇到跟你一样的问题,你的问题解决了吗?能告诉我怎么解决的吗,我的邮箱wangpanfigo@qq.com 谢谢回复<aclass='referer'target='_blank'>@Please叫我程序猿先生:什么意思,能给我一份代码我看看吗?迁徙起始点的坐标也要加到geoCoord里面哥们能给我看看你的代码吗,你是怎么写的,急啊!!!

    2020-06-12 14:46:25
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
动态、高效,蚂蚁动态卡片的内核逻辑 立即下载
复杂环境下的视觉同时定位与地图构建 立即下载
Python第五讲——关于爬虫如何做js逆向的思路 立即下载

相关实验场景

更多