Closed FraRo96 closed 5 months ago
Thanks for the report @FraRo96 , we will take a look.
We seem to be missing updating some settings in https://github.com/mapbox/mapbox-maps-android/blob/main/extension-compose/src/main/java/com/mapbox/maps/extension/compose/internal/SettingsUtils.kt#L84-L91
Any updates on this? Same for us. We use mapbox as
AndroidView(modifier = Modifier, factory = { context ->
MapView(context).apply {
this.location2.updateSettings {
enabled = true
pulsingEnabled = true
}
this.location2.updateSettings2 {
puckBearingEnabled = true
puckBearingSource = PuckBearingSource.HEADING
}
}
...
in android jetpack compose and there is only blue pulsing puck but not locatin bearing. I tried also v 11 but a result was same.
Adding locationPuck = createDefault2DPuck(withBearing = true)
enabled the puck bearing arrow for me:
MapEffect(Unit) { mapView ->
mapView.location.apply {
enabled = true
locationPuck = createDefault2DPuck(withBearing = true)
puckBearingEnabled = true
puckBearing = PuckBearing.HEADING
}
}
However, the puck bearing stays fixed, oriented at North at all times even when the device is moved around.
Experiencing this issue since v11.0.0-rc.1, and even on the latest stable v11.0.0.
I've also tried using the default locationCompononentSettings
param as follows but got the same result:
MapboxMap(
locationComponentSettings = LocationComponentSettings
.Builder(
createDefault2DPuck(withBearing = true)
)
.setEnabled(true)
.setPuckBearingEnabled(true)
.setPuckBearing(PuckBearing.HEADING)
.build()
}
Would appreciate any help on this issue!
Hey @FraRo96 @Blizard @Mahkxai thanks for reporting, we have made the fix and it should land in the upcoming v11.2.0 release.
@pengdev What was the fix for? The location puck bearing not showing or at all or was it also for wrong orientation for the puck bearing? I am still experiencing wrong orientation for the puck bearing with version 11.6.0
Hi @arbonvata the fix was for compose extension:
* [compose] Fix losing some location component settings during wrapping.
But the fix isn't relevant any more, as we've removed locationComponentSettings in MapboxMap composable function.
Do you experience some other issue? Please file a separate ticket with detailed description.
Hi @pengdev I am experiencing the bug in xml code, not jetpack compose. I have created a separate issue for this. See https://github.com/mapbox/mapbox-maps-android/issues/2466
Environment
Observed behavior and steps to reproduce
Both tried
mapView.location.puckBearing = PuckBearing.HEADING mapView.location.puckBearingEnabled = true
and
mapView.location.updateSettings { puckBearingEnabled = true puckBearing = PuckBearing.HEADING }
Not showing anything.
Expected behavior
To show the puck bearing arrow.