데이터 세트를 위한 데이터 기반 스타일 지정에는 지도 ID가 필요합니다. 지도 ID가 누락되었거나 잘못된 지도 ID가 전달된 경우 데이터 세트의 데이터 기반 스타일을 로드할 수 없습니다. 문제 해결 단계로 MapCapabilities를 사용하여 데이터 세트를 위한 데이터 기반 스타일 지정이 지원되는지 확인할 수 있습니다.
Kotlin
valcapabilities:MapCapabilities=googleMap.getMapCapabilities()System.out.println("Data-driven Styling is available: "+capabilities.isDataDrivenStylingAvailable())
Java
MapCapabilitiescapabilities=googleMap.getMapCapabilities();System.out.println("Data-driven Styling is available: "+capabilities.isDataDrivenStylingAvailable());
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eTo utilize data-driven styling for datasets, you'll need a Cloud project with billing enabled, the Maps SDK for Android, and the Maps Datasets API enabled.\u003c/p\u003e\n"],["\u003cp\u003eEnsure your app uses the upgraded map renderer (available since version 18.0.0 of the Maps SDK for Android) to support data-driven styling, rebuilding the app if necessary.\u003c/p\u003e\n"],["\u003cp\u003eYou'll need to create a map ID associated with a new map style, then update your map initialization code to include this map ID.\u003c/p\u003e\n"],["\u003cp\u003eBefore applying data-driven styling, it's crucial to check for map capabilities at runtime using \u003ccode\u003eMapCapabilities\u003c/code\u003e and provide fallback options for unsupported devices.\u003c/p\u003e\n"],["\u003cp\u003eData-driven styling requires a valid map ID; if missing or invalid, the styling will fail to load.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/maps/documentation/android-sdk/dds-datasets/start \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/dds-datasets/start \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/dds-datasets/start \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\nFollow these steps to get set up with data-driven styling for datasets.\n\nGet an API key and enable APIs\n\nBefore using data-driven styling for datasets, you need:\nCloud project with a billing account, and both the\nMaps SDK for Android and the Maps Datasets API\nenabled. To learn more, see:\n\n- [Set up your Google Cloud project](/maps/documentation/android-sdk/cloud-setup)\n\n- [Enable Maps SDK for Android and get an API key](/maps/documentation/android-sdk/get-api-key)\n\n- [Enable the Maps Datasets API](https://console.cloud.google.com/apis/library/mapsplatformdatasets.googleapis.com)\n\nEnable the new maps renderer\n\nAn upgraded map renderer is available as of version 18.0.0 of the\nMaps SDK for Android. This renderer brings many improvements, including\nsupport for Cloud-based maps styling, to Maps SDK for Android.\n\nWith the release of version 18.2.0 of the Maps SDK for Android, Google switched the\ndefault renderer from the legacy renderer to the upgraded map renderer. This\nchange means that the upgraded map renderer is now used by default in your app\nwhen you build a new app or rebuild an existing app.\n| **Caution:** To use data-driven styling for datasets in your app, your app must be built using the upgraded map renderer. If you are adding data-driven styling for datasets to an existing app, rebuild the app to use the upgraded map renderer. For more information, see [New Map Renderer](/maps/documentation/android-sdk/renderer).\n\nCreate a map ID\n\nTo create a new map ID, follow the steps at\n[Create a map ID](/maps/documentation/get-map-id#create-a-map-id). Be sure to\nset the Map type to **Android**.\n\nCreate a new map style\n\nTo create a new map style, follow the instructions in\n[Create and use map styles](/maps/documentation/android-sdk/cloud-customization/map-styles)\nto create the style, and\n[associate the style with the map ID you just created](/maps/documentation/android-sdk/cloud-customization/map-styles#associate-style-with-map-id).\n\nUpdate your map initialization code\n\nThis step requires the map ID you just created. It can be found on your\n[Maps Management](https://console.cloud.google.com/google/maps-apis/studio/maps) page.\n\nTo add the map ID to your initialization code, see\n[Add the map ID to your app](/maps/documentation/get-map-id#add-a-map-id-to-your-app).\n\nCheck map capabilities (required)\n\nData-driven styling for datasets requires a map ID. If the map ID is missing, or an\ninvalid map ID is passed, data-driven styling for datasets cannot load. As a\ntroubleshooting step, you can use\n[`MapCapabilities`](/android/reference/com/google/android/gms/maps/model/MapCapabilities)\nto check if data-driven styling for datasets is supported.\n| **Caution:** Some devices might not support the new map renderer and therefore cannot display data-driven styling for datasets. You must use `MapCapabilities` to check for support at runtime. If data-driven styling for datasets is not supported, define a fallback option. For device requirements for the new map renderer, see [Supported\ndevices](/maps/documentation/android-sdk/renderer#supported-devices). \n\nKotlin\n\n\n```java\nval capabilities: MapCapabilities = googleMap.getMapCapabilities()\nSystem.out.println(\"Data-driven Styling is available: \" + capabilities.isDataDrivenStylingAvailable())\n```\n\n\u003cbr /\u003e\n\nJava\n\n\n```java\nMapCapabilities capabilities = googleMap.getMapCapabilities();\nSystem.out.println(\"Data-driven Styling is available: \" + capabilities.isDataDrivenStylingAvailable());\n```\n\n\u003cbr /\u003e\n\nNext steps\n\n- [Create and manage a dataset](/maps/documentation/android-sdk/dds-datasets/create-dataset)"]]