문제

I have discovered how to remove the controls for panning and zooming. I also found the property to stop zooming in on mouse clicks. How can I prevent the user from panning the map with the mouse?

도움이 되었습니까?

해결책

You should set map.dragMap = false;

다른 팁

Here is an example of map instantiation expanded with all options related to the functionality mentioned in the question, both the ones already found and the one OP asked for. The option that answers the question is "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
    }
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top