mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

How to show line layer behind terrain

Open SigmaAppdevelopment opened this issue 9 months ago • 4 comments

Mapbox SDK 11.8.1

Hi i want to achieve this with style-> terrain "mapbox://mapbox.mapbox-terrain-dem-v1"

Image

Tried with lineOcclusionOpacity. Lines are visible behind 3d buildings, but not when using terrain. Next I tried lineZOffset, I set it to 500 meters for example. now the line hovers over the ground, but that's not what I expected.

What am I missing?

SigmaAppdevelopment avatar Mar 26 '25 09:03 SigmaAppdevelopment

@SigmaAppdevelopment how did you manage with the buidlings, I created LineLayer and using lineOcclusionOpacity, but it does not work (mapbox standard)

zenyagami avatar Apr 29 '25 19:04 zenyagami

@zenyagami

I did this. I think, maybe you need to set slot.

val layer = lineLayer(mapPath.layerId, mapPath.sourceId) { lineCap(LineCap.ROUND) lineJoin(LineJoin.ROUND) lineWidth(pathWidth) lineColor(ContextCompat.getColor(context, colorId)) lineEmissiveStrength(1.0) lineOcclusionOpacity(0.3) slot("middle") }

SigmaAppdevelopment avatar May 06 '25 07:05 SigmaAppdevelopment

thank you @SigmaAppdevelopment , I was missing the slot, I tried to do it directly on the map with slots, but it did not work, with the `slot("middle") works great!! thanks

zenyagami avatar May 06 '25 13:05 zenyagami

we still have no solution. can you help?

SigmaAppdevelopment avatar Jun 06 '25 12:06 SigmaAppdevelopment