当前位置不适用于Apple Maps IOS 6 [英] Current Location doesn't work with Apple Maps IOS 6

查看:111
本文介绍了当前位置不适用于Apple Maps IOS 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IOS 6之前,我使用此URL方案打开本机地图应用程序,并找到从用户当前位置到我创建的地址的路线.

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= "+地址+& saddr =当前+位置

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

这很好用,但是现在他们使用IOS 6摆脱了谷歌地图,我们必须检查它们使用的是哪个IOS版本,如果使用的是iOS 6.0或更高版本,则必须将它们引用到新的Apple Maps URL方案中.我们正在使用的新的url方案是这个....

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= "+地址+& saddr =当前+位置

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?

请记住,我正在构建一个带有电话间隔的html应用程序,因此使用本机代码将起始地址设置为当前位置不会对我有帮助.

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.

推荐答案

我遇到了同样的问题.我还没有找到解决方案,但是如果您不使用saddr

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.

这篇关于当前位置不适用于Apple Maps IOS 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆