Hi,
I'm creating a mapView with overlays on it, to display information about an airport. (Flight paths that the aircraft take for example).
I'm using KMLs to store all my data.
I imported the KMLParser from apple's KMLViewer sample code, as demoed in session 127 of WWDC 2010.
This reads any place marks/pins I have fine. However, it seems to not read my path at all. It works out it's an MKPolyLine. It gives it basic coordinates, for x and y origin, but none of the points are there, and all the formatting e.g. colour/width/cap ends is set to nil or 0 in the debugger.
This is the code I breakpointed to see this:
Code:
- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay
{
// object kml is just an instance of apple's kml parser
MKOverlayView *overlayView = [kml viewForOverlay:overlay];
return overlayView;
}
Presuming it was my code, I transferred one of my KMLs to apple's sample code, no code changed apart from the path string to load the file.
The guy presenting this session at WWDC even said that you could do this, however it couldn't read the path.
Therefore the only thing that can be wrong is the KML.
Looking at the versions, the one I exported from GE is v 2.2, however the KML apple includes in their sample code is v 2 KML. I was wondering whether anyone knew whether that was significant.
Also I was using google earth to create the paths, does anyone know of a more simplistic 2D KML creator that would be better suited to this task.
Or even because GE exports the coords, just making it manually would be easier??
Thanks in advance,
Alex