Skip to content

Instantly share code, notes, and snippets.

@Duraiamuthan
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Duraiamuthan/11147743 to your computer and use it in GitHub Desktop.
Save Duraiamuthan/11147743 to your computer and use it in GitHub Desktop.
AddAnnotation in Mapview
-(void)MarkMapwithLat:(NSString*)lat withLong:(NSString*)longi
{
NSLog(@"Latitude:%@ Longitude:%@",lat,longi);
CLLocationCoordinate2D coord=CLLocationCoordinate2DMake(lat.floatValue,longi.floatValue);
MKAnnotation *annotation=[[MKAnnotation alloc]initWithCoordinate:coord title:self.Name andsubTitle:customerSnippet];
MKCoordinateRegion viewRegion=MKCoordinateRegionMakeWithDistance(coord,500,500);
[mapVu setRegion:viewRegion animated:YES];
[mapVu addAnnotation:annotation];
[mapVu setRegion:viewRegion];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment