在这里将“选择视图"地图-我们可以删除选项吗? [英] HERE Maps "Choose View" - Can we remove options?

查看:65
本文介绍了在这里将“选择视图"地图-我们可以删除选项吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是否可以从选择视图"菜单中删除选项?

Is there a way for us to remove options from the "Choose View" menu?

根据我在网上看到的内容,它可能与图层有关,但是我很难找到一个简单的示例并使它正确地填充选项菜单.

Based on what I see online, it might have something to do with the layers, but I'm having trouble finding a simple example and getting it to properly populate the options menu.

例如,如果我们从不想在底部显示3个选项并且不需要地形"图?

For example, if we never want to show the 3 options at the bottom and don't need the "terrain" map?

更新:我尝试了以下由HERE开发人员支持提供的解决方案(手动删除了一些选项),但最终在其下有一行(并且它没有描述如何删除地形地图,因此还有其他内容)帮助将不胜感激!

Update: I tried a solution below provided by HERE Developer support (manually removing some of the options), but I end up with a line underneath it (and also it doesn't describe how to remove Terrain map, so any additional help would be appreciated!

或者,如果有一种方法,不仅可以从UI菜单中删除选项,而且可以完全摆脱地图中的图层和地图类型,那就更好了.谢谢!

Alternatively, if there's a way to not just remove the options from the UI menu and just completely get rid of the layers and map types from the map altogether, that would be even better. Thanks!

推荐答案

我在这里找到了另一个解决方案,该解决方案也删除了行":
使用HERE JavaScript API禁用路况地图视图

I found another solution here, which also removes the "line":
Disable traffic map views with HERE JavaScript API

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

为了摆脱地图视图选项之一(例如地形或卫星),我做了:

And to get rid of one of the map view options (like terrain or satellite), I just did:

delete maptypes.terrain;

创建默认图层后的

.

after the creation of the default layers.

这不是我的理想选择的100%(因为我想完全阻止创建图层),但是从我所看到的情况来看,如果我们尝试创建,这可能会带来更多的麻烦,并且获得的收益不会更多从头开始的各层.

It's not 100% my ideal (since I wanted to prevent the layers from getting created at all), but from what I've seen, it may be a lot more trouble and for not much more gain if we tried to create the layers from scratch.

这篇关于在这里将“选择视图"地图-我们可以删除选项吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆