突出显示一个多边形,同时点击使用kml [英] highlight a polygon while on click using kml

查看:103
本文介绍了突出显示一个多边形,同时点击使用kml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用kml文件在Google地图中绘制多边形。我正在为正在工作的那些多边形设置点击事件。现在我想要突出显示点击的多边形。我曾尝试setOption()方法,但它不起作用。点击时可以更改多边形的颜色吗?

I am using kml file to draw polygons in google map. I am setting click events for those polygon which is working. Now I want the clicked polygon to be highlighted. I had tried the setOption() method, but it didn't work. Is it possible to change the color of polygon on clicking it?

推荐答案

如果您使用KmlLayer(猜测),则无法更改Polygons的属性。如果您使用第三方KML解析器,如geoxml3。这是一个链接.. http:/ /developers.cloudmade.com/projects/web-maps-api/examples/kml-and-geo-rss

If you are using KmlLayer (a guess), you can't change the properties of the Polygons. If you use a third party KML parser like geoxml3. Here is a link to that.. http://developers.cloudmade.com/projects/web-maps-api/examples/kml-and-geo-rss

这篇关于突出显示一个多边形,同时点击使用kml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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