I am using UIMapView to display locations on the iPhone. I want to do a directions from current location to the location of interest, I don't think its possible using MapKit (but if it is please inform) So I will open either the Google Maps application or safari to display it.
Can i do this by specifying co-ordinates from (current location) to co-ordinates (the location of interest) I have these longitudes and latitudes. Or do i have to use street addresses?
If I do have to use street addresses, can i get them from the latitude and longitude.
A solid solution is to create a view controller with a NIB that includes a UIWebView, and then pass the URL that exercises Google's map / direction services. This way, you keep the user in the application. This approach is not sufficient when pulling up a web page, because the Apple kit doesn't support zooming. But with OS4, at least the user can double click the home button and switch back to the app.
Use bellow code for both google and apple maps in Swift 3 -
First check google map is installed in device or not
Add query schema in .plist
It is possible to show route in MapKit: Just use MKPolyline
I get polyline string from googleMapsApi. I parse it on server with php, and return final polilyne string to my app.
And showing:
Give it a try.
It is possible.Use MKMapView Get the location coordinate where you tapped on the phone and using the two coordinates request the KML file from the google web service ,parse the KML file (sample app KML viewer in developer site) and display the routes....
Thank you
You can email the dropped pin to yourself and when you open the link in email, it will show the coordinates.