问题描述
HERE地图材料具有不同的地图视图和可能的覆盖,例如交通状况",公共交通"和事件".我根本不想提供这三种观点.不幸的是,我只能通过以下代码停用它们:
HERE Map material comes with different map views and possible overlays like 'Traffic conditions', 'Public transport' and 'Incidents'. I do not want to offer these three views at all. Unfortunately, I was only able to deactivate them by the following code:
//disable traffic information
var control = HEREMap.ui.getControl('mapsettings');
control.getChildren()[1].m[3].setDisabled(true);
control.getChildren()[1].m[2].setDisabled(true);
control.getChildren()[1].m[1].setDisabled(true);
但是,这给我留下了灰色的,无法点击的选项,例如交通状况",公共交通"和事件".有没有办法使用JavaScript API完全不显示它们?
However, this leaves me with gray, unclickable options for like 'Traffic conditions', 'Public transport' and 'Incidents'. Is there a way to show them not at all using the JavaScript API?
预先感谢DG7队
推荐答案
不漂亮,但可以.按照相同的方法删除小时.
Not pretty but it works. Follow the same approach to remove the hr.
$(".H_btn:contains('Traffic conditions')").hide();
$(".H_btn:contains('Public transport')").hide();
$(".H_btn:contains('Show traffic incidents')").hide();
不使用jQuery的替代方法:
alternative without jQuery:
control.getChildren()[1].m[3].el.hidden = true;
control.getChildren()[1].m[2].el.hidden = true;
control.getChildren()[1].m[1].el.hidden = true;
这篇关于使用此处的JavaScript API禁用交通图视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!