如何在页面加载时对亚洲大陆进行默认缩放。在Amcharts地图
答案 0 :(得分:2)
您可以将地图dataProvider
中的zoomLatitude
,zoomLongitude
和zoomLevel
设置为您希望地图加载的默认位置和缩放级别。
以下示例:
var map = AmCharts.makeChart("chartdiv", {
"type": "map",
"theme": "light",
"dataProvider": {
"map": "continentsLow",
"zoomLatitude": 47.8936,
"zoomLongitude": 115.6176,
"zoomLevel": 2,
"getAreasFromMap": true,
"areas": [{
"id": "asia",
"showAsSelected": true
}]
},
"areasSettings": {
"autoZoom": false,
"selectedColor": "#CC0000"
}
});

<script src="https://www.amcharts.com/lib/3/ammap.js"></script>
<script src="https://www.amcharts.com/lib/3/maps/js/continentsLow.js"></script>
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
<div id="chartdiv" style="width:100%; height: 250px"></div>
&#13;