Google Map Tiles API Key required?

Hi,
We have been testing a sample integration of Cesium ION though the Rest API to access and load 3D Tiles as a visual context to a modelling application. Our implementation uses a valid “access token” and requests certain options from the user to determine which tile set to load. We’ve been having issues with authentication when trying to access Google Photorealistic 3D Tiles. Embedded content uri, under the root>children, already contains the session key.
Can I please request for a description of the necessary steps?
Thanks

Hi,

Can you please share the code for the request you are making to the Cesium ion REST API for the google tileset

Thanks,
Ankit

Hi, Thanks for the reply.
Based on the Rest API documentation: Ion REST API documentation – Cesium and having enabled access to all assets for the specific token, I follow:

// Step 1: Get the list of assets
assetsEndpoint = “https://api.cesium.com/v1/assets?access_token={token}
assetsResponse = GET(assetsEndpoint)

// Step 2: Get the asset endpoint
assetId = “{assetId}” // Replace with your asset ID
assetEndpoint = “https://api.cesium.com/v1/assets/” + assetId + “/endpoint?access_token={token}”
assetResponse = GET(assetEndpoint)

// Step 3: Retrieve the tileset URL
tilesetUrl = assetResponse.options.url
tilesetResponse = GET(tilesetUrl) // No token needed here as URL already contains API key

// Step 4: Fetch tile geometry data (if required)
tileGeometryUrl = tilesetResponse.root.content.uri // Parse from the tileset JSON
tileGeometryResponse = GET(“https://tile.googleapis.com”+tileGeometryUrl)

I get an “Unathorised” error.

Thanks,
P

Hi,

Thank you for providing me with the API logic. Looks like you are getting the intended response from Cesium ion i.e the access token and are able to load the entrypoint json file from Google.

Could you please describe more about your use case for directly trying to access tiles. With our viewers, providing the entrypoint URL should allow you to render Google’s Photorealisitc 3D Tiles since they handle the traversal for you.

The unauthorized error seems to be happening when you are trying to load a Google tile directly. Since Google’s data is stored and managed by them, I would suggest reaching out to them directly: 도움말 보기 및 지원 받기  |  Google Maps Platform Support Services  |  Google for Developers

Thanks,
Ankit

Hi,

I understand that Google manages the tile data, but my use case involves using the Cesium REST API approach to filter, load and render tiles, including the photorealistic 3D tiles provided by Google within the Cesium response based on user options.

Our development is targeting a 3d modelling application capable of loading and rendering gltf (amongst others) files, hence the integration with Cesium Native feels an overkill. Specifically, I am questioning how the entrypoint URL (obtained from Cesium ion) integrates with Google’s tiles, given that accessing a specific tile directly results in an unauthorized error.

Could you clarify:

  1. How Cesium’s REST API approach is expected to handle tile traversal and authentication for Google’s tiles? and if we are required to generate and use a dedicated Google developer access token, in addition to the cesium access token.
  2. If the entrypoint URL alone is sufficient for rendering the tiles in a custom implementation (e.g., without the Cesium viewers), how does it handle requests for individual tiles internally?

Thanks
P

Hi,

  1. How Cesium’s REST API approach is expected to handle tile traversal and authentication for Google’s tiles? and if we are required to generate and use a dedicated Google developer access token, in addition to the cesium access token.

With our REST API, you shouldn’t need an additional Google token to access the Photorealistic 3D Tiles in most cases. For custom viewer implementations, I can check that and get back to you on it

  1. If the entrypoint URL alone is sufficient for rendering the tiles in a custom implementation (e.g., without the Cesium viewers), how does it handle requests for individual tiles internally?

I apologize for any confusion caused here. I meant to say that the entrypoint URL should be enough with our viewers. For custom implementations, the traversal would have to be implemented by the viewing engine. I have looped in the Cesium Native team to this thread since they can describe how the traversal works better.

Hi,
Thanks for the reply!

Would be good to get some additional info or guidance around the use of external tilesets when utilising the Cesium Rest API, since there is currently no mention of any additional steps for token management or traversal requirements.

To reiterate, our development is a custom viewer implementation, with the ambition to create a loading and rendering pipeline for most of the tilesets/databases available in Cesium.

Any help would be greatly appreciated!

P

Hi @ParisN_fpDev,

Most likely what you’re missing is that you need to make sure you include the key=[...] parameter that was returned in the root.json URL in the asset/[assetId]/endpoint in addition to the session=[...] parameter that is included the tile URL found inside the root.json.

This is admittedly weird. Relative URL resolution usually doesn’t propagate query parameters like this. However, the Google API requires it, or you’ll get access denied errors.

When in doubt, take a look at CesiumJS’s Google Photorealistic 3D Tiles Sandcastle example and use your browser’s DevTools Network tab to inspect the pattern of requests it’s making.

1 Like