總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
您可以透過界線資料導向樣式,使用 Google 多邊形來描繪行政界線、將樣式套用至界線多邊形、在地圖上顯示這些多邊形,以及結合自己的業務資料,製作內容豐富的自訂 choropleth 地圖。
您可以運用界線資料導向樣式,按地點 ID 指定區域,以及將自訂樣式套用至地圖上的界線多邊形。每個地圖項目類型代表一種區域,在設定地圖樣式時,您可以選取要啟用的地圖項目類型。
如要查看各國家/地區的邊界涵蓋範圍,請參閱「Google 邊界涵蓋範圍」一文。
地圖項目類型
在資料導向樣式中,Google 會針對代表行政區的地圖項目類型設定邊界。行政區是按機能分類,例如國家/地區、州/省、縣市和郵遞區號。地圖項目類型按行政層級排列,結構因國家/地區而異。支援的地圖項目類型如下:
COUNTRY
:國家/地區政治實體,此類型通常為最高順位。
ADMINISTRATIVE_AREA_LEVEL_1
:國家/地區層級底下的第一順位行政實體。在美國境內,這類行政層級是指州。
ADMINISTRATIVE_AREA_LEVEL_2
:國家/地區層級底下的第二順位行政實體。在美國境內,這類行政層級是指郡。
LOCALITY
:建制城市或鄉鎮的政治實體。
POSTAL_CODE
:國家/地區郵政地址使用的郵遞區號。
SCHOOL_DISTRICT
— 學區,包含聯合學區、小學及中學。
在地圖上,行政區是以地圖項目圖層的形式顯示,每類行政區都有各自的圖層,地圖項目圖層是按地圖樣式啟用。在 Google Cloud 控制台中設定地圖樣式時,您可以選擇要啟用哪些地圖項目圖層。
設定界線多邊形的樣式
您可以將填滿 (色彩、不透明度) 和筆劃 (色彩、不透明度、筆劃粗細) 的樣式套用至界線多邊形。樣式的用途如下:
Google 邊界涵蓋範圍會顯示地圖項目類型在各個國家/地區是否可用。
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間: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)"]]