Learn about the use of polylines for directions. Find out how to manually plot directions from two points.
- [Instructor] You've used a circle overlay…to show an area around a restaurant.…You can use lines in your overlays in several ways.…You can make closed shapes with the MK polygon…and lines with the MK polyline using their…appropriate renderers, MK polygon renderer…and MK polyline renderer.…We'll use MK polyline in our application…since we'll be using it later for directions.…Close the app.…Go back to Xcode in the view controller class.…Let's make a line between the two Beverly Hills restaurants.…
I'll grab my coordinates from the annotations…so I have less to look up.…Make a new function above the add delivery overlay method.…We'll call it func.…We'll call it addpolylines.…Now in this function I'd be tempted to use…map view annotations to get my coordinates like I did…with the add delivery overlay, but that would be a mistake.…That's a set not an array.…
The index and the location would change each use of the app.…I have to find the correct annotations.…Instead I'm going to use pizza history annotations.…So make the next line be let annotations…
- 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 Intermediate
Advanced iOS Development: Working with APIswith Saul Mora1h 59m Intermediate
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.