Follow these steps:
Chapter6-Recipe4-Beginfolder and then the
.xcworkspacefile in Xcode. This project contains the project as it ended in the previous recipe.
The + button is already connected in the storyboard to our
viewController.mfile's following method:
We first need to initialize a new annotation. We will first create a new
MGLPointAnnoationobject. Within the
– (IBAction)addAnnotation:(id)sendercontext, add the following line:
MGLPointAnnotation *annotation = [[MGLPointAnnotation alloc] init];
The next step is to pass the coordinates; run the following command for this:
self.mapView.centerCoordinatewill create the annotation at the center of our map. It will always be at the center...