如何在Google地图上突出显示一个地区 [英] How to highlight a region on Google Maps
问题描述
如何使用Google Maps多边形数组突出显示/覆盖一个区域或多个具有不同颜色的区域(例如3个美国州)? 我在Google代码上找到了一个有关如何绘制多边形的tuto,但没有提供详细信息.
How can I highlight/cover a region or multiple regions with different colors (for example 3 US states), using google maps polygon arrays? I found a tuto on google code about how to draw a polygon but it's not giving detailed information.
感谢您的帮助.
推荐答案
Google上的此文档尽可能地直接.
This documentation on Google is about as straight forward as you can get.
http://code.google.com/apis/maps/documentation/javascript/overlays.html
查看此页面的源.将代码复制并粘贴到您自己的页面中,然后从那里开始.
View the source of this page. Copy and paste the code into your own page and start from there.
http://code.google.com/apis/maps/documentation/javascript/examples/polygon-simple.html
在上面的示例中,您只需要制作一个以上百慕大实例的实例,并将其命名为其他名称,然后将其添加到地图中即可.
In the example above you simply need to make more than one instance of bermudaTriangle and name it something else and add it to the map.
这篇关于如何在Google地图上突出显示一个地区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!