Стилизация границ на основе данных позволяет вам получать доступ к полигонам Google для административных границ, применять стили к полигонам границ и отображать их на ваших картах.
Стилизация границ на основе данных позволяет выбирать регионы по идентификатору места и применять индивидуальный стиль к полигонам границ на карте. Каждый тип объекта представляет собой тип региона; вы выбираете, какие типы объектов включить, при настройке стиля карты. Ознакомьтесь с охватом границ Google , чтобы узнать о охвате границ каждой страны.
Типы объектов
Стилизация на основе данных обеспечивает доступ к границам Google для типов объектов, представляющих административные районы. Административные районы классифицируются по функциям, например, страна, штат, населённый пункт и почтовый индекс. Типы объектов организованы по административному уровню, структура которого различается в зависимости от страны. К ним относятся:
GMSFeatureTypeCountry — национальная политическая единица, обычно тип высшего порядка.
GMSFeatureTypeAdministrativeAreaLevel1 — гражданская единица первого порядка, ниже уровня страны. В Соединённых Штатах такими административными уровнями являются штаты.
GMSFeatureTypeAdministrativeAreaLevel2 — административно-территориальная единица второго порядка, ниже уровня страны. В Соединенных Штатах административными единицами такого уровня являются округа.
GMSFeatureTypeLocality — город или поселок городского типа.
GMSFeatureTypePostalCode — почтовый индекс, используемый для адресации почтовых отправлений внутри страны.
GMSFeatureTypeSchoolDistrict — школьный округ; включает объединенную, начальную и среднюю школу.
Административные районы представлены на карте в виде слоёв объектов; каждому типу соответствует свой слой. Слои объектов включаются для каждого стиля карты. Вы можете выбрать, какие слои объектов включить, при настройке стиля карты в консоли Google Cloud.
Стиль граничных полигонов
Вы можете применять стили к граничным полигонам для заливки (цвет, непрозрачность) и обводки (цвет, непрозрачность, толщина обводки). Используйте стили, чтобы:
Определите стиль граничного полигона или покажите все границы для типа объекта.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-23 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."]]