In some of your applications, you may want to draw lines on your map, such as the roadmap between cities.…In this movie I will show you how to do it. So I am going to just quit out of the simulator.…And now let's go over the steps. First, we need to create the coordinates, then…we need to create the line, and finally, add the line to the map.…We also need to make changes to the map view viewForOverlay to draw the line view.…

Let's create the coordinate first, so we are going to use a CLCoordinate, LocationCoordinate2D.…And in this case, you want to make sure to parse the number of points that you…will store, and I have already prepared some points up above, for convenience,…so the first example will draw lines between three locations, Ventura,…Carpinteria, and Santa Barbara.…Secondly, let's create the line so the datatype for line is MKPolyline.…

Let's call it line, and to create the polyline, we will use the…polyLineWithCoordinateMethods, parse the coordinates and the number of points to draw.…Now make sure that the number actually matches the number of coordinates, or the…

Resume Transcript Auto-Scroll

Author

Released

8/3/2012

This course shows iOS developers how to add location awareness and maps to Apple iPhone and iPad applications. Discover how to show customers and clients where you're located and share directions with them.

Author Véronique Brossier covers the basic purpose of the Core Location and MapKit frameworks and how to integrate their services with your existing applications. Véronique shows how to center a map on a location, add annotations, create overlays, and zoom and navigate around maps. The course also covers how to leverage live location data such as course and speed and modify it when necessary.