Skip to content

Instantly share code, notes, and snippets.

@wkhatch
Created July 9, 2012 00:30
Show Gist options
  • Save wkhatch/3073554 to your computer and use it in GitHub Desktop.
Save wkhatch/3073554 to your computer and use it in GitHub Desktop.
Map View setup
-(void)setupView
{
//config and setup; get our map and show it
self.backButton.alpha = 0.0;
self.backButton.enabled = NO;
self.listingLocation = [self getLocationFromListing:self.doddleListing];
self.headerLabel.text = @"Calculating...";
//setup our mapView
AddressAnnotation *addAnnotation = [[AddressAnnotation alloc] initWithCoordinate:self.listingLocation];
//addAnnotation.mTitle = [self.doddleListing listingName];
addAnnotation.mTitle = [self annotationTitle];
self.mapView.delegate = self;
[self.mapView addAnnotation:addAnnotation];
[addAnnotation release];
self.mapView.userLocation.title = @"You are here";
MKCoordinateSpan span;
span.latitudeDelta=0.4;
span.longitudeDelta=0.4;
MKCoordinateRegion region = {self.listingLocation, span};
[self.mapView setRegion:region];
[self.containerView.layer setCornerRadius:15.0f];
[self.containerView.layer setShadowColor:[UIColor blackColor].CGColor];
[self.containerView.layer setShadowOpacity:0.8];
[self.containerView.layer setShadowRadius:3.0];
[self.containerView.layer setShadowOffset:CGSizeMake(2.0, 2.0)];
mapView.showsUserLocation=YES;
mapView.mapType=MKMapTypeStandard;
self.tapDown = [[[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(backDownAction)] autorelease];
self.tapUp = [[[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(animateMapFullScreen)] autorelease];
[mapView addGestureRecognizer:self.tapUp];
mapView.delegate = self;
self.listingNameLabel.text = [self.doddleListing listingName];
self.mapView.clipsToBounds = YES;
self.containerView.clipsToBounds = YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment