Can I manipulate a KML using Google Maps API v3?
I'm loadin开发者_运维知识库g a KML using KMLLayer in Google Maps API v3. Is it possible to reference the polygons on the map and do things like change color or transparency?
No you can't do it like that since there are no polygons like objects in a kmllayer. From the google docs:
The Maps API converts the provided geographic XML data into a KML representation which is displayed on the map using a V3 tile overlay. This KML looks (and somewhat behaves) like familiar V3 overlay elements. KML and GeoRSS point elements are rendered as markers, for example, elements are rendered as polylines and elements are rendered as polygons. Similarly, elements are rendered as rectangular images on the map. Importantly, however, these objects are not Google Maps API Markers, Polylines, Polygons or GroundOverlays; instead, they are rendered into a single object on the map.
This page might be helpfull in exploring alternatives
精彩评论