Echarts: [MODULE_MISS]"echarts/src/util/mapData/params" is not exists!

monicafish 发布于 2014/10/22 11:36
阅读 4K+
收藏 0

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>ECharts</title>

    <script src="js/esl.js"></script>
    <script src="echarts/build/echarts-plain-map.js"></script>
</head>
<body>

    <div id="index" style="height:400px;width:800px;"></div>
    <script type="text/javascript">

        require.config({
            packages: [
                {
                    name: 'echarts',
                    location: 'echarts/src',
                    main: 'echarts'
                },
                {
                    name: 'zrender',
                    location: 'zrender/src', 
                    main: 'zrender'
                }
            ]
        });
        require('echarts/src/util/mapData/params').params.ZJ = {
            getGeoJson: function (callback) {
                $.getJSON('zjgeo.json',callback);
            }
        }

                ( function chartindex (ec) {
                    myChart = ec.init(document.getElementById('index'));

                    var effect = {
                        show: true,

                      period: 30,   
                        color: '#fff',
                        shadowColor: 'rgba(220,220,220,0.4)',
                        shadowBlur : 5
                    };
                    function itemStyle(idx) {
                        return {
                            normal: {
                                color:'#fff',
                                borderWidth:1,
                                borderColor:['rgba(30,144,255,1)','lime'][idx],
                                lineStyle: {
                                    //shadowColor : ['rgba(30,144,255,1)','lime'][idx], //默认透明
                                    //shadowBlur: 10,
                                    //shadowOffsetX: 0,
                                    //shadowOffsetY: 0,
                                    type: 'solid'
                                }
                            }
                        }
                    };

                    var option = {
                        backgroundColor: '#1b1b1b',
                        color: ['rgba(30,144,255,1)','lime'],
                        title : {
                            text: '浙江地圖',
                            x:'center',
                            textStyle : {
                                color: '#ffff00'
                            }
                        },
                        tooltip : {
                            trigger: 'item',
                            formatter: function (v) {
                                return v[1].replace(':', ' > ');
                            }
                        },
                        legend: {
                            orient: 'vertical',
                            x:'left',
                            selectedMode:'single',
                            data:['八纵通道', '八横通道'],
                            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}
                            }
                        },
                        series : [
                            {
                                name: '八纵通道',
                                type: 'map',
                                roam: true,
                                hoverable: false,
                                mapType: 'china',
                                itemStyle:{
                                    normal:{
                                        borderColor:'rgba(100,149,237,1)',
                                        borderWidth:0.5,
                                        areaStyle:{
                                            color: '#1b1b1b'
                                        }
                                    }
                                },
                                data:[],
                                markLine : {
                                    symbol: ['circle', 'circle'],
                                    symbolSize : 1,
                                    effect : effect,
                                    itemStyle : itemStyle(0),
                                    smooth:true,
                                    data : [
                                        [{name:'杭州市'}, {name:'丽水市'}],

                                        [{name:'杭州市'}, {name:'金华市'}]
                                    ]
                                }
                            },
                            {
                                name: '八横通道',
                                type: 'map',
                                mapType: 'china',
                                itedmStyle:{
                                    normal:{
                                        borderColor:'rgba(100,149,237,1)',
                                        borderWidth:0.5,
                                        areaStyle:{
                                            color: '#1b1b1b'
                                        }
                                    }
                                },
                                data:[],
                                markLine : {
                                    symbol: ['circle', 'circle'],
                                    symbolSize : 1,
                                    effect : effect,
                                    itemStyle : itemStyle(1),
                                    smooth:true,
                                    data : [
                                        [{name:'衢州市'}, {name:'温州市'}],

                                        [{name:'衢州市'}, {name:'湖州市'}]
                                    ]
                                }

                            }
                        ]
                    };

                    // 为echarts对象加载数据
                    myChart.setOption(option);
                })();

    </script>

引入了echarts-plain-map.js为什么还会出现[MODULE_MISS]"echarts/src/util/mapData/params" is not exists!错误?

加载中
0
Kener-林峰
Kener-林峰

-_-|||

http://echarts.baidu.com/doc/doc.html#引入ECharts

monicafish
monicafish
已经引入了,还是不行。。肿么破
0
monicafish
monicafish

引用来自“Kener-林峰”的评论

-_-|||

http://echarts.baidu.com/doc/doc.html#引入ECharts

<script src="js/esl.js"></script>
    <script src="echarts/build/echarts-plain-map.js"></script>这里已经引入了, 
require.config({
            packages: [
                {
                    name: 'echarts',
                    location: 'echarts',
                    main: 'echarts'
                }
            ]
        });这里的包也引入了,还是不行呐。。。肿么破
p
ppmmlong
那你再给个详细点的帮助文档好吧?
monicafish
monicafish
回复 @Kener-林峰 : 有木有例子可以参考下。。关于地图扩展的
Kener-林峰
Kener-林峰
回复 @monicafish : http://echarts.baidu.com/doc/start.html
monicafish
monicafish
回复 @Kener-林峰 : 上面的问题描述是完整的网页,下面这个字数限制,只能写这么多了。。有木有echarts交流的QQ群呢。。好想加入。。我已经导入了echarts为啥还是会报那个错呢。。
Kener-林峰
Kener-林峰
这样的写法就没看懂。。。
返回顶部
顶部