From the course: Advanced iOS App Development: MapKit & Core Location

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add coordinates and regions

Add coordinates and regions - iOS Tutorial

From the course: Advanced iOS App Development: MapKit & Core Location

Start my 1-month free trial

Add coordinates and regions

- [Instructor] We have a map that doesn't do much yet. We'd like to display a coordinate on our map. The quick way to do that is using a coordinate region. Close the app. Close the assistant editor, and head over to the view controller. We'll need some coordinates. To save you some time, I added the five pizza restaurants we'll be working with and two from the challenge work you did earlier. If you did not download the starter file, pause the video for a moment and copy these into a comment. Coordinate regions have three parameters. There's a center coordinate and two distance coordinates. One for latitude and one for longitude. Set the coordinate like this above the outlet. There, coordinate2D = CLLocationCoordinate2DMake and it has a latitude and a longitude. Add the latitude and longitude by cutting and pasting from the Naples coordinates. The way I tend to do this is I copy the coordinates and just paste them in here. For the distances, you can specify these as degrees latitudes…

Contents