mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
462 stars 131 forks source link

Location puck bearing not showing with mapbox extension-compose #2194

Closed FraRo96 closed 5 months ago

FraRo96 commented 10 months ago

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.

yunikkk commented 10 months ago

Thanks for the report @FraRo96 , we will take a look.

jush commented 10 months ago

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

Blizard commented 9 months ago

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.

Mahkxai commented 9 months ago

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!

pengdev commented 6 months ago

Hey @FraRo96 @Blizard @Mahkxai thanks for reporting, we have made the fix and it should land in the upcoming v11.2.0 release.

arbonvata commented 1 week ago

@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

pengdev commented 1 week ago

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.

arbonvata commented 1 week ago

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