Disable traffic map views with HERE JavaScript API

送分小仙女□ 提交于 2019-11-29 17:07:58

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();

As of 8/2018, there does not appear to be any option in the API to create the default UI without the traffic views.

I used the following code to clean up the default menu:

let mapsettings = ui.getControl('mapsettings');
let menuEntries = mapsettings.getChildren()[1].getChildren();
menuEntries[0].getElement().style.borderBottom = 'none';
for (let i=1; i<menuEntries.length; i++)
    menuEntries[i].setVisibility(false);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!