SwiftUI MapKit Marker ignores tint gradient for some colors

Hi, has anyone noticed that when using SwiftUI the MapKit Marker created with

Marker(item: MKMapItem)
    .tint(.red) //solid flat color

ignores the default marker styling (the nice gradient and shadow) and shows only a flat solid fill? The shadow/gradient appears correctly with some colors like .blue or .orange, but disappears with others such as .red, .purple, etc.

What’s odd is that this happens only with the init(item: MKMapItem) initializer. A marker created with, for example, following init works just fine.

Marker("hello", coordinate: CLLocationCoordinate2D)
    .tint(.red) //nice shadow/gradient

Is this a bug, or does a marker backed by an MKMapItem support only a limited color range? (If so, exposing .tint there seems inconsistent—either all colors should work or none.) Has anyone else run into this problem?

.orange with shadow/gradient:

.red solid without shadow/gradient:

@elukasino I've not be able to reproduce this on the latest beta build, but it's an odd behavior.

  • Could you file a feedback report, include your build environment and a sample project that reproduces the issue. Please post the Feedback ID here.
  • Can you also verify if you're able to reproduce this on the latest beta build.
SwiftUI MapKit Marker ignores tint gradient for some colors
 
 
Q