这里SDK-自定义栅格层无效
我在这里为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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里没有支持团队的答复,但是我确实挖掘了示例代码和它使用的场景JSON。我尚未收到访问此处样式编辑器的访问权限。看来,使用以下代码可以解决问题:
因此,这里的关键是知道 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:
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.