生成的iPhone应用程序中的KML文件 [英] Generate KML file within iphone app

查看:411
本文介绍了生成的iPhone应用程序中的KML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我有画用户位置和目标位置之间路由在用的MKMapView和MKAnnotation类MKOverlay的帮助。我已通过苹果的样品KMLViewer code消失在那里他们提到创建编程步骤之外的KML文件,但我需要的iPhone应用程序编程里面KML文件的生成。

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..

步骤获得KML文件手动

获得KML的过程如下:

The process to obtain a KML is as follows:


  • 转至http://maps.google.com/

  • 点击获取路线链接

  • 键入起点和目的地地址
    (例如)
    开始 = 451大学路,帕洛阿尔托,CA 94301
    目标 =#1死循环,库比提诺,CA 95014

  • 修改路线,如你所愿。

  • 点击链接到这个页面的链接。

  • 复制电子邮件/即时通讯链接。

  • 的链接粘贴到您的Safari浏览器的地址栏。

  • 添加和放大器;输出= KML的url和preSS回车键的结尾

  • KML文件将下载到您的下载文件夹中。

  • 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...

推荐答案

KML仅仅是XML和存在于可可,例如生成XML文件的各种方法使用 KissXML

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

中的KML格式记录在这里:的http:// code.google.com /的API / KML /文档/ kmlreference.html

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

这篇关于生成的iPhone应用程序中的KML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆