Generate KML file within iphone app

主宰稳场 提交于 2019-12-04 14:17:08

问题


In my app i have to draw route between user location and destination location in MKMapView with help of MKAnnotation and MKOverlay classes. I had gone through the KMLViewer sample code from apple in there they mentioned to create KML file outside the programming steps, but i need KML file generation inside iPhone app programming.

is it possible? and i need help on doing that..

Steps to get KML file manually

The process to obtain a KML is as follows:

  • Go to: "http://maps.google.com/"
  • Click "Get Directions" link
  • Type in the start and destination addresses (for example) Start = 451 University Avenue, Palo Alto, CA 94301 Destination = #1 Infinite Loop, Cupertino, CA 95014
  • Modify the route as you wish.
  • Click the "Link" to this page link.
  • Copy the email/IM link.
  • Paste the link back into your Safari's address bar.
  • Add &output=kml to the end of the url and press the enter key.
  • The KML file will be downloaded to your Downloads folder.

but i need this to be done programmatically...


回答1:


KML is just XML and there are various methods for generating XML files in Cocoa, e.g. using KissXML.

The KML format is documented here: http://code.google.com/apis/kml/documentation/kmlreference.html.



来源:https://stackoverflow.com/questions/5813963/generate-kml-file-within-iphone-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!