let contextmenu = new KMap.Contextmenu() contextmenu.addItem("放大一级", (e) => { let zoom = map.getZoom(); map.setZoom(zoom + 1, 500); map.close(contextmenu); }); map.on("rightclick", function (e) { map.open(contextmenu, e.position); });
map.off("rightclick"); //将地图的rightclick右键点击事件移除