Changing KML Files Contents

倖福魔咒の 提交于 2019-12-12 02:33:27

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/9195355/changing-kml-files-contents

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