使用带有Google Maps API v3的KML模拟点击标记 [英] Simulate click on marker with KML with Google Maps API v3

查看:76
本文介绍了使用带有Google Maps API v3的KML模拟点击标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用kml文件在地图上创建标记.

I'm using a kml file to create markers on the map.

我需要模拟单击标记以打开信息窗口,方法是单击知道纬度和经度线的外部元素(即div).

I need to simulate a click on a marker to open the info window by clicking an external elements (i.s. a div) knowing latitutude and longitude cords.

我能做什么?

推荐答案

这里至少有两个选择:

一个选项:

  • 使用第三方KML解析器(例如 geoxml3 geoxml-v3 ,它会将KML呈现为原生Google Maps API v3对象,保留对其的引用并使用这些触发器来触发对象上的click事件(适用于标记,多边形和折线),失去了基于KmlLayer图块的渲染的优势.
  • Render your KML using a third-party KML parser like geoxml3 or geoxml-v3 which render the KML as native Google Maps API v3 objects, keep references to them and use those to trigger a click event on the object (works for markers, polygons and polylines), loses the benefit of KmlLayer tile based rendering.

使用geoxml3的示例

使用FusionTables的示例

这篇关于使用带有Google Maps API v3的KML模拟点击标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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