如何在Google地图上突出显示一个地区 [英] How to highlight a region on Google Maps

查看:660
本文介绍了如何在Google地图上突出显示一个地区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用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屋!

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