我需要解析XML或JSON文件数据以在Android Google Map应用程序上添加多个标记,我不知道如何将其解析为地图视图,我可以获得相同的源代码吗?
Xml文件如下所示: -
<map>
<area>
<longitude>-97.762914</longitude>
<latitude>30.282165</latitude>
<name>Place Name 1</name>
<address>Place Address 1</address>
</area>
<area>
<longitude>-97.762914</longitude>
<latitude>31.282165</latitude>
<name>Place Name 3</name>
<address>Place Address 3</address>
</area>
<area>
<longitude>-97.762914</longitude>
<latitude>32.282165</latitude>
<name>Place Name 3</name>
<address>Place Address 3</address>
</area>
</map>
答案 0 :(得分:0)
对于xml解析,请按照以下两个链接进行操作:
http://android-er.blogspot.in/2010/04/read-xml-resources-in-android-using.html
http://www.codeproject.com/Articles/334859/Parsing-XML-in-Android-with-SAX
将多个制作者放在谷歌地图上,请注意:
http://www.coderanch.com/t/493833/Android/Mobile/Multiple-Markers-Google-Map-Android
http://androidcodeplace.blogspot.in/2012/04/adding-multiple-markers-on-android-map.html
希望,这些会对你有帮助..