0

通过 highmaps 演示,我成功加载了地图。脚本是:

<script src="http://code.highcharts.com/maps/modules/exporting.js"></script>
<script src="http://code.highcharts.com/mapdata/countries/cn/custom/cn-all-sar-taiwan.js"></script>

(highmaps 已经被 require.js 加载)

highmap 指令:(我喜欢 angular.js)

$scope.$on('mapInit', function(){

                element.highcharts('Map',{
                    title : {
                        text : 'Highmaps basic demo'
                    },

                    subtitle : {
                        text : 'Source map'
                    },

                    mapNavigation: {
                        enabled: true,
                        buttonOptions: {
                            verticalAlign: 'bottom'
                        }
                    },

                    colorAxis: {
                        min: 0
                    },

                    series : [{
                        data : data,
                        mapData: Highcharts.maps['countries/cn/custom/cn-all-sar-taiwan'],
                        joinBy: 'hc-key',
                        name: 'Random data',
                        states: {
                            hover: {
                                color: '#BADA55'
                            }
                        },
                        dataLabels: {
                            enabled: true,
                            format: '{point.name}'
                        }
                    }]
                });
            });

这是成功的!但是当我下载文件时:

作为本地文件,

<script src="./maps/modules/exporting.js"></script>
<script src="./mapdata/countries/cn/cn-all-sar-taiwan.js"></script>'

并更改地图数据:mapData:Highcharts.maps['countries/cn/cn-all-sar-taiwan']

地图不再显示!</p>

我认为mapData有问题,所以我尝试搜索highmaps API,没有任何东西......

请帮我!

4

0 回答 0