我可以解析kml文件以显示Android中的路径或点吗?请你能帮助我吗?
这是kml示例代码,我想在android谷歌地图中显示:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Paths</name>
<description>Examples of paths. Note that the tessellate tag is by default
set to 0. If you want to create tessellated lines, they must be authored
(or edited) directly in KML.</description>
<Style id="yellowLineGreenPoly">
<LineStyle>
<color>7f00ffff</color>
<width>4</width>
</LineStyle>
<PolyStyle>
<color>7f00ff00</color>
</PolyStyle>
</Style>
<Placemark>
<name>Absolute Extruded</name>
<description>Transparent green wall with yellow outlines</description>
<styleUrl>#yellowLineGreenPoly</styleUrl>
<LineString>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>absolute</altitudeMode>
<coordinates> -112.2550785337791,36.07954952145647,2357
-112.2549277039738,36.08117083492122,2357
-112.2552505069063,36.08260761307279,2357
-112.2564540158376,36.08395660588506,2357
-112.2580238976449,36.08511401044813,2357
-112.2595218489022,36.08584355239394,2357
-112.2608216347552,36.08612634548589,2357
-112.262073428656,36.08626019085147,2357
-112.2633204928495,36.08621519860091,2357
-112.2644963846444,36.08627897945274,2357
-112.2656969554589,36.08649599090644,2357
</coordinates>
<LineString>
</Placemark>
</Document>
</kml> …Run Code Online (Sandbox Code Playgroud) 我必须做一个项目,我需要计算从我的位置到目的地的距离,并在textview中显示它.请注意,当我的位置发生变化时,这个距离会更新.是否可以制作这种类型的项目?
[注意:没有实施谷歌地图我必须做它.目的地lon,lat是已知的.只需要找到我的位置并进行计算]
我使用这样的网址:
但它返回完整的html页面.有谁知道如何以json或xml或任何可解析的格式获取此类信息?
我需要公共交通.