Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
811 views
in Technique[技术] by (71.8m points)

url scheme - Current Location doesn't work with Apple Maps IOS 6

Before IOS 6, I was using this URL scheme to open the native maps app and find directions from the users current location to an address that I created.

http://maps.google.com/maps?daddr=" + address + "&saddr=Current+Location

This was working great, but now that they got rid google maps with IOS 6, we had to check which IOS version they were on and then refer them to the new apple maps url scheme if they were using IOS 6.0 or greater. The new url scheme we are using is this....

http://maps.apple.com/maps?daddr=" + address + "&saddr=Current+Location

This is based on the new documentation for map url schemes, which can be found here..

Anyways, I've tested it a bunch and it boils down to the new apple maps does recognize Current Location, like google maps did.

Does anyone know how I fix this?

Keep in mind I am building a html app with phone gap, so using native code to set the starting address to current location won't help me.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I am having the same problem. I haven't found a solution yet but if you leave off the saddr

http://maps.apple.com/maps?daddr=" + address

it will just ask them where to start and the first option is "Current Location" so when they click "Current Location" it will show the map correctly.

If anyone finds a better solution please post it as I am still looking for a better solution.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...