diff options
Diffstat (limited to 'android-app/app')
| -rw-r--r-- | android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt | 9 |
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) } /** |
