将点击事件添加到 KMLLayer 地标和标记
如何将 onclick 事件附加到 KML 文件中指定的地标。事件侦听器可以添加到谷歌地图和谷歌地球插件吗? 我该怎么办呢?
How do i attach an onclick event to Placemarks specified in the KML file. Can event listeners be added to both google maps and google earth plugin?
How would I go about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Google 地球插件中...
在 Google Maps API 中
In the Google Earth plugin...
In Google Maps API
看起来,onlick 事件在 kml 加载时就结束了(GMaps v3、带地标的 kml),任何对捆绑在同一 kml 文件中的“BallonStyle”的地标引用都会导致它们替换默认的弹出窗口 - 您可以使用它们实现很多功能。
这些是 Gmaps v3 支持的 kml 元素 http://code.google.com/ apis/kml/documentation/kmlelementsinmaps.html
如果您的问题是如何拦截该 onlick 事件,那么很抱歉我不知道您如何实现这一目标。
Seemingly the onlick event is wrapped up when the kml loads (GMaps v3, kml with Placemarks) Any Placemark references to "BallonStyle" bundled in the same kml file causes these to replace the default popup - and you can achieve a lot with them.
These are the kml elements supported by Gmaps v3 http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html
If your question is how to intercept that onlick event, then I am sorry I do not know how you can achieve that.