CesiumGS / cesium-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google-compatible token refresh

kring opened this issue · comments

The Google Photorealistic 3D Tiles documentation page (https://developers.google.com/maps/documentation/tile/3d-tiles) says:

The render can make at least three hours of tile requests from a single root tileset request. After reaching this limit, you must make another root tileset request.

cesium-native should handle this possibility.

Currently, when we see a 403 for a tile in a tileset from Cesium ion, we will re-request the Cesium ion asset/endpoint service and adopt the new key that it returns. But this won't help with the Google tileset, because the asset/endpoint doesn't contain a key of that type. Instead, the key is embedded in the root tileset.json URL, and we have to request that in order to get a new session.

Furthermore, it's possible to load the Google tiles directly from Google rather than going through Cesium ion, and in that case no attempt will be made to refresh the session at all.

So we should investigate our options for handling the need to refresh Google sessions. Ideally, the solution would be generally applicable to tilesets from other providers, too, and wouldn't need to encode any Google-specific logic. One option, for example, is to do a full tileset refresh (unload everything and start over) whenever we see a 403 and its either not a Cesium ion tileset, or the normal Cesium ion token refresh procedure doesn't work. But there are probably better options.