Parsed KML file doesn't show route in Google Map in my App

孤人 提交于 2019-12-01 13:32:14

问题


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.

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.

I am parsing my KML file using SAXParser.


回答1:


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

In my KML file I was using XML schema as

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

only and also add

<altitudeMode>absolute</altitudeMode>

tag in <PlaceMark> tag.



来源:https://stackoverflow.com/questions/25886749/parsed-kml-file-doesnt-show-route-in-google-map-in-my-app

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