아이폰 매핑하므로 현재의 위치로 시작 주소를 지침은 호출하십시오 방법

39 의 그러니까말이야 it& 시작합니다. 아이폰 애플리케이션 '구글' 를 호출하여 오픈우를 매핑하므로 수 있는 '위치' 또는 '와' 다드르 매핑하므로 uirl 매개변수입니다 사데르 문장열 latitudetm / 긴 (아래 예 참조).

하지만, 혹시 # 39 m, s # 39 I& it& 경우 시작 주소를 만들 수 있으며, 현재의 Location&quot &quot 매핑하므로 , , 그렇게 책갈피 매핑하므로 app& # 39 의 위치 처리 코드를 사용할 수 있습니다. 내 구글 검색 결과가 격려했다고 번번이 놓쳤다.

예를 들면 다음과 같습니다.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%@&daddr=%@", myLatLong, latlong]]];

현재 위치를 호출하십시오 미라트롱 '대신' 북마크 제외하고는 되는 게 아니다.

질문에 대한 의견 (1)

IOS 6 사전

현재 위치를 사용해야 할 수 있는 핵심 위치에 있지만, 여기에서 latitudetm / 긴 페어당 매핑됨 너회가 라우트를 맞추기바인딩 주소 또는 위치를 확인할 수 있습니다. 같은 있습니다.

<! - 모든 언어: &gt 로비치 랭 -;

CLLocationCoordinate2D currentLocation = [self getCurrentLocation];
// this uses an address for the destination.  can use lat/long, too with %f,%f format
NSString* address = @"123 Main St., New York, NY, 10001";
NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%@",
                    currentLocation.latitude, currentLocation.longitude,
                    [address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];

마지막으로 현재 위치를 찾을 수 없는 경우, 명시적으로 사용하지 않는 것이 스맥랜드의 코레로카션 사용하려면 ' (http://maps.google.com/maps) =, = %@&quot url 대신,' 다드르 Current+Location&amp @&quot? 사데르, 다음 [이 링크를 참조) 에서 제공하는 것을 내가 아래에 의견을] (http://www.martip.net/blog/localized-current-location-string-for-iphone-apps) 방법은 Current+Location 지역화합니다 구체화하십시오. 그러나 당신은 다른 문서화되지 않은 기능, 그리고 제이슨 매크리리 점을 악용해 이 향후 릴리스에서는 아래 안정적으로 작동하지 않을 수 있습니다.

업데이트가 iOS 6

, 매핑하므로 당초 구글 · 애플 · 구글 앱스를 사용하는 매핑하며 지금은 각기 다른 매핑하므로.

1) 구글 지도 애플리케이션 (앱) 을 사용하여 프로파일링하려는 라우트를 사용할 경우 (해당 콩구그레마프스 uirl 구성표가] (https://developers.google.com/maps/documentation/ios/urlscheme # 방향):

NSString* url = [NSString stringWithFormat: @"comgooglemaps://?daddr=%@&directionsmode=driving",
                    [address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
BOOL opened = [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];

2) 매핑하며 '새' 마크마피템 클래스를 사용하여 애플 iOS 6 사용할 수 있습니다. [지켜보리니 애플 API 문서 여기서요] (https://developer.apple.com/documentation/mapkit/mkmapitem)

기본적으로 이 같은 일이 사용할 경우 경로설정하기 위치좌표 ('라트롱') 대상:

    MKPlacemark* place = [[MKPlacemark alloc] initWithCoordinate: latlong addressDictionary: nil];
    MKMapItem* destination = [[MKMapItem alloc] initWithPlacemark: place];
    destination.name = @"Name Here!";
    NSArray* items = [[NSArray alloc] initWithObjects: destination, nil];
    NSDictionary* options = [[NSDictionary alloc] initWithObjectsAndKeys:
                                 MKLaunchOptionsDirectionsModeDriving, 
                                 MKLaunchOptionsDirectionsModeKey, nil];
    [MKMapItem openMapsWithItems: items launchOptions: options];

Ios, iOS 6 의 동일한 코드를 모두 지원하기 위해 6+ 및 사전 I& # 39 에서 애플은 이 같은 일이 있는 코드를 사용하는 것이 좋습니다; d '' apiu 마크마피템 doc 페이지:

Class itemClass = [MKMapItem class];
if (itemClass && [itemClass respondsToSelector:@selector(openMapsWithItems:launchOptions:)]) {
   // iOS 6 MKMapItem available
} else {
   // use pre iOS 6 technique
}

이는 solaris. 해당 Xcode 기본 SDK 는 iOS 6 (또는 최신값 iOS ).

해설 (12)
NSString* addr = [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=Current Location&saddr=%@",startAddr];
NSURL* url = [[NSURL alloc] initWithString:[addr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:url];
[url release];

아이폰 / 아이팟 언어 설정되었습니다 입성하는 것은 이 작품을 영어로. 다른 언어를 사용할 수 있도록 지원하기 위해 스케쳐내 you& # 39, ll %s/dbase/ext_table. 관찰지역 문자열이어야 매핑하므로 일치시킵니다 책갈피 이름.

해설 (6)

이 기능은 아이폰.

&gt. [http://maps.google.com/maps? = 현재 Location&amp 사데르 다드르 = 123 주, St, 오타와, 켜짐이] [1]

[1]: http://maps.google.com/maps =, = 123%20main% 20st, 오타와, 켜짐이 다드르 20location&amp Current% 사데르?

해설 (6)

Define 그것을비유하사 전처리기 사용할 수 있습니다.

#define SYSTEM_VERSION_LESS_THAN(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)

ios 버전 파악할 수 있습니다. 그럼 내가 지원하기 위해, 고쳐주렴 iOS 6 이 코드를 사용할 수 있습니다.

NSString* addr = nil;
if (SYSTEM_VERSION_LESS_THAN(@"6.0")) {
   addr = [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=%1.6f,%1.6f&saddr=Posizione attuale", view.annotation.coordinate.latitude,view.annotation.coordinate.longitude];
} else {
   addr = [NSString stringWithFormat:@"http://maps.apple.com/maps?daddr=%1.6f,%1.6f&saddr=Posizione attuale", view.annotation.coordinate.latitude,view.annotation.coordinate.longitude];
}

NSURL* url = [[NSURL alloc] initWithString:[addr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:url];
해설 (0)

39, t 맵 application& 샌드박싱 때문에 전날에약혼자에게 don& 액세스하도록 # 39 의 책갈피.

대신 현재 위치를 결정하는 핵심 위치를 사용하여 구하겠죠 그러면 그 위치 (latitudetm, 긴) 에서 열린 매핑하므로 제작식 uirl 있습니다.

해설 (3)

내가 추천하는 체크아웃하기 사마플라운처 는 iOS 앱을 실행할 수 있는 애플, 구글 등 미니 도서관 내가 구축됨 매핑에서는 sys_memsize 특정 구성도를 요청. 이 코드는 사마플라운처 방향의 얻을 수 있는 질문을 다음과 같습니다.

[CMMapLauncher launchMapApp:CMMapAppAppleMaps
          forDirectionsFrom:[CMMapPoint mapPointWithName:@"Origin"
                                              coordinate:myLatLong]
                         to:[CMMapPoint mapPointWithName:@"Destination"
                                              coordinate:latlong]];

또한 알 수 있듯이, iOS 6 버전 확인 캡슐화합니다 사이에 필요한 &amp. 한다.

해설 (1)

이후 안녕하슈 iOS6 사용할 수 있다!

애플의 놀라운 일을 한 나쁘지 길 (from my point of view).

39 의 맵은 apple& 실행됨을 사용하면 안됩니다 ' (maps.google.com/) 및 실행하는 장치의 ios 6 의 이데비스 스케쳐내? q =' 앱 'maps.apple.com/? q = 넷윈을 열 계획, 현재 될 것이다'.

39, t 개발자 작업을 할 수 있도록 don& 많은 비 사과 (maps.apple.com) 이 변화는 모든 장치를 친화적임 maps.google.com 서버 리디렉션합니다 그러하매 투명해집니다.

이러한 방식으로 우리는 그냥 구글 애플은 모든 쿼리하지 문장열 전환하십시오 데브로퍼스 가지고 있는 것으로 나타났다. 이것이 내가 싫어하는 많이유.

그래서 난 오늘 구현하는 그것을했다 펑크티오나로티 했다. 하지만 내가 느꼈던 아니라 모든 모바일 웹 사이트 url # 39 의 매핑하므로 Apple& 재작성할 누워 타겟으로의 서버에 위치시키는 생각해봤죠 I& 서버측 url 및 경배하되 이데비크스 탐지합니다; d # 39 그냥 애플 딱 그. D # 39 생각해봤죠 I& 공유하지는.

39 m, PHP 를 사용하는 오픈 소스 모바일 탐지합니다 그래서 i& 사용하여 라이브러리: http://code.google.com/p/php-mobile-detect/

그냥 list. '시파드' dtep 방법으로 부울입니다 getter 및 구글, 애플, re 수행됨 you& # 39 에 변환하십시오 너회가 못함; -)

$server=$detect->isiPad()?"apple":"google";
$href="http://maps.{$server}.com/?q=..."

건배!

해설 (0)

39 don& 경우, t, t want 요청할 수 있는 권한 및 위치 및 lng latitudetm don& # 39, 아래.

NSString *destinationAddress = @"Amsterdam";

Class itemClass = [MKMapItem class];
if (itemClass && [itemClass respondsToSelector:@selector(openMapsWithItems:launchOptions:)]) {

    CLGeocoder *geocoder = [[CLGeocoder alloc] init];
    [geocoder geocodeAddressString:destinationAddress completionHandler:^(NSArray *placemarks, NSError *error) {
        if([placemarks count] > 0) {

            MKPlacemark *placeMark = [[MKPlacemark alloc] initWithPlacemark:[placemarks objectAtIndex:0]];

            MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:placeMark];

            MKMapItem *mapItem2 = [MKMapItem mapItemForCurrentLocation];

            NSArray *mapItems = @[mapItem, mapItem2];

            NSDictionary *options = @{
        MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving,
        MKLaunchOptionsMapTypeKey:
            [NSNumber numberWithInteger:MKMapTypeStandard],
        MKLaunchOptionsShowsTrafficKey:@YES
            };

            [MKMapItem openMapsWithItems:mapItems launchOptions:options];

        } else {
            //error nothing found
        }
    }];
    return;
} else {

    NSString *sourceAddress = [LocalizedCurrentLocation currentLocationStringForCurrentLanguage];

    NSString *urlToOpen = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%@&daddr=%@",
                 [sourceAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
                 [destinationAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlToOpen]];
}

Ios5 대한 올바른 욕금지, 현재 위치에 있어야 합니다. 내가 이 게시물을 (http://www.martip.net/blog/localized-current-location-string-for-iphone-apps) 에서 로카리스트커렌트로카션 사용합니다를

내가 클조코더 ios6 를 사용할 수 있는 장소, 그리고 현재 위치를 정보기술 (it) 과 함께 매핑해야 엽니다.

코레로카션.프라임보크 및 마프키t.프라임보크 추가해야 합니다

해설 (0)

애플 docs 추천합니까 iOS6 를 사용하여 구성표가 avamer URL maps.apple.com

그래서 사용

http://maps.apple.com/maps?saddr=%f,%f&daddr=%f,%f

대신

http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f

하위 호환 될 수 있는 코드

    NSString* versionNum = [[UIDevice currentDevice] systemVersion];
    NSString *nativeMapScheme = @"maps.apple.com";
    if ([versionNum compare:@"6.0" options:NSNumericSearch] == NSOrderedAscending)
        nativeMapScheme = @"maps.google.com";
    }
    NSString* url = [NSString stringWithFormat: @"http://%@/maps?saddr=%f,%f&daddr=%f,%f", nativeMapScheme
             startCoordinate.latitude, startCoordinate.longitude,
             endCoordinate.latitude, endCoordinate.longitude];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];

완전히 다른 로드하십시오 매개 변수를 사용할 수 있을 지도 uirl 구성표가: 애플 uirl 구성표가 참조

이러한 조건 코드 탐지 매크로 iOS 버전을 사용할 수 있는 경우 다른 지역에서도 코드에. iOS 버전 매크로

해설 (1)

진짜 솔루션이므로 여기에서 찾을 수 있습니다. Z5 개념 iOS 개발 코드 스니핏

그냥 조금 单捞磐啊 인코딩입니다.

- (IBAction)directions1_click:(id)sender
{
    NSString* address = @"118 Your Address., City, State, ZIPCODE";
    NSString* currentLocation = @"Current Location";
    NSString* url = [NSStringstringWithFormat: @"http://maps.google.com/maps?saddr=%@&daddr=%@",[currentLocation stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],[address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    UIApplication *app = [UIApplicationsharedApplication];
    [app openURL: [NSURL URLWithString: url]];
}
해설 (0)

그냥 지금 할 수 있는 html 의 url 에서 mobile device 에 그쳤다. # 39 에 있는 [예] [1] here&. 이 경우 qr 코드 붙여넣습니다 선반가공 것은 멋진 사람이 어디에 있든 그들은 방향을 가져오는 방법이 있습니다.) 에서 너회들 스캐만을 것만으로 it 관련 휴대전화요

[1]: http://maps.google.com/maps/m - z = 13&amp 116.198677&amp, ll, dc = mgc_maps # 43.600113? = = = =;;; 사데르 My% 20location&amp 다드르 1910%20university% 20dr% 20boise% 20id&amp 티퍼 dep&amp 디르플그 = = = =;;;; 보기 d&amp map&amp l 보기 map&amp l lci m, t, l, com.google.latitudepublicupdates&amp, ac =

해설 (0)

Ios6 위한 애플리케이션 (앱) 을 사용하여 동일한 url 위에 게시하기를 매핑하므로 됩니다 ',' (http://maps.google.com/maps) =, = %@ 다드르 %f&amp %f 사데르?

그러나 url 을 (를) '대신' 그 결과 다음, 구글 맵스 url 을 사용하면 maps:// url: ',' 다드르 %f&amp %f maps://saddr =, = %@.

39, & # 39 를 사용하여, 현재의 Location& # 39 는 doesn& 작동합니까 도왔으매 남아있었죠 좌표야 함께 것으로 보인다.

안토서 하느님. # 39 의 하위 호환 it&. Ios5 정보기술 (it) 에서 시작하여, 구글 지도 app.

해설 (0)

현재 버전의 구글 맵스, 단순히 '이' 사드르 생략하십시오 매개변수입니다:

&gt. '사데르': 사용자의 현재 위치를 경우 이 값은 공백으로 관심용 사용됩니다.

https://developers.google.com/maps/documentation/ios/urlscheme

해설 (0)

Ios 로페냉구그레마프스 을 사용하여 내 제안에 약간만이라도 ldmf 는 최신임 선택 (오는 11월 2015년) 를 지원하며, 코코아 포드 설치 및 단 몇 번의 클릭만으로 준비가 되어 있습니다.

설치 방법: ',' 포드 &quot OpenInGoogleMaps&quot.

에 필요한 헤더 파일 사용: ',' # 가져오기의 &quot OpenInGoogleMapsController.h&quot.

샘플 코드 (아래 참조).

/*In case the user does NOT have google maps, then apple maps shall open*/
[OpenInGoogleMapsController sharedInstance].fallbackStrategy = kGoogleMapsFallbackAppleMaps;    

/*Set the coordinates*/
GoogleMapDefinition *definition = [[GoogleMapDefinition alloc] init];   
CLLocationCoordinate2D metsovoMuseumCoords;     //coordinates struct
metsovoMuseumCoords.latitude = 39.770598;
metsovoMuseumCoords.longitude = 21.183215;
definition.zoomLevel = 20;
definition.center = metsovoMuseumCoords;        //this will be the center of the map

/*and here we open the map*/
[[OpenInGoogleMapsController sharedInstance] openMap:definition];       
해설 (0)

39 don& 걸릴 경우, 현재 위치로 소스 위치, t 는 소스. 아래 코드를 시도하시겠습니까 -

이제 다드르 =\ (데스티나션로카션드라티스우드), http://maps.apple.com/maps? = &quot 우얼스트링 (데스티나션로카션.롱기트우드) = d&quot 디르플그 &; }

이아프리카션.샤레트리오픈우를 (URL (문자열. 우얼스트링)!)

해설 (0)

내가 다른 스레드에 대해 이렇게 답했다. ([현재 위치, t # 39 작동합니까 매핑하므로 doesn& 애플 IOS 6] [1]). 현재 위치 좌표를 내려받습니다 합니다 먼저 uirl 매핑해야 만드는 데 사용한다.

[1]: # 14272263 https://stackoverflow.com/questions/12539009/current-location-doesnt-work-with-apple-maps-ios-6/14272263

해설 (0)