谷歌地图KML输出目的地或谷歌方向API与MKMapkit

时间:2012-01-19 07:30:28

标签: iphone ios kml directions

我尝试了苹果开发样本项目
http://developer.apple.com/library/ios/#samplecode/KMLViewer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010046

它的URL工作正常,即http://maps.google.com/maps?saddr=source&daddr=destination&output=kml

但是如果我在网址中添加到目标位置,那么google API无法正确生成KML输出 http://maps.google.com/maps?saddr=source&daddr=destination1%20to:destination2&output=kml

它仅为destination1生成KML

而URL为 http://maps.google.com/maps?saddr=29.94,76.81&daddr=29.97,76.89%20to:30.38,76.77
http://maps.google.com/maps?saddr=29.94,76.81&daddr=30.38,76.77
显示正确的方向

任何想法如何生成正确的KML输出

或者使用Google Direction API在MKMapkit中显示路径的任何好例子

1 个答案:

答案 0 :(得分:1)

来自& output = kml的KML在Google方面没有记录。你不应该依赖它。相反,您可以使用Google Directions Webservice并获取可以解析或转换为KML的JSON或XML。

相关问题