Javascript 谷歌地图分为带颜色的区域和子区域

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6455917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 21:49:04  来源:igfitidea点击:

Google map divided in regions with color and in subregions

javascriptasp.netgoogle-mapsgoogle-maps-api-3

提问by Kashif

I need to divide USA map into political boundaries. i.e. states and in seven Regional boundaries on Google map. Each region will have its own color. Example, California, Hawaii, Nevada, Utah, Arizona and Colorado (Southwestern US) will all be same color. Political boundaries will also be on map along with regional boundaries. On national view only regional names should be visible and no state name. On zooming in to region state names will be shown, no city name should be visible either I zoom in or out.

我需要将美国地图划分为边界。即州和谷歌地图上的七个区域边界。每个区域都有自己的颜色。例如,加利福尼亚、夏威夷、内华达、犹他、亚利桑那和科罗拉多(美国西南部)都将是相同的颜色。边界也将与区域边界一起出现在地图上。在国家视图中,只有地区名称应该可见,而没有州名称。在放大到区域状态名称时将显示,无论是放大还是缩小,都不应看到城市名称。

Can you please help me understanding that from where should I start? Links? Tutorial?

你能帮我理解我应该从哪里开始吗?链接?教程?

Do I need an Image to put on map as overlay.

我是否需要将图像作为叠加层放置在地图上。

I am really not getting it.

我真的不明白。

If you want to close this question then please help me that what is the forum to ask this so I put it there?

如果你想结束这个问题,请帮助我问这个问题的论坛是什么,所以我把它放在那里?

采纳答案by Matt Ball

I need to divide USA map into political boundaries. i.e. states and in seven Regional boundaries on Google map. Each region will have its own color.

我需要将美国地图划分为边界。即州和谷歌地图上的七个区域边界。每个区域都有自己的颜色。

You can do this with a relatively simple polygon overlay. You'll need to obtain polygon data for each region of interest from a third party since the API does not provide any.

你可以用一个相对简单的多边形覆盖来做到这一点。您需要从第三方获取每个感兴趣区域的多边形数据,因为 API 不提供任何数据。

On zooming in to region state names will be shown, no city name should be visible either I zoom in or out.

在放大到区域状态名称时将显示,无论是放大还是缩小,都不应看到城市名称。

This starts to get more complicated. Probably best done using a custom map type(see image map types) if you don't want to see features like city names.

这开始变得更加复杂。如果您不想看到像城市名称这样的特征,最好使用自定义地图类型(请参阅图像地图类型)。

See also

也可以看看