-
Notifications
You must be signed in to change notification settings - Fork 360
Description
For two months, Google Maps 2D tiles have also been available in Cesium by default next to Bing maps (https://cesium.com/blog/2025/10/02/introducing-google-maps-2d-tiles/). When I wanted to use the CesiumIonOverlay with the Bing maps imagery, I always got an error, but didn't investigate it further. Now, since I wanted to test the Google Maps 2D tiles, I tested it again, but the error remains.
Now, I had a closer look. I'm basically try to use the Quantized Mesh with Overlays example just with another overlay.
baseOverlay = new CesiumIonOverlay( {
assetId: '3830184',
apiToken: import.meta.env.VITE_ION_KEY,
} );However, the error is thrown within TMSImageSource.init. But main issue is in CesiumIonOverlay.init with following line:
this.imageSource.url = json.url;Looking at the endpoint requests, following data is returned:
{
"type": "IMAGERY",
"externalType": "BING",
"options": {
"url": "https://dev.virtualearth.net",
"mapStyle": "Aerial",
"key": "cesium_provided_access_key"
},
"attributions": [ ... ]
}{
"type": "IMAGERY",
"externalType": "GOOGLE_2D_MAPS",
"options": {
"url": "https://assets.ion.cesium.com/proxy/3830184",
"imageFormat": "png",
"tileWidth": 256,
"tileHeight": 256,
"session": "cesium_provided_session_key",
"key": "cesium_provided_access_key"
},
"attributions": [ ... ]
}So, json.url is obviously not defined. But also this.imageSource.url = json.url ?? json.options?.url; or similar doesn't help either. Actually, each provider would require a special handling: these requests need to be sent with the provided access and session keys, url format may be different, etc. For Google Maps, the CesiumIonOverlay would probably need to use the GoogleCloudAuth class (maybe not needed if session key is already provided). Instead of TMSImageSource, it would need XYZImageSource. And so on.
So, I'm not sure if this is possible to support these different imagery providers via Cesium. I can also make a PR, if you want.