-
Hi, I'm rendering a location arrow on the map using a ❗ Problem 1: Flickering at Close ZoomWhen the user moves around the map and the zoom level is high, the location arrow starts to flicker — it randomly disappears and reappears during movement. Why is this happening, and how can I prevent it? ❗ Problem 2: Rotation CompensationBecause the Is there a way to disable automatic rotation of 🔍 Code SnippetHere is a simplified version of how I currently render the arrow: @Composable
private fun LocationOverlay(location: Location, cameraRotation: Double) {
val locationSource = rememberGeoJsonSource(
data = GeoJsonData.Features(Point(coordinates = location.toPosition()))
)
SymbolLayer(
id = MapConstant.Styling.ID_LOCATION_LAYER,
source = locationSource,
iconImage = image(value = painterResource(id = R.drawable.ic_location_blue)),
iconSize = const(0.75F),
iconRotate = const((location.azimuth?.degrees ?: 0f) - cameraRotation.toFloat()),
)
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
First, ensure you're on the latest version of the library, as there were some layer flickering issues in v0.10 that should be fixed in v0.10.4. Second, it's possible your symbol is overlapping other SymbolLayer content on the map. Check out the
Check out the In general, I'd recommend you familiarize yourself with the MapLibre Style Spec to understand the breadth of layer styling options available. |
Beta Was this translation helpful? Give feedback.
First, ensure you're on the latest version of the library, as there were some layer flickering issues in v0.10 that should be fixed in v0.10.4.
Second, it's possible your symbol is overlapping other SymbolLayer content on the map. Check out the
iconAllowOverlap
andiconAllowPlacement
fields on theSymbolLayer
to ignore overlap. I think for this icon, you'll want to seticonAllowOverlap
to true.Check out the
iconRotationAlignment
field. Setting this to "map" will align the icon to the map instead of the viewport.In general, I'd recommend you familiarize yourself with the MapLibre Style Spec to understand the breadth…