Highmaps错误:" F不是函数"

时间:2016-05-12 16:19:57

标签: javascript highcharts highmaps

在高图使用期间面临一些奇怪的问题。 试图用事务点绘制世界地图但它失败了,在控制台中我看到错误" F不是一个函数"在map.js文件中

以下是我使用的脚本:

<script type="text/javascript" src="js/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="https://code.highcharts.com/maps/highmaps.js"></script>
<script type="text/javascript" src="https://code.highcharts.com/maps/modules/data.js"></script>
<script type="text/javascript" src="https://code.highcharts.com/mapdata/custom/world.js"></script>
<script type="text/javascript"src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js"></script>
<script type="text/javascript" src="js/highcharts.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/maps/modules/map.js"></script>

这里是main函数绘制图形:

function drawmap(val)
{
    setTimeout
    (
        function () {
$.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=world-population.json&callback=?', function (data) {

   opt = {
        tooltip: {
                 formatter: function(){
                     var s = 'Lattitude:' + this.point.lat + '<br/>';
                     s += 'Longitude:' + this.point.lon + '<br/>';
                     s += 'Location:' + this.point.coord + '<br/>';
                     s += 'Data:' + this.point.data + '<br/>';
                     s += 'Category:' + this.point.cat + '<br/>';
                     s += 'Sum:' + this.point.sum + '<br/>';
                     return s;
                 },
             },

        chart : {
            borderWidth : 1,
            renderTo: 'graphic4'
        },

        title: {
            text: 'Customer transactions'
        },

        legend: {
            enabled: false
        },

        mapNavigation: {
            enabled: true,
            buttonOptions: {
                verticalAlign: 'bottom'
            }
        },
        series : [{
            mapData: Highcharts.maps['custom/world'],
            joinBy: ['iso-a2', 'code'],
            enableMouseTracking: true,
       }, {
            type: 'mappoint',
            data: [],
             marker: {
                fillColor: "#60AFFF",
                radius : 8,
                lineColor: "black"
            }
        }]
   };
opt.series[1].data = val;
window.chart = new Highcharts.Map(opt);  
});
},50);

}

希望有人可以帮助我。几天前,这段代码没有错误。

0 个答案:

没有答案