1. <small id='dYaDp'></small><noframes id='dYaDp'>

        <bdo id='dYaDp'></bdo><ul id='dYaDp'></ul>
      <legend id='dYaDp'><style id='dYaDp'><dir id='dYaDp'><q id='dYaDp'></q></dir></style></legend>
    1. <tfoot id='dYaDp'></tfoot>
    2. <i id='dYaDp'><tr id='dYaDp'><dt id='dYaDp'><q id='dYaDp'><span id='dYaDp'><b id='dYaDp'><form id='dYaDp'><ins id='dYaDp'></ins><ul id='dYaDp'></ul><sub id='dYaDp'></sub></form><legend id='dYaDp'></legend><bdo id='dYaDp'><pre id='dYaDp'><center id='dYaDp'></center></pre></bdo></b><th id='dYaDp'></th></span></q></dt></tr></i><div id='dYaDp'><tfoot id='dYaDp'></tfoot><dl id='dYaDp'><fieldset id='dYaDp'></fieldset></dl></div>

      iPhone SDK 6 启动带有语音导航方向的地图

      时间:2023-05-31

            <tbody id='dybHo'></tbody>
        • <tfoot id='dybHo'></tfoot>

          1. <i id='dybHo'><tr id='dybHo'><dt id='dybHo'><q id='dybHo'><span id='dybHo'><b id='dybHo'><form id='dybHo'><ins id='dybHo'></ins><ul id='dybHo'></ul><sub id='dybHo'></sub></form><legend id='dybHo'></legend><bdo id='dybHo'><pre id='dybHo'><center id='dybHo'></center></pre></bdo></b><th id='dybHo'></th></span></q></dt></tr></i><div id='dybHo'><tfoot id='dybHo'></tfoot><dl id='dybHo'><fieldset id='dybHo'></fieldset></dl></div>
          2. <legend id='dybHo'><style id='dybHo'><dir id='dybHo'><q id='dybHo'></q></dir></style></legend>

            <small id='dybHo'></small><noframes id='dybHo'>

              <bdo id='dybHo'></bdo><ul id='dybHo'></ul>

              1. 本文介绍了iPhone SDK 6 启动带有语音导航方向的地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我正在尝试从我的 iPhone SDK 应用程序启动地图应用程序.现在我可以启动带有路线的地图应用程序,但它会转到路线概览,并且不使用 Siri 和语音导航来提供转弯路线.

                I am trying to launch the maps app from my iPhone SDK app. Right now I can launch the maps app with directions but it goes to an overview of the directions and doesn't use Siri and the voice navigation to give turn by turn directions.

                目前我有一个启动此代码的按钮...

                currently I have a button that launches this code...

                NSString *address = viewedObject.addressFull;
                NSString *url = [NSString stringWithFormat: @"http://maps.apple.com/maps?saddr=%f,%f&daddr=%@", here.latitude, here.longitude, [address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
                

                推荐答案

                iOS 6 提供了一种启动地图的新方法,使用 MKMapItem 中的 openMapsWithItems:.这是我使用的一个片段,它提供从当前位置到所提供坐标的步行或驾车路线:

                With iOS 6 there's a new way to launch maps, using openMapsWithItems: in MKMapItem. Here's a snippet that I use that provides walking or driving directions from current location to the provided coordinates:

                // iOS 6.0+ only
                MKPlacemark* destPlace = [[[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:nil] autorelease];
                MKMapItem* destMapItem = [[[MKMapItem alloc] initWithPlacemark:destPlace] autorelease]; destMapItem.name = stationItem.title;
                
                NSArray* mapItems = [[[NSArray alloc] initWithObjects: destMapItem, nil] autorelease];
                NSDictionary* options = [NSDictionary dictionaryWithObjectsAndKeys:
                                                 walking ? MKLaunchOptionsDirectionsModeWalking : MKLaunchOptionsDirectionsModeDriving,
                                                 MKLaunchOptionsDirectionsModeKey, nil];
                [MKMapItem openMapsWithItems:mapItems launchOptions:options];
                

                按照您的方式,如果在 iOS 6 之前的设备上运行,您仍然需要这样做,您需要在 URL 中包含 dirflg 以请求步行或驾车路线:

                The way you are doing it, which you still have to do if running on pre-iOS 6 devices, you need to include the dirflg in the URL to request walking or driving directions:

                // pre iOS 6 code
                NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f&dirflg=%c",
                    currentLocation.coordinate.latitude,
                    currentLocation.coordinate.longitude,
                    destination.coordinate.latitude,
                    destination.coordinate.longitude,
                    walking ? 'w' : 'd'];
                

                这篇关于iPhone SDK 6 启动带有语音导航方向的地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:在 iOS 5 中下拉 UIView 下一篇:Bonjour 不在 BT 上做广告

                相关文章

                最新文章

                <i id='3JJHC'><tr id='3JJHC'><dt id='3JJHC'><q id='3JJHC'><span id='3JJHC'><b id='3JJHC'><form id='3JJHC'><ins id='3JJHC'></ins><ul id='3JJHC'></ul><sub id='3JJHC'></sub></form><legend id='3JJHC'></legend><bdo id='3JJHC'><pre id='3JJHC'><center id='3JJHC'></center></pre></bdo></b><th id='3JJHC'></th></span></q></dt></tr></i><div id='3JJHC'><tfoot id='3JJHC'></tfoot><dl id='3JJHC'><fieldset id='3JJHC'></fieldset></dl></div>

                    <bdo id='3JJHC'></bdo><ul id='3JJHC'></ul>

                  <legend id='3JJHC'><style id='3JJHC'><dir id='3JJHC'><q id='3JJHC'></q></dir></style></legend>
                  1. <small id='3JJHC'></small><noframes id='3JJHC'>

                    <tfoot id='3JJHC'></tfoot>