Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [mapView removeAnnotations:mapView.annotations]
- mapView.showUserLocation = YES
- - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id<MKAnnotation>)annotation
- MKPinAnnotationView* annView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"currentloc"];
- if (!annView) {
- MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"];
- annView.pinColor = MKPinAnnotationColorRed;
- annView.animatesDrop=TRUE;
- annView.canShowCallout = YES;
- annView.calloutOffset = CGPointMake(-5, 5);
- if ([annotation isKindOfClass:[DraggableAnnotationAM class]] ) annView.draggable =YES;
- return annView;
- }
- else {
- if ([annotation isKindOfClass:[DraggableAnnotationAM class]] ) annView.draggable = YES;
- annView.annotation = annotation;
- return annView;
- }
- MKUserLocationView
- NSMutableArray *annotation = [[NSMutableArray alloc] init];
- for (id <MKAnnotation> annot_ in [mapView annotations])
- {
- if ( [annot_ isKindOfClass:[ MKUserLocation class]] ) {
- }
- else {
- [annotation addObject:annot_];
- }
- }
- [mapView removeAnnotations:annotation];
- [annotation release];
- annotation = nil;
Add Comment
Please, Sign In to add comment