Work with your own 3D Tiles renderer

If you're not able to incorporate a third-party rendering product into your solution, then you might have to create your own 3D Tiles renderer. This approach requires that you consider the following important factors:

Content URLs

When serving Photorealistic 3D Tiles, the Map Tiles API returns URIs for children tilesets. These tileset URIs are not regular URLs. They include only the path and parameters component. They don't contain your API key, which is required to authorize your request. For more information, see the 3D Tiles Specification.

Requests and responses

Here are some examples of Photorealistic 3D Tiles requests and responses. You inspect them by using the Chrome Developer Tools.

Sample root tileset request:

https://tile.googleapis.com/v1/3dtiles/root.json?key=YOUR_API_KEY

Sample tileset response URI:

 /v1/3dtiles/datasets/CgA/files/UlRPVEYuYnVs.json?session=CIqhrPOFvdHSYg

Sample tile request URLs used by renderers:

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

You should attach any parameters that appear in the tileset URI, together with your API key, when you construct the subsequent tile requests. The 3D Tiles API provides the following two parameters:

session
A built-in identifier for a 3D loading session. It's automatically generated by the API. It must be attached by the renderer when constructing the subsequent tile requests.
key
The API key that you used to access 3D Tiles service. You must attach it to all subsequent tile requests.

Display attributions

Attribution means acknowledging the source of map tiles and is a requirement for use of this API - this includes the Google brand attribution (logo) as well as data attribution. The Google logo is available to you on the Map Tiles API Policies page. Data attribution information is returned in every tile response. Look for it in the glTF tile, under asset, copyright.

{
  "asset": {
    "version": "2.0",
    "generator": "draco_decoder",
    "copyright": "Data SIO, NOAA, U.S. Navy, NGA, GEBCO;Landsat / Copernicus"
  }
}

You must aggregate, sort, and display this information on a line of text, usually at the bottom of the rendering. This entails the following steps:

  1. Extract all of the copyright information from all of the tiles in view.

  2. Separate multiple copyright sources with a semicolon.

  3. Sort the information based on the number of occurrences.

  4. Display the copyright sources on-screen, ordered from most occurrences to the least, similar to the way Google Earth does it.