From a45ca70410c3a6b15051f26ef4325be3de8d6c37 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 16:12:41 +0000 Subject: Fix setGeoJson overload ambiguity in setFocusedTrackPoints Kotlin inferred Feature|FeatureCollection as their common supertype, which didn't match any single setGeoJson overload. Split into two explicit branches so each call site has an unambiguous type. https://claude.ai/code/session_01YUbuZNDAoLea4cf9UGQ9qn --- android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'android-app') diff --git a/android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt b/android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt index b8ce460..5449db2 100644 --- a/android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt +++ b/android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt @@ -365,12 +365,13 @@ class MapHandler(private val maplibreMap: MapLibreMap) { /** Highlights [points] in the focus layer (full-opacity bright blue over the dim layer). */ fun setFocusedTrackPoints(points: List?) { - val geojson = if (points != null && points.size >= 2) { - Feature.fromGeometry(LineString.fromLngLats(points.map { Point.fromLngLat(it.lon, it.lat) })) + if (points != null && points.size >= 2) { + trackPastFocusSource?.setGeoJson( + Feature.fromGeometry(LineString.fromLngLats(points.map { Point.fromLngLat(it.lon, it.lat) })) + ) } else { - FeatureCollection.fromFeatures(emptyList()) + trackPastFocusSource?.setGeoJson(FeatureCollection.fromFeatures(emptyList())) } - trackPastFocusSource?.setGeoJson(geojson) } /** -- cgit v1.2.3