SwiftUI and mapkit

Hi all....


i am moving a current app to SwiftUI. The app has mapkit map object view with a an annotation in. It is just a standard annotation nothing fancy, but with custom name. Example...pin on my house...name Mike's house


Moving to SwiftUI; if I include mapkit in its own Some view it's fine the pin works perfectly. Now if I have a summary view that uses a Navbar to move to a detail view and on that detail view is this new map view the name of the pin is shown but not the pin itself.



Example list view

-Mike's House -> via navbar to detail view

-Phil's House

-Craig's House


Mikes House

Age 1952

2 floors

Map ( with pin annotation)


the code should work, but I am going insane trying to work out why as soon as it is in a sub view the pin is not being shown. The map is correctly at the correct location, and the annotation is being shown....it's just the graphic for the pin.


setup is Catilina beta 1, Xcode beta 2.


code is very similar to apple tutorial except it adds annotations- going nuts

What makes this strange if the map is its own view the pin is correctly shown. As soon as it comes from a navigation view then the pin is not shown...wondering if it is a bug or a 'feature'


what would help would be a proper swiftui implementation of mapkit lol, but can someone help in the meantime

OkI a few more tests today clearly an issue with navigation controller. Include mapview in a vstack pin is shown, include in view pin is shown, included in navigation controller pin not shown. Off to submit a radar ( goes off to work out how to do this)

SwiftUI and mapkit
 
 
Q