Join Véronique Brossier for an in-depth discussion in this video Creating an overlay using a polygon, part of iOS SDK: Building Apps with MapKit and Core Location.
This application shows a circle overlay to identify Carpinteria.…In this movie, I will show you how to add a different shape.…In this case, a polygon. Let's get started.…So let's review the step we need to take.…First of all, we need to define the coordinate to use.…And for this example, I will create a triangle.…What is very powerful about polygon is that you can pretty much draw any shape…you want, square, a circle, a triangle, or a star.…
Secondly, we want to create the polygon itself and add it to the map.…Then what we will need to do is inside the Map view, View for overlay method is…make the changes so that this method now can accommodate for various shapes.…So let's get started.…To create the coordinates value, use the CLLocationCoordinate2D.…But this time, let's define the number of points that we want to use, in this case 3.…
And for convenience, I have already created the coordinate values, so just drag…them from the CodeSnippets user folder. And now the coordinates are created.…Let's now create the polygon. It's of type MKPolygon1:32, let's call it polygon.…
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.
- Displaying maps
- Reviewing the geographic coordinate system in MapKit
- Centering the map on the user location
- Adding interactivity to annotations
- Creating overlays with shapes and lines
- Starting and stopping location services
- Defining the distance between two locations
- Implementing forward or reverse geocoding