如何从GGeoXml对象获取KML数据(How to get the KML data from a GGeoXml object)

编程入门 行业动态 更新时间:2024-10-26 23:27:39
如何从GGeoXml对象获取KML数据(How to get the KML data from a GGeoXml object)

我使用以下代码将KML文件加载到Google地图对象中:

map = new GMap2(document.getElementById("map_canvas")); geoXml = new GGeoXml(kml); GEvent.addListener(geoXml, "load", function() { geoXml.gotoDefaultViewport(map); // I would like to read the KML contents here }); map.addOverlay(geoXml); // ...

我想从KML文件中读取地标并将它们显示在列表中。 我知道我需要的信息正在传输到浏览器,但我不知道如何访问它。

I load an KML file into a google map object using the following code:

map = new GMap2(document.getElementById("map_canvas")); geoXml = new GGeoXml(kml); GEvent.addListener(geoXml, "load", function() { geoXml.gotoDefaultViewport(map); // I would like to read the KML contents here }); map.addOverlay(geoXml); // ...

I would like to read the placemarks from the KML file and display them in a list. I know that the information I need is being transferred to the browser but I don't know how to access it.

最满意答案

您无法通过API访问它,但数据在GGeoXML对象内的混淆属性中可用。 在Firebug中查看它,我在这里找到了这些信息:geoxml。$ q.ia。 自己查看一下,看看你需要的属性(名称,描述等)。

You can't access it through the API, but the data is available in obfuscated properties inside GGeoXML object. Looking at it in Firebug, I found that information here: geoxml.$q.ia. Look at it yourself to see the properties you need (name, description, etc.).

更多推荐

本文发布于:2023-07-15 18:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1117485.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对象   数据   GGeoXml   KML   object

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!