summaryrefslogtreecommitdiff
path: root/android-app/app/src
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-05-20 16:12:41 +0000
committerClaude <noreply@anthropic.com>2026-05-20 16:12:41 +0000
commita45ca70410c3a6b15051f26ef4325be3de8d6c37 (patch)
treeb778fcdc7f0a43857b3f259a516dfebc0b985281 /android-app/app/src
parent3793c919f14d8ae8d8814fde37786418a3dfdae4 (diff)
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
Diffstat (limited to 'android-app/app/src')
-rw-r--r--android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt9
1 files changed, 5 insertions, 4 deletions
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<TrackPoint>?) {
- 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)
}
/**