CLPlacemark 中屬性含義


- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
    CLLocation *location = [locations lastObject];
    [self.locationManager stopUpdatingLocation];
    CLGeocoder *geocoder = [[CLGeocoder alloc] init];
    [geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) {
        // 緯度
      CLLocationDegrees latitude = location.coordinate.latitude;
        // 經度
      CLLocationDegrees longitude = location.coordinate.longitude;
      CLPlacemark *place = [placemarks lastObject];
      // NSLog(@"City,%@",place.addressDictionary[@"City"]);
      // NSLog(@"Country,%@",place.addressDictionary[@"Country"]);                                 
     // NSLog(@"CountryCode,%@",place.addressDictionary[@"CountryCode"]);   // NSLog(@"FormattedAddressLines,%@",place.addressDictionary[@"FormattedAddressLines"]);   // NSLog(@"Name,%@",place.addressDictionary[@"Name"]);   // NSLog(@"State,%@",place.addressDictionary[@"State"]);   // NSLog(@"Street,%@",place.addressDictionary[@"Street"]);   // NSLog(@"SubLocality,%@",place.addressDictionary[@"SubLocality"]);   // NSLog(@"Thoroughfare,%@",place.addressDictionary[@"Thoroughfare"]);   // 位置名   NSLog(@"name,%@",place.name);   // 街道   NSLog(@"thoroughfare,%@",place.thoroughfare);   // 子街道   NSLog(@"subThoroughfare,%@",place.subThoroughfare);   //   NSLog(@"locality,%@",place.locality);   //   NSLog(@"subLocality,%@",place.subLocality);   // 國家   NSLog(@"country,%@",place.country); }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM