-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Test Implementation * Add Basic NavigationPathBuilder Implementation * Add currentStepGeometryIndex to NavigationUIState * Update Doc Strings * Formatting * Rename Builder and add Docstring
- Loading branch information
1 parent
4397dee
commit 8825d2a
Showing
9 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ class DemoNavigationViewModel( | |
null, | ||
null, | ||
null, | ||
null, | ||
null)) | ||
|
||
override fun toggleMute() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../ferrostar/maplibreui/BorderedPolyline.kt → .../maplibreui/routeline/BorderedPolyline.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ibreui/src/main/java/com/stadiamaps/ferrostar/maplibreui/routeline/RouteOverlayBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.stadiamaps.ferrostar.maplibreui.routeline | ||
|
||
import androidx.compose.runtime.Composable | ||
import com.mapbox.mapboxsdk.geometry.LatLng | ||
import com.maplibre.compose.ramani.MapLibreComposable | ||
import com.stadiamaps.ferrostar.core.NavigationUiState | ||
|
||
/** | ||
* A Route Overlay (Polyline) Builder with sensible defaults - showing the full Navigation Route | ||
* Geometry. | ||
* | ||
* This banner view includes the default [BorderedPolyline] to display the full supplied Route | ||
* Geometry. Custom implementations to the appearance/functionality of the Route Overlay can be | ||
* achieved by passing a custom implementation of the [navigationPath] parameter, using the | ||
* [NavigationUiState] to access the Route Geometry. | ||
*/ | ||
data class RouteOverlayBuilder( | ||
internal val navigationPath: | ||
@Composable | ||
@MapLibreComposable | ||
(uiState: NavigationUiState) -> Unit | ||
) { | ||
companion object { | ||
fun Default() = | ||
RouteOverlayBuilder( | ||
navigationPath = { uiState -> | ||
uiState.routeGeometry?.let { geometry -> | ||
BorderedPolyline(points = geometry.map { LatLng(it.lat, it.lng) }, zIndex = 0) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters