我有一个页面,其中包含报表功能的图表和地图菜单。然后,我选择Highchart-Highmap库来达到上述目的。图表功能运行良好但是当我开发地图功能时会出现错误
TypeError:ma不是函数
jQuery.noConflict();
放在highmaps中,但冲突仍然存在这是我在主页面中的代码
... some html code
<script type="text/javascript" src="././js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="././js/highcharts/highcharts-more.js"></script>
<script type="text/javascript" src="././js/highcharts/highcharts-3d.js"></script>
<script type="text/javascript" src="././js/highcharts/modules/drilldown.js"></script>
<script type="text/javascript" src="././js/highcharts/modules/exporting.js"></script>
... some html code
<script type="text/javascript" src="././js/Highmaps/highmaps.js"></script>
<script type="text/javascript" src="././js/Highmaps/modules/data.js"></script>
<script type="text/javascript" src="././js/Highmaps/modules/exporting.js"></script>
我怎么解决这个问题?
您需要使用map.js模块而不是highmaps。
<script src="//code.highcharts.com/maps/modules/map.js"></script>
您必须在highcharts.js
之后包含此脚本标记:
<script src="https://code.highcharts.com/maps/modules/map.js"></script>
我遇到了同样的问题,并通过在地图后放置高图来解决它
<script src="http://code.highcharts.com/maps/highmaps.js"></script>
<script src="http://code.highcharts.com/maps/modules/data.js"></script>
<script src="http://code.highcharts.com/maps/modules/exporting.js"></script>
<script src="http://code.highcharts.com/mapdata/custom/world.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>