使用HERE JavaScript API禁用流量图视图(Disable traffic map views with HERE JavaScript API)

编程入门 行业动态 更新时间:2024-10-22 23:13:40
使用HERE JavaScript API禁用流量图视图(Disable traffic map views with HERE JavaScript API)

HERE地图材料附带不同的地图视图和可能的叠加层,如“交通状况”,“公共交通”和“突发事件”。 我根本不想提供这三种观点。 不幸的是,我只能通过以下代码停用它们:

//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显示它们?

在此先感谢DG7团队

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

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?

Thanks in advance, Team DG7

最满意答案

不漂亮,但它的工作原理。 按照相同的方法删除hr。

$(".H_btn:contains('Traffic conditions')").hide(); $(".H_btn:contains('Public transport')").hide(); $(".H_btn:contains('Show traffic incidents')").hide();

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

更多推荐

本文发布于:2023-08-04 05:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1409396.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   流量   API   JavaScript   views

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!