使用自己的 3D 資訊方塊轉譯器
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如果無法將第三方算繪產品併入解決方案,可能就必須自行建立 3D Tiles 算繪器。這種做法需要考慮下列重要因素:
內容網址
提供擬真 3D 圖塊時,Map Tiles API 會傳回子圖塊集的 URI。這些圖塊集 URI 並非一般網址,只包含路徑和參數元件。這些範例不含 API 金鑰,而這是授權要求時的必要條件。詳情請參閱 3D Tiles 規格。
要求與回應
以下是擬真成像 3D 圖塊的要求和回應範例。您可以使用 Chrome 開發人員工具檢查這些元素。
根圖塊集要求範例:
https://tile.googleapis.com/v1/3dtiles/root.json?key=YOUR_API_KEY
圖塊集回應 URI 範例:
/v1/3dtiles/datasets/CgA/files/UlRPVEYuYnVs.json?session=CIqhrPOFvdHSYg
轉譯器使用的圖塊要求網址範例:
https://tile.googleapis.com/v1/3dtiles/datasets/CgA/files/UlRPVEYuYnVs.json?session=CIqhrPOFvdHSYg&key=YOUR_API_KEY
https://tile.googleapis.com/v1/3dtiles/datasets/CgA/files/UlRPVEYubm9k.glb?session=CIqhrPOFvdHSYg&key=YOUR_API_KEY
建構後續的圖塊要求時,應一併附加圖塊集 URI 中顯示的所有參數和 API 金鑰。3D Tiles API 提供下列兩個參數:
session
- 3D 載入工作階段的內建 ID。這項值是由 API 自動產生。建構後續的圖塊要求時,必須由算繪器附加。
key
- 用來存取 3D 圖塊服務的 API 金鑰。您必須將其附加至所有後續的圖塊要求。
顯示出處資訊
出處註明是指標示地圖圖塊的來源,是使用這項 API 的必要條件,包括 Google 品牌出處註明 (標誌) 和資料出處註明。您可以在「Map Tiles API 政策」頁面找到 Google 標誌。每個圖塊回應都會傳回資料歸因資訊。在 glTF 圖塊中尋找,位於 asset
和 copyright
下方。
{
"asset": {
"version": "2.0",
"generator": "draco_decoder",
"copyright": "Data SIO, NOAA, U.S. Navy, NGA, GEBCO;Landsat / Copernicus"
}
}
您必須匯總、排序並顯示這項資訊,通常會顯示在算繪內容底部的文字行。這需要執行下列步驟:
從所有可見圖塊中擷取所有著作權資訊。
如有多個著作權來源,請以半形分號分隔。
根據發生次數排序資訊。
在畫面上顯示著作權來源,並依出現次數排序,從最多到最少,類似於 Google 地球 的做法。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[[["\u003cp\u003eWhen building your own renderer for Photorealistic 3D Tiles, you need to handle content URLs, requests, and responses, and display attributions correctly.\u003c/p\u003e\n"],["\u003cp\u003eContent URLs for tilesets returned by the API are relative and require your API key to be added for subsequent requests.\u003c/p\u003e\n"],["\u003cp\u003eRequests for tiles must include both your API key and a session parameter provided in the initial tileset response.\u003c/p\u003e\n"],["\u003cp\u003eData attribution information is included in each tile's \u003ccode\u003easset.copyright\u003c/code\u003e property within the glTF and must be aggregated, sorted, and displayed appropriately in your application.\u003c/p\u003e\n"],["\u003cp\u003eYou are required to display both the Google logo and aggregated data attributions, similar to how Google Earth displays them, for compliance with API usage policies.\u003c/p\u003e\n"]]],[],null,["# Work with your own 3D Tiles renderer\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google\n| Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. [Learn more](/maps/comms/eea/faq). In addition, certain content from the Map Tiles API will no longer be returned. [Learn more](/maps/comms/eea/map-tiles).\n\nIf you're not able to incorporate a third-party rendering product into your\nsolution, then you might have to create your own 3D Tiles renderer. This\napproach requires that you consider the following important factors:\n\n- [Content URLs](#content_urls)\n- [Requests and responses](#requests-and-responses)\n- [Display data attributions](#display-attributions)\n\nContent URLs\n------------\n\nWhen serving Photorealistic 3D Tiles, the Map Tiles API returns URIs for\nchildren tilesets. These tileset URIs are not regular URLs. They include only\nthe path and parameters component. They don't contain your API key, which is\nrequired to authorize your request. For more information, see the\n[3D Tiles Specification](https://docs.opengeospatial.org/cs/18-053r2/18-053r2.html#23).\n\nRequests and responses\n----------------------\n\nHere are some examples of Photorealistic 3D Tiles requests and responses. You\ninspect them by using the Chrome Developer Tools.\n\nSample root tileset request: \n\n https://tile.googleapis.com/v1/3dtiles/root.json?key=YOUR_API_KEY\n\nSample tileset response URI: \n\n /v1/3dtiles/datasets/CgA/files/UlRPVEYuYnVs.json?session=CIqhrPOFvdHSYg\n\nSample tile request URLs used by renderers: \n\n https://tile.googleapis.com/v1/3dtiles/datasets/CgA/files/UlRPVEYuYnVs.json?session=CIqhrPOFvdHSYg&key=YOUR_API_KEY\n\n https://tile.googleapis.com/v1/3dtiles/datasets/CgA/files/UlRPVEYubm9k.glb?session=CIqhrPOFvdHSYg&key=YOUR_API_KEY\n\nYou should attach any parameters that appear in the tileset URI, together with\nyour API key, when you construct the subsequent tile requests. The 3D Tiles API\nprovides the following two parameters:\n\n`session`\n: A built-in identifier for a 3D loading session. It's automatically generated\n by the API. It must be attached by the renderer when constructing the subsequent\n tile requests.\n\n`key`\n: The API key that you used to access 3D Tiles service. You must attach it to\n all subsequent tile requests.\n\nDisplay attributions\n--------------------\n\nAttribution means acknowledging the source of map tiles and is a requirement for\nuse of this API - this includes the Google brand attribution (logo) as well as\ndata attribution. The Google logo is available to you on the\n[Map Tiles API Policies](/maps/documentation/tile/policies) page. Data\nattribution information is returned in every tile response. Look for it in the\n[glTF tile](https://github.com/KhronosGroup/glTF), under\n`asset`, `copyright`. \n\n {\n \"asset\": {\n \"version\": \"2.0\",\n \"generator\": \"draco_decoder\",\n \"copyright\": \"Data SIO, NOAA, U.S. Navy, NGA, GEBCO;Landsat / Copernicus\"\n }\n }\n\nYou must aggregate, sort, and display this information on a line of text,\nusually at the bottom of the rendering. This entails the following steps:\n\n1. Extract all of the copyright information from all of the tiles in view.\n\n2. Separate multiple copyright sources with a semicolon.\n\n3. Sort the information based on the number of occurrences.\n\n4. Display the copyright sources on-screen, ordered from most occurrences to the\n least, similar to the way\n [Google Earth](https://earth.google.com)\n does it."]]