<tfoot id='0CCHH'></tfoot>
<legend id='0CCHH'><style id='0CCHH'><dir id='0CCHH'><q id='0CCHH'></q></dir></style></legend>

    1. <small id='0CCHH'></small><noframes id='0CCHH'>

        <bdo id='0CCHH'></bdo><ul id='0CCHH'></ul>

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

        我想从 MapKit for iPhone 中的坐标值中获取位置名称

        时间:2023-05-31
      1. <tfoot id='xuJ9D'></tfoot>
        <legend id='xuJ9D'><style id='xuJ9D'><dir id='xuJ9D'><q id='xuJ9D'></q></dir></style></legend>

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

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

              • <bdo id='xuJ9D'></bdo><ul id='xuJ9D'></ul>
                  本文介绍了我想从 MapKit for iPhone 中的坐标值中获取位置名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我想从坐标值中获取位置名称.这是代码,

                  I want to get the location name from the coordinate value. Here is code,

                  - (void)viewWillAppear:(BOOL)animated {  
                      CLLocationCoordinate2D zoomLocation;
                      zoomLocation.latitude = 39.281516;
                      zoomLocation.longitude= -76.580806;
                      MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE);
                      MKCoordinateRegion adjustedRegion = [_mapView regionThatFits:viewRegion];                
                      [_mapView setRegion:adjustedRegion animated:YES];      
                  }
                  

                  所以,从那个纬度和经度,我想知道那个位置名称.

                  So, From that Latitude and longitude , i want to know that location name.

                  推荐答案

                  以下代码适用于ios5及以上版本

                  The Below code shall work in ios5 and above

                   CLGeocoder *ceo = [[CLGeocoder alloc]init];
                   CLLocation *loc = [[CLLocation alloc]initWithLatitude:32.00 longitude:21.322]; //insert your coordinates
                  
                  [ceo reverseGeocodeLocation:loc
                            completionHandler:^(NSArray *placemarks, NSError *error) {
                                CLPlacemark *placemark = [placemarks objectAtIndex:0];
                                if (placemark) {
                  
                  
                                    NSLog(@"placemark %@",placemark);
                                    //String to hold address
                                    NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "];
                                    NSLog(@"addressDictionary %@", placemark.addressDictionary);
                  
                                    NSLog(@"placemark %@",placemark.region);
                                    NSLog(@"placemark %@",placemark.country);  // Give Country Name
                                    NSLog(@"placemark %@",placemark.locality); // Extract the city name
                                    NSLog(@"location %@",placemark.name);
                                    NSLog(@"location %@",placemark.ocean);
                                    NSLog(@"location %@",placemark.postalCode);
                                    NSLog(@"location %@",placemark.subLocality);
                  
                                    NSLog(@"location %@",placemark.location);
                                    //Print the location to console
                                    NSLog(@"I am currently at %@",locatedAt);
                                }
                                else {
                                    NSLog(@"Could not locate");
                                }
                            }
                   ];
                  

                  这篇关于我想从 MapKit for iPhone 中的坐标值中获取位置名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:UISegmentedControl 更改事件未在 iOS5 中触发 下一篇:Xcode 4.2 iOS 空应用程序和故事板

                  相关文章

                  最新文章

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

                    1. <tfoot id='OeYY3'></tfoot>
                    2. <legend id='OeYY3'><style id='OeYY3'><dir id='OeYY3'><q id='OeYY3'></q></dir></style></legend>

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

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