如何在Android中创建KML文件? [英] How to create KML file in Android?

查看:172
本文介绍了如何在Android中创建KML文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我的应用程序从服务器接收到KML文件,并在地图中显示所有地标。但是有太多的数据来回传递,所以现在我只想从服务器接收一个简短的字符串(lat,lang为几个点)。

是否有可能在Android设备上创建KML文件(任何API用于此?

解决方案

目前似乎没有任何KML库可以很好地与Android配合使用,我一直在使用简单的XML 库解析KML,并且运行良好。



但是,由于您已经以简化格式接收数据,自己直接使用Google Maps API会更好,这样可以节省构建KML,将其发送给Google,然后获取呈现的地图的工作量,这里的教程将帮助您开始使用: http://developer.android.com/resources/tutorials/views/hello-mapview.html


At the moment, my app receives KML file from server and displays all the placemarks in the maps. But there is too much data going back and forth, so now i want to receive only a short string (lat,lang for a few points) from the server.

Is it possible to create KML file on an Android device (any API for this?

解决方案

There does not seem to be any KML libraries that will work well with Android right now. I have been using the Simple XML library for parsing KML, and is working out well.

However, since you are already receiving the data in a simplified format, you would be much better off using the Google Maps API directly yourself. This will save the effort of building up the KML, sending it to Google, and then getting back the rendered map. The tutorial here will help you get started: http://developer.android.com/resources/tutorials/views/hello-mapview.html

这篇关于如何在Android中创建KML文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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