总图是很好地提出信息。 但是没有应用过滤器中图片的gps信息。 有办法解决吗?
- (void)getGPSLocation : (ALAsset*)asset
{
NSMutableDictionary *imageMetadata = nil;
NSDictionary *metadata = asset.defaultRepresentation.metadata;
imageMetadata = [[NSMutableDictionary alloc] initWithDictionary:metadata];
latitude = [[[imageMetadata objectForKey:@"{GPS}"]objectForKey:@"Latitude"]doubleValue];
longitude = [[[imageMetadata objectForKey:@"{GPS}"]objectForKey:@"Longitude"]doubleValue];
CLGeocoder *ceo = [[CLGeocoder alloc]init];
CLLocation *loc = [[CLLocation alloc]initWithLatitude:latitude longitude:longitude]; //insert your coordinates
addr = [NSString alloc];
[ceo reverseGeocodeLocation: loc completionHandler:
^(NSArray *placemarks, NSError *error) {
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "];
NSLog(@"I am currently at %@",locatedAt);
addr = locatedAt;
// [_address setText:locatedAt];
// [self setPin:latitude longitude:longitude addr:addr];
}];
}
答案 0 :(得分:0)
CLLocation *location = [asset valueForProperty:ALAssetPropertyLocation];
latitude = (double)location.coordinate.latitude;
longitude = (double)location.coordinate.longitude;
解决。