这里SDK-自定义栅格层无效

发布于 2025-01-28 06:58:22 字数 1182 浏览 3 评论 0原文

我在这里为Android使用SDK导航版。使用Lite Edition,我能够在地图上使用几个自定义的栅格层,但是在迁移到导航版之后,这无效。

看到一层的唯一方法是使用 maplayerprioritybuilder 。但是,这样做确实隐藏了所有地图标记!任何其他方式都显示了此处的地图方案。没有自定义层。

我要实现的是从自定义不透明层中获得背景图,并在其上显示进一步的透明层。自然,所有地图标记也应该可以看到。我该怎么做?

编辑:

此代码使图层可见并隐藏所有标记:

 MapLayerPriority priority = new MapLayerPriorityBuilder()
        .renderedLast()
        .build();

虽然将图层保留在隐藏的层时,如

 MapLayerPriority priority = new MapLayerPriorityBuilder()
        .renderedFirst()
        .build();

示例中的构建一样:

MapLayer mapLayer = new MapLayerBuilder()
                 .forMap(mapView.getHereMap()) // mandatory parameter
                 .withName(dataSourceName + "Layer") // mandatory parameter
                 .withDataSource(dataSourceName, MapContentType.RASTER_IMAGE)
                 .withPriority(priority)
                 .withVisibilityRange(range)
                 .build();

I am using Here SDK Navigation Edition for Android. With Lite Edition I was able to use several custom raster layers on the map, but after migrating to Navigation Edition this does not work.

The only way to see a layer is to use renderedLast() of the MapLayerPriorityBuilder. However, doing this did hide also all map markers! Any other way just showed the Here's map scheme. No custom layers.

What I want to achieve is to have the background map from custom opaque layer as well as show further transparent layers on top of that. Naturally all the map markers should be visible too. How can I do this?

Edit:

This code brings the layer visible and hides all markers:

 MapLayerPriority priority = new MapLayerPriorityBuilder()
        .renderedLast()
        .build();

While this keeps the layer hidden

 MapLayerPriority priority = new MapLayerPriorityBuilder()
        .renderedFirst()
        .build();

The actual layer is built like in the example:

MapLayer mapLayer = new MapLayerBuilder()
                 .forMap(mapView.getHereMap()) // mandatory parameter
                 .withName(dataSourceName + "Layer") // mandatory parameter
                 .withDataSource(dataSourceName, MapContentType.RASTER_IMAGE)
                 .withPriority(priority)
                 .withVisibilityRange(range)
                 .build();

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

歌枕肩 2025-02-04 06:58:22

这里没有支持团队的答复,但是我确实挖掘了示例代码和它使用的场景JSON。我尚未收到访问此处样式编辑器的访问权限。看来,使用以下代码可以解决问题:

        MapLayerPriority priority = new MapLayerPriorityBuilder()
            .renderedAfterLayer("ocm_cartography")
            .build();

因此,这里的关键是知道 normal_day方案的层名。我现在正在挣扎着透明的层,但这是另一个问题。

No replies from HERE support team, but I did some digging into the example code and the scene json it uses. I have not received access to HERE Style Editor. It appears that using the following code does the trick:

        MapLayerPriority priority = new MapLayerPriorityBuilder()
            .renderedAfterLayer("ocm_cartography")
            .build();

So the key here is to know the layer names of the NORMAL_DAY scheme. I'm now struggling with transparent layers, but that is another question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文