解析的KML文件不显示在我的应用程序在谷歌地图路线 [英] Parsed KML file doesn't show route in Google Map in my App

查看:561
本文介绍了解析的KML文件不显示在我的应用程序在谷歌地图路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功解析KML文件从服务器,并从资产的文件夹,并获得坐标从KML文件,并能够显示从服务器端的KML文件路径。

I am successfully parsed KML file from server and also from assets folder and get co-ordinates from KML file and able to display route from server side KML file.

但对于测试的问题我已经下载KML文件从谷歌地图之间的两个位置,路线,并把KML文件的资产文件夹,并对其进行访问。它成功地解析和我登录了坐标还,但我不能能够显示在地图上使用该坐标的路线。所以任何人可以告诉大家,我们不能显示从谷歌地图下载KML文件路径。为了测试我已经或者检查是否已下载KML文件是有效的不是,我才知道它的一个有效的KML文件。

But the problem for test I have download KML file for route between two location from Google map and put KML file in assets folder and accessing it. It successfully parsed and i got coordinates in log also but i can't able to display route on map using that co-ordinates.. So can anybody tell that can't we display route from downloaded KML file from google map. For test i have checked if that downloaded KML file is valid or not and I came to know its a valid KML file.

我使用的SAXParser解析我的KML文件。

I am parsing my KML file using SAXParser.

推荐答案

虽然我已经花了2天,这最后我得到了解决办法。

Though I have spent 2 days for this Finally I got solution.

在我的 KML 文件我用 XML模式

<kml xmlns="http://www.opengis.net/kml/2.2"  xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2">   

所以,我刚才替换为

So i have just replace as

<kml xmlns="http://www.opengis.net/kml/2.2">

只,并添加

<altitudeMode>absolute</altitudeMode>

在标签&LT;标&GT; 标记

这篇关于解析的KML文件不显示在我的应用程序在谷歌地图路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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