I am developing an application to open an Apple Maps session and pass the latitude and longitude coordinates in order to get directions to this location from the current location of users.
I know that this can be done on google maps, which I already do, but when I try to open the URL on Apple Maps, it just opens a wrong place from the users' current location to the destination.
Here is the URL scheme I used:
http://maps.apple.com/?ll=(someLatitude),(someLongitute)
the code:
UIApplication.sharedApplication().openURL(NSURL(string:"http://maps.apple.com/?ll=\(locationLat),\(locationlong)")!)
Any help would be greatly appreciated. Thanks!
ios swift apple-maps
randomorb2110
source share