How to get Apple Maps App (not MapKit) to add an annotation?

后端 未结 1 1913
無奈伤痛
無奈伤痛 2021-01-23 15:35

It\'s quite easy to add an annotation to a MapKit view which is inside your app.

theMap: MKMapView!

let pa = MKPointAnnotation()
pa.title = \"         


        
相关标签:
1条回答
  • 2021-01-23 16:35

    I think openInMaps limits you only to the five possible launch options. But I wonder if you could get Apple Maps to open in the original way, openURL and maps.apple.com/maps, as shown in this SO question. With the newest iOS versions, though, it seems you also need to register the URL you're using in your info.plist under "URL Types ... URL Schemes" or "LSApplicationQueriesSchemes". You might be able to pass an annotation as a parameter with the URL.

    0 讨论(0)
提交回复
热议问题