iOS : 如何在 Google 地图上启用音频路线
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14789580/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS : How to enable Audio directions on Google Maps
提问by Azhar
I am using the below code to open Google Maps from my iOS application where I am passing starting and End point of places.
我正在使用下面的代码从我的 iOS 应用程序打开 Google 地图,我正在传递地点的起点和终点。
It navigates correctly from start point to end point but does not guide through Audio (voice).
它从起点到终点正确导航,但不引导音频(语音)。
I want to enable voice guidance facility.
我想启用语音指导功能。
please help
请帮忙
ClientState *clientState = [ClientState sharedInstance];
CLLocation *currentLocation = clientState.currentLocation;
NSString *googleMapsURLString = [NSString stringWithFormat:@"maps://maps.google.com/?xyz=xyz&saddr=%1.8f,%1.8f&daddr=%@,%@",
currentLocation.coordinate.latitude, currentLocation.coordinate.longitude, trip.pickupLatitude, trip.pickupLongitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapsURLString]];
采纳答案by Chris Truman
The Maps app will handle audio guidance for you. You do not need to enable it. If you open the Apple Maps URL scheme or Google Maps app, it will guide the user via audio if they have their audio turned on. Voice directions only work on certain phones for the Apple Maps App. The iPhone 5 and 4S have voice direction, while the iPhone 4 and 3GS do not. Just like there is no Siri on iPhone 4, there is no Siri Voice Navigation.
地图应用程序将为您处理音频指南。您不需要启用它。如果您打开 Apple Maps URL scheme 或 Google Maps 应用程序,如果用户打开了音频,它将通过音频引导用户。语音导航仅适用于 Apple Maps App 的某些手机。iPhone 5 和 4S 有语音指示,而 iPhone 4 和 3GS 没有。就像 iPhone 4 上没有 Siri 一样,也没有 Siri 语音导航。
See this threadon Apple for extra discussion.
有关更多讨论,请参阅Apple 上的此线程。