通过JavaScript访问Google地图覆盖图中的KML地标? [英] Access KML placemarks in a Google Maps overlay via Javascript?

查看:93
本文介绍了通过JavaScript访问Google地图覆盖图中的KML地标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用GGeoXml对象的嵌入式Google地图上覆盖了KML文件。我希望能够从Javascript访问KML文件中的特定地标(例如,为了响应用户操作在地图上突出显示选定的多边形)。

I have a KML file overlay on an embedded Google Map using the GGeoXml object. I'd like to be able to access specific placemarks in the KML file from Javascript (for example to highlight a selected polygon on the map in response to user action).

理想情况下,我想要做的就是这样(伪代码):

Ideally what I'd like to do is something like this (pseudo-code):

 geoXml.getPlacemarkByName('Foo').focus();

不幸的是 Google Maps API 似乎没有公开KML叠加层的地标或任何其他内部结构。有没有人有任何想法,我可能会做到这一点?我不知道这些覆盖层是如何在内部实现的,但似乎有可能让我这样做。

Unforunately the Google Maps API doesn't seem to expose the placemarks or any other internals of the KML overlay. Does anyone have any thoughts as to how I might accomplish this? I don't know anything about how the overlays are implemented internally, but it seems like there might be a hack that would let me do this.

我也在使用jQuery FWIW。

I'm also using jQuery FWIW.

推荐答案

您是否看过 GeoXML

这篇关于通过JavaScript访问Google地图覆盖图中的KML地标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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