science Sản phẩm hoặc tính năng này đang ở giai đoạn ra mắt thử nghiệm trước giai đoạn phát hành rộng rãi (trước giai đoạn phát hành rộng rãi). Những sản phẩm và tính năng trước giai đoạn phát hành rộng rãi có thể được hỗ trợ hạn chế. Đồng thời, những thay đổi đối với những sản phẩm và tính năng trước giai đoạn phát hành rộng rãi có thể không tương thích với những phiên bản trước giai đoạn phát hành rộng rãi khác. Các Sản phẩm trước giai đoạn phát hành rộng rãi chịu sự điều chỉnh của Điều khoản dịch vụ dành riêng cho Nền tảng Google Maps. Để biết thêm thông tin, hãy xem nội dung mô tả về giai đoạn ra mắt.
Sử dụng Map Management API (API Quản lý bản đồ) để liên kết tập dữ liệu với mã kiểu.
Sử dụng mã nhận dạng bản đồ trong một ứng dụng (JS, iOS hoặc Android) và sử dụng API định kiểu dựa trên dữ liệu để định kiểu các đối tượng trong tập dữ liệu.
Loại
DatasetStyleAssociation
Loại: Đối tượng/Proto
Đóng gói mối quan hệ giữa một tập dữ liệu hiện có và một ClientStyle hiện có.
messageDatasetStyleAssociation{option(google.api.resource)={type:"mapstyling.googleapis.com/DatasetStyleAssociation"pattern:"projects/{project}/datasets/{dataset}/clientStyles/{client_style}"plural:"datasetStyleAssociations",singular:"datasetStyleAssociation"};// Resource name.// projects/{project}/datasets/{dataset}/clientStyles/{client_style}stringname=1;// The resource name of the style.// projects/{project}/clientStyles/{client_style}stringclient_style=2;
PERMISSION_DENIED : Những lỗi này luôn nêu chi tiết về việc quyền truy cập vào tài nguyên bị từ chối. Ví dụ: khi API không được bật cho dự án đã cung cấp.
ALREADY_EXISTS: Được kích hoạt bằng lệnh gọi Tạo khi DatasetStyleAssociation đã tồn tại.
NOT_FOUND: Được kích hoạt bởi bất kỳ phương thức nào ở trên khi có nỗ lực truy cập vào một tài nguyên không tồn tại, chẳng hạn như Kiểu, Tập dữ liệu hoặc Dự án.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-09-05 UTC."],[],[],null,["# Map Management API Guide and Examples\n\nThe Map Management API lets you manage your cloud-based maps styling\nresources using RESTful APIs.\n\nSummary of steps\n----------------\n\n1. Use the Cloud console to [create a map\n ID](/maps/documentation/javascript/cloud-customization/tut#tut2) (limited to JavaScript vector-based maps).\n2. Use the Cloud console to [create a map\n style](/maps/documentation/javascript/cloud-customization/map-styles). A map style is used as the link between a map ID and a dataset.\n3. Use either the Cloud Console or the Maps Datasets API to [create a\n dataset](/maps/documentation/javascript/dds-datasets/create-dataset).\n4. Use the Map Management API to associate the dataset with the style ID.\n5. Use the map ID in an application (JS, iOS, or Android) and use the data-driven styling API to style dataset features.\n\nTypes\n-----\n\n### DatasetStyleAssociation\n\nType: Object/Proto\n\nEncapsulates the relationship between an existing dataset and an existing Client\nStyle. \n\n message DatasetStyleAssociation {\n option (google.api.resource) = {\n type: \"mapstyling.googleapis.com/DatasetStyleAssociation\"\n pattern: \"projects/{project}/datasets/{dataset}/clientStyles/{client_style}\"\n plural: \"datasetStyleAssociations\",\n singular: \"datasetStyleAssociation\"\n };\n\n // Resource name.\n // projects/{project}/datasets/{dataset}/clientStyles/{client_style}\n string name = 1;\n\n // The resource name of the style.\n // projects/{project}/clientStyles/{client_style}\n string client_style = 2;\n\nMethods\n-------\n\n### CreateDatasetStyleAssociation\n\n rpc CreateDatasetStyleAssociation(CreateDatasetStyleAssociationRequest)\n returns (DatasetStyleAssociation) {\n option (google.api.http) = {\n post: \"/v1/{parent=projects/*/datasets/*}\"\n body: \"dataset_style_association\"\n };\n option (google.api.method_signature) = parent,dataset_style_association\";\n }\n\n### ListDatasetStyleAssociations\n\n rpc ListDatasetStyleAssociations(ListDatasetStyleAssociationsRequest)\n returns (ListDatasetStyleAssociationsResponse) {\n option (google.api.http) = {\n get: \"/v1/{parent=projects/*/datasets/*}\"\n };\n option (google.api.method_signature) = \"parent\";\n }\n\n### DeleteDatasetStyleAssociation\n\n rpc DeleteDatasetStyleAssociation(DeleteDatasetStyleAssociationRequest)\n returns (google.protobuf.Empty) {\n option (google.api.http) = {\n post: \"/v1/{name=projects/*/datasets/*/clientStyles/*}:delete\"\n body: \"*\"\n };\n option (google.api.method_signature) = \"name\";\n }\n\nExample C++ calls\n-----------------\n\n### Sample Call to Create Endpoint\n\n \u003cpre\u003ecurl --http2 -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer \u003cToken\u003e' https://mapmanagement.googleapis.com/v1/projects/\u003cProject_Number\u003e/datasets/{dataset_id} -d '{name: \"projects/{project_number}/datasets/{dataset_id}/clientStyles/{style_id}\", client_style: \"projects/{project_number}/clientStyles/{style_id}\" }'\u003c/pre\u003e\n\n### Sample Call to List Endpoint\n\n \u003cpre\u003ecurl --http2 -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer \u003cToken\u003e' https://mapmanagement.googleapis.com/v1/projects/\u003cProject_Number\u003e/datasets/-\u003c/pre\u003e\n\n### Sample Call to List Associated Maps\n\n \u003cpre\u003ecurl --http2 -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer \u003cToken\u003e' https://mapmanagement.googleapis.com/v1/projects/\u003cProject_Number\u003e/datasets/\u003cdataset-id\u003e/clientStyles/\u003cstyle_id\u003e:listAssociatedMaps\u003c/pre\u003e\n\n### Sample Call to Delete Endpoint\n\n \u003cpre\u003ecurl --http2 -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer \u003cToken\u003e' https://mapmanagement.googleapis.com/v1/projects/\u003cProject_Number\u003e/datasets/\u003cdataset_id\u003e/clientStyles/\u003cstyle_id\u003e:delete -d '{\"map_ids\": [\"map-id-1\", \"map-id-2\"]}'\u003c/pre\u003e\n\nErrors\n------\n\n- PERMISSION_DENIED : These errors always detail what resource access is\n denied. For example, when the API is not enabled for the supplied project.\n\n- ALREADY_EXISTS: Triggered by a Create call when the DatasetStyleAssociation\n already exists.\n\n- NOT_FOUND: Triggered by any of the above methods when an attempt is made to\n access a resource that does not exist, such as a Style, Dataset, or Project.\n\n- INVALID_ARGUMENT: Request is malformed."]]