Skip to content

Instantly share code, notes, and snippets.

@rknLA
Created May 7, 2012 18:03
Show Gist options
  • Save rknLA/2629350 to your computer and use it in GitHub Desktop.
Save rknLA/2629350 to your computer and use it in GitHub Desktop.
- (void)addMarkerAt:(CLLocationCoordinate2D)position forHotspot:(Hotspot *)hotspot
{
UIImage *pinImage = unvisitedPin;
if ([hotspot.visited boolValue]) {
pinImage = visitedPin;
}
CLLocationCoordinate2D annotationCoord;
annotationCoord.latitude = [hotspot.latitude doubleValue];
annotationCoord.longitude = [hotspot.longitude doubleValue];
RMAnnotation *annotationPoint = [[RMAnnotation alloc] initWithMapView:mapView
coordinate:annotationCoord
andTitle:hotspot.name];
[annotationPoint setAnnotationIcon:pinImage];
[mapView addAnnotation:annotationPoint];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment