Az én iPhone alkalmazás, én vagyok a MapKit a MKMapView és egyedi MKAnnotationView.
A probléma az, amikor kommentárok átfedés a térképen (az én app, kommentárok fotók és azok a fotók átfedés), és amikor megérinti a jelölést, hogy megjelenik a front, ez egy másik magyarázat (a hátoldalon), amely fogadja az eseményt (úgy tűnik véletlen ).
Nem találtunk semmilyen módon küldeni az esemény az első kommentár. Nem tudom elhinni ezt a hibát / problémát nem rendelkezik megoldás!
Z rendelési és megrendelése átfedő kommentárok kérdésre StackOverflow nem segített sokat.
Kérjük, minden ötlet üdvözlendő (még piszkos megoldások)!
Itt van az én-kód (nem divatos, nagyon gyakori):
CustomAnnotation.h
@interface CustomAnnotation : NSObject <MKAnnotation> {
@private
CustomAnnotationView* view;
}
@property (nonatomic, retain) CustomAnnotationView* view;
@end
CustomAnnotation.m
@implementation CustomAnnotation
@synthetize view;
CustomAnnotationView.h
@interface CustomAnnotationView : MKAnnotationView {
}
@end
CustomAnnotationView.m
@implementation CustomAnnotationView
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
// Do something related to the annotation tapped
}
@end
Fő osztály ... // A jelölések hozzá, és néhány közülük átfedi másokkal.
- (void)addAnnotation:(CustomAnnotation*)annotation {
[map addAnnotation:annotation];
}
...
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
NSString* identifier = getIdentifierFromAnnotation(annotation);
CustomAnnotationView* view;
if(!(view = (CustomAnnotationView*)[map dequeueReusableAnnotationViewWithIdentifier:identifier])) {
view = [[CustomAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier: identifier];
[(CustomAnnotation*)annotation setView:view];
[view release];
}
return view;
}













