我正在使用amCharts - 地图。
如何在amCharts中双击地图上的主页图标时删除缩放?
HTML:
<head>
<title>jVectorMap demo</title>
<script src="ammap/ammap.js" type="text/javascript"></script>
<link rel="stylesheet" href="ammap/ammap.css" type="text/css" media="all" />
<script src="ammap/maps/js/japanHigh.js" type="text/javascript"></script>
<script src="js/map.js"></script>
</head>
<body>
<div id="mapdiv" style="width: 1350px; height: 550px;"></div>
</body>
使用Javascript:
let map = AmCharts.makeChart("mapdiv", {
"type": "map",
"dragMap": false,
/* can't drag the maparound now*/
"dataProvider": {
"map": "japanHigh",
"getAreasFromMap": true
},
"areasSettings": {
// "autoZoom": false,
"selectedColor": "#CC0000"
},
"zoomControl": {
"zoomControlEnabled": false,
/*removing the zoomin and out button from top left corner */
// "maxZoomLevel": 0
// "zoomFactor":false
}
});
答案 0 :(得分:3)
要在双击ammap时删除缩放效果,您可以将zoomOnDoubleClick
定义为false
。要删除主页图标,您可以将homeButtonEnabled
定义为false
。
对于您的代码,它将是:
let map = AmCharts.makeChart( "mapdiv", {
"type": "map",
"dragMap": false, /* can't drag the maparound now*/
"zoomOnDoubleClick": false,
"dataProvider": {
"map": "japanHigh",
"getAreasFromMap": true
},
"areasSettings": {
// "autoZoom": false,
"selectedColor": "#CC0000"
},
"zoomControl": {
"zoomControlEnabled": false, /*removing the zoomin and out button from top left corner */
"homeButtonEnabled": false
// "maxZoomLevel": 0
// "zoomFactor":false
}
});