更改KML文件内容 [英] Changing KML Files Contents

查看:115
本文介绍了更改KML文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道我的程序是否有可能在我刚创建的kml文件中添加/删除标记? 例如,我的KML文件包含报告发生洪水的城市中的所有区域。在上传文件并通过我的网站将其显示在Google地图中后,报告了一个新案例。是否有可能在我的网站的添加区域字段中添加该位置并更新KML文件?

预先感谢!

解决方案

有很多库用于编程式地更新KML。我目前的最爱是 pyKML ,但也有 libkml 和其他许多。或者同样简单,KML只是XML标记,因此您用于读取/写入XML的任何库都可以正常工作。



如果您问是否可以通过Google地图API,不,它不能。 KML呈现出现在服务器端,您不能通过KMLLayer获得对KML对象的写入权限。


I am just wondering if there is a possibility that my program can add/remove markers in the kml file that I just created?

For example, my KML file contains all the areas in a city where there is a reported case of flooding. After uploading the file and displaying it in the Google Maps through my website, a new case was reported. Is it possible to add that place in my website's "add area" field and update the KML file as well?

Thanks in advance!

解决方案

There are plenty of libraries out there for programatically updating KML. My current favorite is pyKML, but there's also libkml and a number of others. Or just as easily, KML is just XML markup so any libraries you have for reading/writing XML work fine.

If you're asking can it be done through the Google Maps API, no it can't. The KML rendering there happens server side and you don't get write access to a KML object through KMLLayer.

这篇关于更改KML文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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