mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
463 stars 131 forks source link

LineLayer looks broken when zoom-in and out (specific zoom levels) #1924

Open vem-popprika opened 1 year ago

vem-popprika commented 1 year ago

Environment

Observed behavior and steps to reproduce

I set a LineLayer on MapView with hardcoded GeoJsonSource from sample code (which is fine). problem is when it comes to pinch-to-zoom(in and out) in specific zoom levels, the shape of line looks broken. and I reckon that pattern changing is irregular. is there any way to make the line be smooth? (that looks rough)

please check it out

https://user-images.githubusercontent.com/109714693/209517730-61e2818f-a487-4b46-8e57-e8ca74017e9a.mp4

Expected behavior

to make drawn line smooth when zoom in and out.

Notes / preliminary analysis

and my LineLayer configuration is here. +lineLayer(LINE_LAYER_ID, GEO_SOURCE_ID) { lineCap(LineCap.ROUND) lineJoin(LineJoin.ROUND) lineOpacity(0.5) lineWidth(60.0) lineColor("#FFFFFF") }

ank27 commented 1 year ago

hi @vem-popprika. Currently it's an expected behaviour, these artifacts comes from the line join and line cap configurations, and are prone to rendering errors especailly when the width is large. We have plans to improve them in future, but for now this seems correct behaviour.

Maybe you can try reducing the lineWidth. Let me know if you have more questions. :)