Open krunal-sisnolabs opened 2 years ago
Hi, I solved it myself. replace "this" with "context"
Code : // Define speed limit formatter options private val speedLimitFormatter: SpeedLimitFormatter by lazy { SpeedLimitFormatter(context) }
Now speed limit is worked on my navigation map.
I want to add speed limit in my app. I refer these https://docs.mapbox.com/android/navigation/guides/ui-components/speed-limit/ https://docs.mapbox.com/android/navigation/examples/show-speed-limit/
but it give me error this error "Type mismatch: inferred type is MapboxNavigationView but Context was expected" for below code.
// Define speed limit formatter options private val speedLimitFormatter: SpeedLimitFormatter by lazy { SpeedLimitFormatter(this) }
for SpeedLimitFormatter variable
Can you please help me how to add speed limit code in MapboxNavigationView.kt file.