MapKit rendering problem with SwiftUI contextMenu

I need to render a card with mapkit embedded, but every time I long press to execute the contextMenu action, the app crashes on the physical device, and in the simulator, the map goes full black.

Right down is my code, the screenshot, and the console output.

I appreciate any help, thanks.

Answered by DTS Engineer in 704891022

I need to render a card with mapkit embedded, but every time I long press to execute the contextMenu action, the app crashes on the physical device, and in the simulator, the map goes full black.

Can you open a bug report with the crash report and a small buildable project that creates the crash? File the report using Feedback Assistant and post the FB number here.

Does the map need to be interactive in this view? MKMapSnapshotter is a good choice when you have a map that's not interactive and supplemental content to a view like this.

Accepted Answer

I need to render a card with mapkit embedded, but every time I long press to execute the contextMenu action, the app crashes on the physical device, and in the simulator, the map goes full black.

Can you open a bug report with the crash report and a small buildable project that creates the crash? File the report using Feedback Assistant and post the FB number here.

Does the map need to be interactive in this view? MKMapSnapshotter is a good choice when you have a map that's not interactive and supplemental content to a view like this.

Thanks for your answer, now I'm using the MKMapSnapShotter, and works just like I wanted.

MapKit rendering problem with SwiftUI contextMenu
 
 
Q