I want to open apple map for specific location/venue and to do so I'm doing
if let url = URL(string: "maps://?address=Railway%20Station%20Area,%20Surat,%20395003,%20Gujarat,%20India&auid=4338464186124767060&ll=21.205538,72.840954&lsp=9902&q=Surat%20Railway%20Station&t=m") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
I can open map using same latitude longitude, but it will only appear as simple annotation without any detail in location card of apple map
if let url = URL(string: "maps://?ll=21.205538,72.840954&lsp=9902&q=Surat%20Railway%20Station&t=m") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
it turn out that only thing required for mapItem to appear as apple map defined item/venue is auid in URL
so if I use only this (ie. url only with auid), it will still open venue perfectly with all apple map associated details.
if let url = URL(string: "maps://?auid=4338464186124767060") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
so is there any way to fetch auid of venues for apple map? can we get it using latitude & longitude? Is there any other way to redirect venue to apple map with all the related info, not just simple annotation?


Try the below code