【发布时间】:2014-05-03 12:05:08
【问题描述】:
我正在尝试使用类似于 Instagram 的照片地图的照片创建地图。
照片地图:http://i.stack.imgur.com/B0wDa.jpg
如何将图像(从 Parse 加载)添加到注释中,如上面的屏幕截图所示?
这就是我目前得到的: MapViewController.m
[PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *geoPoint, NSError *error) {
PFQuery *query = [PFQuery queryWithClassName: @"HomePopulation"];
[query whereKey:@"geopoint" nearGeoPoint:geoPoint withinKilometers:3000];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
for (PFObject *object in objects) {
PFGeoPoint *thePoint = [object objectForKey:@"geopoint"];
latitude = thePoint.latitude;
longitude = thePoint.longitude;
NSLog(@" Hej %f, %f", latitude, longitude);
CLLocationCoordinate2D annotationCoordinate = CLLocationCoordinate2DMake(latitude, longitude);
Annotation *annotation = [[Annotation alloc] init];
annotation.coordinate = annotationCoordinate;
annotation.title = [object objectForKey:@"discovery"];
annotation.subtitle = [object objectForKey:@"location"];
PFFile *image = [object objectForKey:@"imageFile"];
annotation.imageView.file = image;
[annotation.imageView loadInBackground];
[self.theMap addAnnotation:annotation];
[self.theMap setCenterCoordinate:annotation.coordinate animated:YES];
[self setNeedsStatusBarAppearanceUpdate];
}
}
}];
}];
任何帮助表示赞赏。 马尔科
【问题讨论】:
-
具体的问题或疑问是什么?
-
如何将图像(从 Parse 加载)添加到注释中,如上面的屏幕截图所示?