简体   繁体   English

Google Maps JavaScript API:动态设置KML层样式

[英]Google Maps JavaScript API : Dynamically style KML Layer

I am making this interactive map using Google Maps API and I need your help on something. 我正在使用Google Maps API制作此交互式地图,需要您的帮助。

First here is the example I'm working on : http://it-zone.ma/map/ 首先,这是我正在处理的示例: http : //it-zone.ma/map/

A KML Polygon is loaded over Africa for it to be highlightable. KML多边形已在非洲加载,以使其突出显示。 I need to change the fillColor of the polygon when mouse is over it. 当鼠标悬停在多边形上时,我需要更改其fillColor。 In Google Maps API documentation, there is a chapter on Dynamically Styling Data Layers and another one on KML Layers but I can't seem to find any way to Dynamically Style KML Data Layers. 在Google Maps API文档中,有一章介绍了动态样式化数据层,另一章介绍了KML层,但是我似乎找不到任何方法来动态样式化KML数据层。

Thank you in advance. 先感谢您。

You can't dynamically style KmlLayers. 您无法动态设置KmlLayers的样式。 You can use a data layer , a FusionTables layer , or a third party parser like geoxml3 or geoxml-v3 . 您可以使用数据层FusionTables层或第三方解析器,例如geoxml3geoxml-v3

example using geoxml3 使用geoxml3的示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM