如何使用 Google Maps API 导入 KML 并单击多边形?
基本上我有一个 KML 文件,其中有大量要绘制的多边形。我需要这些多边形是可点击的,我可以在其中执行 ajax 响应。
不过,我很迷失。有人能指出我正确的方向吗? :)
Basically I have a KML file that has a TON of polygons to be mapped out. I need those polygons to be clickable in which I'd perform an ajax response.
I'm pretty lost, though. Can someone point me in the right direction? :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 Google 地图文档引用的多边形数组示例。它展示了如何绘制多边形,以及如何响应此类多边形上的点击。
要查看示例:
http://code.google。 com/apis/maps/documentation/javascript/examples/polygon-arrays.html
要查看其背后的源代码:
view-source:http://code.google.com/apis/maps/documentation/ javascript/examples/polygon-arrays.html
Check out the polygon-array example that the Google Maps documentation refers to. It shows how to draw polygons, and how to respond to clicks on such polygons.
To view the example:
http://code.google.com/apis/maps/documentation/javascript/examples/polygon-arrays.html
To view the source-code behind it:
view-source:http://code.google.com/apis/maps/documentation/javascript/examples/polygon-arrays.html