Adding overlays on MKMapView using MKPolygon, MKPolygonView, MKOverlayView & MKAnnotationView

Hey ! Hi All !

Let’s just have a quick look to the output of what I am going to illustrate using this post.

Adding overlays on MKMapView

Adding overlays on MKMapView

So, This is how it looks like. If you are looking for similar kind of solution, this post is surely going to help you.

1. Add CoreLocation, MapKit, libsqlite3.0, libxml2.7.3 frameworks/linkLibraries to your project.

2. Add third party tool called TouchXML & Place.h, PlaceMark.h in your project. Get it from here.

3. Open your view controller assuming, your viewcontroller already having an instance of MKMapView.

4. Fetch states details (here states of USA) of  from here.

5. Parse them. I have parsed them using TouchXML & here is the code for parsing those data.

6. Add an overlay for each state. Read following code including comments to understand the code.

7. Override following method for Overlayview. Go through comments to understand the code.

8. Add Annotations for each of the state. Read all comments to understand the code.

9. Override following method for annotation.

10. Grab the complete sample code from here.

2 thoughts on “Adding overlays on MKMapView using MKPolygon, MKPolygonView, MKOverlayView & MKAnnotationView

  1. Hi Neon,

    I have requirement that user select the location dynamically without using any text box to enter the address and press button to go the particular location.
    So when user clicked on a particular location a bubble should appear and when he clicked on that a callout should display which when clicked on it should navigate to next page.

    Please guide on this……

    Thanks & Regards,
    Raidu

Leave a Reply

Your email address will not be published. Required fields are marked *



*