我可以使用Google Maps API v3操作KML吗? [英] Can I manipulate a KML using Google Maps API v3?

查看:136
本文介绍了我可以使用Google Maps API v3操作KML吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Google Maps API v3中使用KMLLayer加载KML.是否可以参考地图上的多边形并进行诸如更改颜色或透明度之类的事情?

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?

推荐答案

不,您不能那样做,因为kmllayer中没有像对象这样的多边形.从 Google文档 :

No you can't do it like that since there are no polygons like objects in a kmllayer. From the google docs:

Maps API将提供的地理XML数据转换为KML 使用V3瓷砖叠加层显示在地图上的表示形式. 这个KML看起来(并且在某种程度上表现得很像)熟悉的V3叠加层 元素. KML和GeoRSS点元素呈现为 标记,例如,元素渲染为折线 和元素呈现为多边形.相似地, 元素在 地图.但是重要的是,这些对象不是 Google Maps API 标记,折线,多边形或GroundOverlay;相反,他们是 呈现在地图上的单个对象中.

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

这篇关于我可以使用Google Maps API v3操作KML吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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