I am trying to create a URL that takes a user from where they are currently to any destination and provides directions. The URL below works fine in iOS on the iPhone, but does not on the iPad as it prompts be to clarify what Current Location is:
http://maps.google.com/maps?saddr=Current%20Location&daddr=350 Broadway,%20New%20York,%20New%20York
How can I make this work in both the iPhone and the iPad?
I’ve Research this but…
I have researched about this for a while, and I believe there is no way to specify
Current Location. I know passingCurrent Locationas a parameter on iPhone works, but it is recognized as string Current Location rather than what you are intended.Alternative Way
The alternative way is to get the coordinate of the user using
Core Location, and then pass this coordinate assaddrparameter.It may be a bit ugly on Maps app because there will be an annotation that indicates the user’s current location and another pin annotation that indicates the coordinate you passed.
How to Get the Current User Location
Here’s a post for getting the user location.
What's the easiest way to get the current location of an iPhone?