Learn about the use of cameras to display a point based on heading and coordinates.
- [Male Instructor] You used a region of your map…using coordinates and distance.…You might want to use altitude,…or change the heading as well.…To do that, you need a different property…for viewing coordinates, the camera.…The camera works by setting a center coordinate…and then setting the distance in the camera from that point…as an altitude.…Close the app.…Cameras are of type MKMapCamera.…Go to view controller, and up to the properties…and add a new property for a camera,…var…camera equals…MKMapCamera.…
Go back down to your location picker,…and go to case two, which is Chicago.…Under the current code, add this…camera.centerCoordinate…equals coordinate2D.…That sets our center coordinate.…We'll set the altitude to 50 meters,…and that will be camera…altitude equals 50.0.…
And then I'll set the camera property on map view…by going mapView.camera…equals camera.…So, I don't do the update that's on the bottom…for the region,…I'm going to go ahead and return right after here.…With that done, go ahead and run this.…Pick Chicago.…
- Getting coordinates from the web
- Working with Core Location data types and regions
- Creating a map in 2D, 3D, satellite, and flyover views
- Adding annotations
- Adding overlays
- Finding the current location
- Tracking heading, speed, and region
- Searching for locations
- Requesting and displaying directions
Skill Level Advanced
1. Basic Map and Location Concepts
5. Current Location
6. Heading, Speed, and Regions
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.