我已经发现了如何删除用于平移和缩放的控件。我还发现该属性停止放大鼠标点击。如何阻止用户使用鼠标平移地图?
答案 0 :(得分:6)
您应该设置map.dragMap = false;
答案 1 :(得分:3)
这是一个扩展的地图实例化示例,其中包含与问题中提到的功能相关的所有选项,包括已找到的选项和要求的OP。回答问题的选项是"dragMap": false
:
var map = AmCharts.makeChart("chartdiv", {
"type": "map",
"theme": "light",
"dataProvider": {
"map": "worldLow",
"getAreasFromMap": true
},
"dragMap": false, // disables map dragging/panning
"zoomOnDoubleClick": false, // disables zoom on double click
"zoomControl": {
"zoomControlEnabled": false, // disables +/- zoom control
"panControlEnabled": false // disables pan controls (default)
},
"areasSettings": {
"autoZoom": false, // disables zoom when click on area
"selectable": true // determines whether an area is selectable - i.e. clicking on an area/country changes its color
}
});
答案 2 :(得分:-1)
chart.seriesContainer.draggable = false;
访问https://www.amcharts.com/docs/v4/tutorials/disabling-zoom-and-pan-on-a-map-chart/