概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助边界的数据驱动型样式,您可以使用 Google 多边形来表示行政边界,为边界多边形设置不同样式,在地图上显示这些多边形,还可以结合自己的商家数据制作形式多样的自定义分级统计图。
使用边界的数据驱动型样式,您可以按地点 ID 定位区域,并为地图上的边界多边形应用自定义样式。每种地图项类型都代表一类区域;在配置地图样式时,您可以选择要启用的地图项类型。
如需了解各个国家/地区的边界覆盖范围,请参阅 Google 边界覆盖范围。
地图项类型
数据驱动型样式可让表示行政区的地图项类型使用 Google 边界数据。行政区按职能分类,例如国家/地区、州/省/直辖市/自治区、市行政区和邮政编码。地图项类型按行政级别排列,其结构因国家/地区而异。边界的数据驱动型样式预览版支持以下地图项类型:
COUNTRY
- 表示国家/地区政治实体,通常是具有最高级别的类型。
ADMINISTRATIVE_AREA_LEVEL_1
- 表示国家/地区级别以下的一级行政实体。在美国,这类行政级别是指州。
ADMINISTRATIVE_AREA_LEVEL_2
- 表示国家/地区级别以下的二级行政实体。在美国,这类行政级别是指县。
LOCALITY
- 表示有建制的城市或城镇政治实体。
POSTAL_CODE
- 表示国家/地区内邮寄地址所用的邮政编码。
SCHOOL_DISTRICT
- 表示学区,包括联合学区、小学和中学。
行政区在地图上以地图项图层的形式显示;每类行政区都有自己的图层。地图项图层是按地图样式启用的。在 Google Cloud 控制台中设置地图样式时,您可以选择要启用的地图项图层。
设置边界多边形的样式
您可以为边界多边形应用填充样式(颜色、不透明度)和描边样式(颜色、不透明度、描边粗细)。通过样式设置,您可以:
Google 边界覆盖范围页面显示了在各个国家/地区可以使用哪些地图项类型。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eData-driven styling for boundaries allows you to style Google's administrative boundary polygons and combine them with your own data to create customized maps, such as choropleth maps.\u003c/p\u003e\n"],["\u003cp\u003eYou can target specific regions using place IDs and apply custom styling to boundary polygons based on feature types like country, state, locality, and postal code.\u003c/p\u003e\n"],["\u003cp\u003eBoundary coverage varies by country and feature type, allowing you to style polygons with fill and stroke properties for visualization.\u003c/p\u003e\n"],["\u003cp\u003eTo get started, configure your map style, obtain place IDs for regions, and explore advanced features like creating choropleth maps and handling mouse events.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the Google boundaries coverage documentation to understand the availability of feature types for different countries.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/maps/documentation/android-sdk/dds-boundaries/overview \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/dds-boundaries/overview \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/dds-boundaries/overview \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\nData-driven styling for boundaries lets you access Google's polygons for\nadministrative boundaries, apply styling to boundary polygons,\ndisplay them on your maps, and combine your own business data to create rich,\ncustomized choropleth maps.\n\nData-driven styling for boundaries lets you target regions by place ID, and apply\ncustom styling to boundary polygons on the map. Each feature type represents a\ntype of region; you select which feature types to enable when [configuring a map style](/maps/documentation/javascript/dds-boundaries/start).\n\nConsult [Google boundaries coverage](/maps/documentation/javascript/dds-boundaries/coverage)\nto see per-country boundary coverage.\n\nFeature types\n\nData-driven styling provides access to Google boundaries for feature types that\nrepresent administrative areas. Administrative areas are categorized by\nfunction, for example country, state, locality, and postal code. Feature types\nare arranged by administrative level, the structure of which varies by country.\nThe following feature types are supported:\n\n- `COUNTRY` --- The national political entity, typically the highest order type.\n- `ADMINISTRATIVE_AREA_LEVEL_1` --- A first-order civil entity below the country level. Within the United States, these administrative levels are states.\n- `ADMINISTRATIVE_AREA_LEVEL_2` --- A second-order civil entity below the country level. Within the United States, these administrative levels are counties.\n- `LOCALITY` --- An incorporated city or town political entity.\n- `POSTAL_CODE` --- A postal code, as used to address postal mail within the country.\n- `SCHOOL_DISTRICT` --- A school district; includes unified, elementary, and secondary.\n\nAdministrative areas are represented on the map as feature layers; each type\nhas its own layer. Feature layers are enabled per map style. You can choose\nwhich feature layers to enable when [setting up your map style in the Google Cloud console](/maps/documentation/javascript/dds-boundaries/start).\n\nStyle boundary polygons\n\nYou can apply styles to boundary polygons for fill (color, opacity), and stroke\n(color, opacity, stroke weight). Use styling to:\n\n- [Style a boundary polygon](/maps/documentation/javascript/dds-boundaries/style-polygon) or show all the boundaries for a feature type.\n- [Create a choropleth map](/maps/documentation/javascript/dds-boundaries/choropleth-map) by joining your own business data.\n\n[Google boundaries coverage](/maps/documentation/javascript/dds-boundaries/coverage)\nshows per-country availability of feature types.\n\nNext steps\n\n- [Get started with data-driven styling for boundaries](/maps/documentation/javascript/dds-boundaries/start)\n- [Get a place ID for a region](/maps/documentation/javascript/dds-boundaries/dds-use-maps-places-apis#use_to_find_a_region)\n- [Use the Geocoding and Places APIs with data-driven styling for boundaries](/maps/documentation/javascript/dds-boundaries/dds-use-maps-places-apis)\n- [Style a boundary polygon](/maps/documentation/javascript/dds-boundaries/style-polygon)\n- [Make a choropleth map](/maps/documentation/javascript/dds-boundaries/choropleth-map)\n- [Handle mouse events](/maps/documentation/javascript/dds-boundaries/handle-events)"]]