Advertisement
wkerswell

mapview

Jan 28th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     if (self.isBeingPresented) {
  2.  
  3.         //set the map delegate
  4.         MapView.delegate = self;
  5.        
  6.     //set the co-ords
  7.     CLLocationCoordinate2D zoomLocation;
  8.     zoomLocation.latitude = LAT_POSN;
  9.     zoomLocation.longitude= LON_POSN;
  10.  
  11.     //create region
  12.     MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, startZoom, startZoom);
  13.     MKCoordinateRegion adjustedRegion = [MapView regionThatFits:viewRegion];
  14.     [MapView setRegion:adjustedRegion animated:YES];
  15.  
  16.         //create a new insatnce of the map overlay object
  17.         MapOverlay * mapOverlay = [[MapOverlay alloc] init];
  18.         //added the over lay
  19.         [MapView addOverlay:mapOverlay];
  20.  
  21.        
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement