I am trying to execute code ... it works very well in my project ... try ..
First download KMLParser.h and KMLParser.m from this link: -
Also download the file DDAnnotation.h and DDAnnotation.m from this link: -
Now create a controller like Like SomeViewController.
Add the following library: -
- CoreLocation.framework
- MapKit.framework
- QuartzCore.framework
In the file SomeViewController.h, the file KMLParser.h is imported.
Write the following code in SomeViewController.h
#import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import "KMLParser.h" @interface SomeViewController : UIViewController <MKMapViewDelegate, CLLocationManagerDelegate, MKOverlay>{ double currentLat; double currentLong; double desiredLatitude; double desiredLongitude; MKMapView *mapView; KMLParser *kml; NSMutableArray *annotations; } @property(nonatomic, retain)IBOutlet MKMapView *mapView; @end
Now in SomeViewController.xib drag and drop the MapView and pass the link with mapView from File Owner. Also set a MapView delegate for the file owner.
Now in SomeViewController write the following code: -
#import "SomeViewController.h"
source share