mapbox / mapbox-maps-flutter

Interactive, thoroughly customizable maps for Flutter powered by Mapbox Maps SDK
https://www.mapbox.com/mobile-maps-sdk
Other
245 stars 93 forks source link

Location puck is drawn below LineLayer #517

Open basvdijk opened 3 weeks ago

basvdijk commented 3 weeks ago

When I use:

    mapboxMap?.location.updateSettings(
      LocationComponentSettings(
        pulsingEnabled: true,
        showAccuracyRing: true,
        puckBearing: PuckBearing.COURSE,
        puckBearingEnabled: true,
      ),
    );

And add a LineLayer:

    await mapboxMap?.style.addLayer(
      LineLayer(
        id: 'line_layer',
        sourceId: 'line',
        lineColor: Colors.pinkAccent.value,
        lineTrimOffset: [0.0, 1.0],
        lineWidth: 5.0,
      ),
    );

The result is that the puck is drawn below the line. I think the default should be that the puck is always on top. Is this a bug or am I missing a setting? image

basvdijk commented 2 weeks ago

It turns out you first have to draw the line and then turn on the location puck. I leave this issue open since I am not sure if this is by design or a bug. I still think the puck should be on top by default.

evil159 commented 2 weeks ago

Hi @basvdijk, I'm able to reproduce this on Android, on iOS the location indicator is on top. Filed a bug in the internal issue tracker - https://mapbox.atlassian.net/browse/MAPSAND-1587

basvdijk commented 2 weeks ago

@evil159 The screenshot was taken from iOS. Changing the order of first drawing the line and then turning on the puck sovled it. layerAbove and layerBefore had no effect since this is Android only.

evil159 commented 2 weeks ago

Interesting, I can't seem to reproduce this on iOS, which version to you use?

basvdijk commented 2 weeks ago

@evil159 iOS 17.4.1 but it might also be related to a race condition with async operations.

evil159 commented 2 weeks ago

Ah, sorry, I mean what version of the Mapbox Maps Flutter Plugin do you use?

basvdijk commented 2 weeks ago

Commit https://github.com/mapbox/mapbox-maps-flutter/commit/1daef17c48fd927db442a5d19f7aca06a1ffdc63

basvdijk commented 1 week ago

@evil159 I have the same issue for point annotations. The yellow dot is below the line. image

I saw createPointAnnotationManager has a below constructor property but not an above. It looks like all with this issue had to do in the order of all the things are added to the map.