通过 URL 方案访问 TomTom 导航解决方案
我目前正在开发一个 iPhone 应用程序,它允许用户导航到 POI。这些 POI 是通过纬度/经度定义的,用户应该能够一键启动导航解决方案以导航到该 POI。
这与 Navigon 配合使用 URL 方案 navigon://myapp|name||||||lat|lon
现在我知道有一个名为 tomtomplus://< 的 URL 方案/code> 对于 TomTom iPhone 应用程序,我只能启动 Tomtom,无法执行其他操作。
我尝试了 tomtomhome://geo:action=navigateto&lat=mylat&long=mylon&name=myname
- 但没有成功。仅 Tomtom 应用程序正在启动。
即使当我尝试访问 http://addto.tomtom.com API 时,tomtom 也只会启动,不会添加 POI 或导航到的机会的操作。
Codesniplet:
NSString* launchurl = [NSString stringWithFormat:@"tomtomhome://geo:action=navigateto&lat=%.8f&long=%.8f&name=%@", myEntry.getLon, myEntry.getLat, myEntry.name];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[launchurl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
有什么建议吗?
I'm currently working on an iPhone Application which allows the user to navigate to POIs. Those POIs are defined via lat/lon, and the user should have the possibility to start his navigation solution with one click to navigate to this POI.
This works fine with Navigon, using URL scheme navigon://myapp|name||||||lat|lon
Now I know that there is an URL scheme named tomtomplus://
for the TomTom iPhone app, I'm only able to start tomtom, no other action is possile.
I tried tomtomhome://geo:action=navigateto&lat=mylat&long=mylon&name=myname
- but did not work. Only tomtom app is starting.
Even when I try to go over the http://addto.tomtom.com API, tomtom does only start, no action in adding and POI or chance to navigate to.
Codesniplet:
NSString* launchurl = [NSString stringWithFormat:@"tomtomhome://geo:action=navigateto&lat=%.8f&long=%.8f&name=%@", myEntry.getLon, myEntry.getLat, myEntry.name];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[launchurl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 Tomtom 从 iPhone 上的路线规划选项向我发送了一封电子邮件。该电子邮件中有一个我使用的 tomtomhome:geo 链接。
为了进行测试,我在 Mac 上的 Safari 中单击了该链接,显然没有任何反应。然后我将该链接保存为书签,该书签立即使用 MobileMe 同步到我的 iPhone。我单击 iPhone Safari 浏览器上的书签,viola Tomtom 打开,并显示以链接中的位置为中心的地图。它会弹出一个带有链接名称的气球,右箭头允许我选择第一个选项“导航到那里”
生成的链接是:
tomtomhome:geo:action=show&lat=26.123456&long =28.123456&name=linkname
I used Tomtom to send me an email from the route planning option on my iPhone. In that email is a tomtomhome:geo link which I used.
To test I clicked on the link on my Mac in Safari, and obviously nothing happened. Then I saved the link as a bookmark, which immediately is synced to my iPhone using MobileMe. I clicked on the bookmark on my iPhone Safari browser and viola Tomtom opens with a map centred to the location in the link. It pops up with a balloon with the links name, and an right arrow allows me to choose first option "Navigate there"
The link generated is:
tomtomhome:geo:action=show&lat=26.123456&long=28.123456&name=linkname