2017-09-27 3 views
0

다음 코드는 한 지점에서 다른 지점으로 이동하는 iPhone에서 Google지도 앱을 열지 않지만 같은 URL을 데스크톱 브라우저로 복사하면 구글지도.Objective-C를 사용하여 iOS에서 여러 목적지로 내비게이션 시작

Google지도 앱에서 탐색을 시작하는 방법은 무엇입니까?

STR = https://maps.google.com/maps/dir/?api=1&origin=18.606791,73.785611&destination=18.611997,73.971692&waypoints=18.606791,73.785611|18.611997,73.971692|18.465518,74.012204

if([[UIApplication sharedApplication] canOpenURL: 
    [NSURL URLWithString:@"comgooglemaps://"]]) 
{ 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; 
} 
+0

Yuvaraj 케일 당신은 당신의 코드를 표시 할 수 있습니다 당신이 어떻게 적용합니까? – user3182143

+0

Go through this - https://stackoverflow.com/questions/41392092/google-maps-directions-url-error-when-adding-multiple-waypoints/41449231#41449231 – user3182143

답변

0

사용 가능한 URL 체계에 구글 문서로 시작할 수 있습니다. 특히 앱에 add navigation하는 방법에 대한 섹션이 있습니다.

+0

문서를 이미 보았습니다. 아무 것도 얻지 못했습니다. 해결책. –

0

이 시도 ..

NSString *escapedString = [strUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; 
    strUrl=[escapedString stringByReplacingOccurrencesOfString:@"%20" withString:@"+"]; 

if ([[UIApplication sharedApplication] canOpenURL: 
     [NSURL URLWithString:@"comgooglemaps://"]]) 
    { 
     [[UIApplication sharedApplication] openURL: 
     [NSURL URLWithString:[@"comgooglemaps://?" stringByAppendingString:strUrl]]]; 
    } 
+0

아니요, Google지도를 열었지만 입력 한 위치가 표시되지 않습니다. –

관련 문제