Tổng quan
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tính năng tạo kiểu dựa trên dữ liệu cho ranh giới cho phép bạn truy cập vào các đa giác của Google cho ranh giới hành chính, áp dụng kiểu cho các đa giác ranh giới, hiển thị chúng trên bản đồ của bạn.
Tính năng tạo kiểu dựa trên dữ liệu cho ranh giới cho phép bạn nhắm đến các khu vực theo mã địa điểm và áp dụng kiểu tuỳ chỉnh cho các đa giác ranh giới trên bản đồ. Mỗi loại đối tượng đại diện cho một loại khu vực; bạn chọn loại đối tượng cần bật khi định cấu hình kiểu bản đồ. Tham khảo phạm vi ranh giới của Google để xem phạm vi ranh giới theo từng quốc gia.
Loại tính năng
Tính năng tạo kiểu dựa trên dữ liệu cung cấp quyền truy cập vào ranh giới của Google cho các loại đối tượng đại diện cho khu vực hành chính. Các khu vực hành chính được phân loại theo chức năng, ví dụ: quốc gia, tiểu bang, địa phương và mã bưu chính. Các loại đối tượng được sắp xếp theo cấp hành chính, cấu trúc của cấp này sẽ khác nhau tuỳ theo quốc gia.
bao gồm:
GMSFeatureTypeCountry
– Thực thể chính trị quốc gia, thường là loại cấp cao nhất.
GMSFeatureTypeAdministrativeAreaLevel1
– Khu vực hành chính cấp một dưới cấp quốc gia. Tại Hoa Kỳ, các cấp hành chính này là tiểu bang.
GMSFeatureTypeAdministrativeAreaLevel2
– Khu vực hành chính cấp hai dưới cấp quốc gia. Tại Hoa Kỳ, các cấp hành chính này là hạt.
GMSFeatureTypeLocality
– Một pháp nhân chính trị của thành phố hoặc thị trấn hợp nhất.
GMSFeatureTypePostalCode
– Mã bưu chính, được dùng để gửi thư bưu chính trong quốc gia.
GMSFeatureTypeSchoolDistrict
– Một học khu; bao gồm các trường tiểu học, trung học cơ sở và trung học phổ thông.
Các khu vực hành chính được thể hiện trên bản đồ dưới dạng các lớp đối tượng; mỗi loại có lớp riêng. Các lớp đối tượng được bật theo từng kiểu bản đồ. Bạn có thể chọn lớp đối tượng cần bật khi thiết lập kiểu bản đồ trong bảng điều khiển Google Cloud.
Tạo kiểu cho đa giác ranh giới
Bạn có thể áp dụng kiểu cho các đa giác ranh giới để tô (màu sắc, độ mờ) và vẽ nét (màu sắc, độ mờ, độ đậm của nét vẽ). Sử dụng kiểu để:
- Tạo kiểu cho một đa giác ranh giới hoặc hiện tất cả ranh giới cho một loại đối tượng.
- Tạo bản đồ chuyên đề.
Phạm vi ranh giới của Google cho biết phạm vi cung cấp của các loại đối tượng theo từng quốc gia.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eData-driven styling enables applying custom styles to Google's administrative boundary polygons on your maps, targeting regions by place ID.\u003c/p\u003e\n"],["\u003cp\u003eYou can select specific feature types like countries, states, localities, and postal codes to display on your map.\u003c/p\u003e\n"],["\u003cp\u003eBoundary polygons can be styled with fill and stroke properties to create visual effects or choropleth maps.\u003c/p\u003e\n"],["\u003cp\u003eGoogle provides boundary data for various countries, and coverage details are available in the documentation.\u003c/p\u003e\n"],["\u003cp\u003eData-driven styling is available across Android, iOS, and JavaScript platforms.\u003c/p\u003e\n"]]],["Data-driven styling allows accessing and styling Google's administrative boundary polygons on maps. Users can target regions by place ID and apply custom styling to the polygons. Feature types, categorized by administrative level (e.g., country, state, locality, postal code, school district), are accessed via layers within map styles. Styling options include fill color and opacity, as well as stroke color, opacity, and weight, enabling the creation of choropleth maps or individual boundary styles. Availability of these feature types varies by country.\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, display them on\nyour 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\nstyle. Consult [Google boundaries coverage](/maps/documentation/ios-sdk/dds-boundaries/coverage) to see per-country\nboundary 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.\nThese include:\n\n- `GMSFeatureTypeCountry` --- The national political entity, typically the highest order type.\n- `GMSFeatureTypeAdministrativeAreaLevel1` - A first-order civil entity below the country level. Within the United States, these administrative levels are states.\n- `GMSFeatureTypeAdministrativeAreaLevel2` --- A second-order civil entity below the country level. Within the United States, these administrative levels are counties.\n- `GMSFeatureTypeLocality` --- An incorporated city or town political entity.\n- `GMSFeatureTypePostalCode` --- A postal code, as used to address postal mail within the country.\n- `GMSFeatureTypeSchoolDistrict` --- A school district; includes unified, elementary, and secondary.\n\nAdministrative areas are represented on the map as feature layers; each type has\nits own layer. Feature layers are enabled per map style. You can choose which\nfeature layers to enable when setting up your map style in the\nGoogle Cloud console.\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 or show all the boundaries for a feature type.\n- Create a choropleth map.\n\n[Google boundaries coverage](/maps/documentation/ios-sdk/dds-boundaries/coverage) shows per-country availability of feature\ntypes."]]