總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
使用資料集資料導向樣式,即可上傳自己的地理空間資料集、為資料地圖項目套用自訂樣式,以及在地圖上顯示這些資料地圖項目。此外,您還可藉由點、折線和多邊形幾何圖形,以視覺化的方式呈現資料,並讓資料地圖項目回應點擊事件。資料集資料導向樣式僅適用於向量地圖 (必須提供地圖 ID)。
開始使用資料集資料導向樣式
新增自訂地理空間資料集
您可以使用 Google Cloud 控制台或 Google Cloud Shell 新增自訂資料。每個資料集都有專屬 ID,可與地圖樣式建立關聯。支援的資料格式如下:
如要進一步瞭解資料集的相關規定和限制,請參閱「建立及管理資料集」一文
關於公開資料集
如要設定資料集樣式,您必須將地圖樣式與地圖 ID 建立關聯,這也會將資料集與地圖 ID 建立關聯。在應用程式中,開發人員可以參照該地圖 ID,以及與其相關聯的任何地圖樣式和地理空間資料。系統不會對地理空間資料套用任何額外的存取權控管,因此應用程式的使用者都能存取地理空間資料。
設定資料地圖項目樣式
上傳自訂資料並與地圖樣式和地圖 ID 建立關聯後,您就可以設定資料地圖項目的樣式來營造視覺效果,以及讓地圖項目回應點擊事件。
設定點資料的樣式,在地圖上顯示特定位置。
設定折線資料的樣式,凸顯地貌。
設定多邊形資料的樣式,凸顯地理區域。
新增事件監聽器,讓資料地圖項目回應點擊事件。
如果應用程式要算繪大量資料特徵,您可能會發現效能問題。舉例來說,在縮放或旋轉時,應用程式可能會出現效能延遲或穩定性問題。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[[["\u003cp\u003eData-driven styling allows you to upload, style, and display custom geospatial datasets (GeoJSON, CSV, KML) on vector maps using Google Maps Platform.\u003c/p\u003e\n"],["\u003cp\u003eDatasets are associated with map styles and IDs, enabling data visualization and interactivity based on point, polyline, and polygon geometries.\u003c/p\u003e\n"],["\u003cp\u003ePublic datasets, when linked to a map ID, become accessible to anyone with the app using that ID, requiring awareness regarding data sensitivity.\u003c/p\u003e\n"],["\u003cp\u003eData features can be styled for visual impact and interactivity, such as highlighting locations, geographical features, areas, and responding to click events.\u003c/p\u003e\n"],["\u003cp\u003eRendering a large number of data features might impact app performance, potentially causing lag or stability issues during zoom or rotate operations.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/maps/documentation/android-sdk/dds-datasets/overview \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/dds-datasets/overview \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/dds-datasets/overview \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\nData-driven styling for datasets lets you upload your own geospatial datasets,\napply custom styling to their data features, and display those data features on\nmaps. With data-driven styling for datasets, you can create data visualizations\nbased on point, polyline, and polygon geometries, and make data features respond\nto click events. Data-driven styling for datasets is supported on vector maps\nonly (a map ID is required).\n\n[Get started with data-driven styling for datasets](/maps/documentation/android-sdk/dds-datasets/start)\n\nAdd custom geospatial datasets\n\nAdd your custom data using Google Cloud Console or Google Cloud\nShell. Each dataset has a unique ID, which you can associate with a map style.\nThe following data formats are supported:\n\n- GeoJSON\n- Comma-separated (CSV)\n- KML\n\nFor details about dataset requirements and limitations, see\n[Create and manage a dataset](/maps/documentation/android-sdk/dds-datasets/create-dataset#dataset-prerequisites)\n\nAbout public datasets\n\nIn order to style a dataset you must associate a map style with a map ID, which\nalso associates the dataset to the map ID. In an app, developers can reference\nthat map ID, and any map style and geospatial data associated with it. No\nadditional access control is applied to the geospatial data, making the\ngeospatial data effectively publicly available to anyone with the app.\n\nStyle data features\n\nOnce your custom data has been uploaded and associated to a map\nstyle and map ID, you can style data features for visual impact, and make\nfeatures respond to click events.\n\nStyle point data to show specific locations on the map.\n\nStyle polyline data to highlight geographical features.\n\nStyle polygon data to highlight geographical areas.\n\nMake data features respond to click events by adding an event\nlistener.\n\nPerformance when rendering a large number of data features\n\nWhen rendering a large number of data features, you might notice performance\nissues in your app. For example, you might notice a performance lag or stability\nissues with the app during a zoom or rotate."]]