Can I manipulate a KML using Google Maps API v3?

落花浮王杯 提交于 2019-12-10 23:17:17

问题


I'm loading 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?


回答1:


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



来源:https://stackoverflow.com/questions/6793493/can-i-manipulate-a-kml-using-google-maps-api-v3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!