Skip to content

Instantly share code, notes, and snippets.

Forked from ebinnion/.m file
Last active January 2, 2016 09:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save obahareth/8280840 to your computer and use it in GitHub Desktop.
Declare an array that will hold the coordinates within the viewDidLoad function/method. Then fill the array with the coordinates. Then define a MKPolygon pointer that will use that array. Last, add the overlay to the map.
- (void)viewDidLoad
// Adds a polygon over the commuter parking in front of the library
CLLocationCoordinate2D libComPark[4];
libComPark[0] = CLLocationCoordinate2DMake(33.874689,-98.520148);
libComPark[1] = CLLocationCoordinate2DMake(33.87469,-98.519692);
libComPark[2] = CLLocationCoordinate2DMake(33.874314,-98.519687);
libComPark[3] = CLLocationCoordinate2DMake(33.874316,-98.520146);
MKPolygon *polLibcomPark = [MKPolygon polygonWithCoordinates:libComPark count:4];
[msuMap addOverlay:polLibcomPark];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment