I am trying to load my Map which I created with a kml File in Google-Maps. The Google Maps Link. I have to say it is only an example, but it is the same principle.
The easiest way is to load in a WebView, but that is ugly in my eyes.
Thank you for reading my Question!
Best regards CTS
To load a
KMLinto aMKMapView:Add the necessary frameworks (
MapKit.frameworkandCoreLocation.framework) to your target;Load and parse the KML;
Create your annotations on the basis of the KML; and
Set your map’s
regionto encompass the annotations.Thus, that might look like:
My
Parserclass is just aNSXMLParsersubclass that I’ve written that will create an array ofitemsone per occurrence ofrowElementName, and for each row, it will grab the elements listed in theelementNamesarray.Parser.h:
Parser.m:
Finally, the only other utility method that my
loadKmluses isregionForAnnotations, which defines a region based upon a series of annotations. Rob Mooney wrote a simple routine to do that: