1

Apple Map アプリを使用して徒歩ルートを取得できませんが、MKLaunchOptionsDirectionsModeWalkingではなくMKLaunchOptionsDirectionsModeDrivingを使用すると、コードが機能します。

運転ケースで機能する道順を取得するための次のコードがあります...

MKPlacemark* place = [[MKPlacemark alloc] initWithCoordinate:_targetLocation addressDictionary:nil];
MKMapItem* destination = [[MKMapItem alloc] initWithPlacemark:place];
destination.name = [lastParkingInfo streetAddress];
NSArray* items = [[NSArray alloc] initWithObjects: destination, nil];
NSDictionary* options = [[NSDictionary alloc] initWithObjectsAndKeys:MKLaunchOptionsDirectionsModeDriving,MKLaunchOptionsDirectionsModeKey, nil];
[MKMapItem openMapsWithItems:items launchOptions:options];
4

0 に答える 0