Use personal Bing Map API Key?

I see it’s possible to Stream the Google 3D Tiles directly from Google Cloud services, but is it possible to stream terrain right from the Bing servers using a URL and Bing API key?

This is what the Google URL looks like: https://tile.googleapis.com/v1/3dtiles/root.json?key=YourKey

What would the Bing Maps URL looks like?

As far as I know, Bing does not provide terrain in a Cesium-supported format, such as 3D Tiles or quantized-mesh. So it’s not possible to do this directly.

But isn’t the main Cesium World Terrain + Bing Maps using the Bing 3D Tiles / Terrain? Or is Cesium converting it on their own servers or something? Another friends / cesium user mentioned they were able to plug their own Bing key into the Unreal Engine solution? Is that possible?

So it looks like the Microsoft Bing API has been transferred to Azure Maps. I found this Azure documentation on getting it working with CesiumJS. I would think there would be a way to get it working in Unity as well? Azure Maps Cesium JS plugin - Code Samples | Microsoft Learn

This Url is what CesiumJS is using: https://atlas.microsoft.com/map/tile?api-version=2.0&zoom={z}&x={x}&y={y}&tileSize=512

I wonder if there is a way to add the Azure Maps key to the query as to get it working in Unity?

Hi @5DRealities,

It’s possible to use Bing Maps directly, without going through Cesium ion. The trick is to use the CesiumBingMapsRasterOverlay, instead of the CesiumIonRasterOverlay.

However, Azure Maps is different. Supporting that shouldn’t be difficult (I haven’t tried), but would require some custom code (including C++ code) in the Cesium for Unity plugin. It’s not something that can work out of the box.

Ah, so simple lol. I didn’t see the CesiumBingMapsRasterOverlay… very cool! Works great!

Cesium might want to look into supporting the new Azure maps platform soon, as the Bing map API keys will fail to work in early 2025 according to their website. Perhaps add a CesiumAzureMapsRasterOverlay?

Hi Cesium team. The deadline for Bing Maps API expiring on June 30th is approaching fast. So the CesiumBingMapsRasterOverlay will become obsolete… I am hoping there are plans to support the new Azure Maps API? You might have many upset clients come that date if there is not another solution in place?

Hi @5DRealities,

We’re currently evaluating alternatives. We should have an update on this soon.

In the meantime, though, don’t worry about it disappearing suddenly. Because Cesium ion is an enterprise licensee of of Bing Maps, the deadline for us much longer (2028).

1 Like

You might want to follow this issue: Deprecate BingMapsImageryProvider/BingMapsGeocoderService · Issue #12064 · CesiumGS/cesium · GitHub

Thanks for the reply Kevin. We have offloaded our game map system to use the free basic account for Bing. Which is practically free. This is because we were approaching the 5000 Bing Map session limit in the commercial pricing plan of Cesium and there is no way my little company can afford to upgrade to the $500 / month premium plan. We are still going to need the CesiumBingMapsRasterOverlay solution to keep operating. Hopefully something can be added so I can plop in a personal Azure Maps key instead of the Bing Maps API key?

@5DRealities You should give this PR I’ve just created a try. It adds a CesiumUrlTemplateRasterOverlay component. In theory, you can take that https://atlas.microsoft.com/map/tile?api-version=2.0&zoom={z}&x={x}&y={y}&tileSize={width} URL and put it in a CesiumUrlTemplateRasterOverlay component, providing your access key in the Request Headers field, and use Azure Maps that way. Give it a go and let me know how it works out!

Oh cool. I will try to test this out here this weekend! Thank you for working on a solution. Seems like this should work :slight_smile:

Hi Azrogers,
I finally got around to implementing this and I can’t get this to work. I have set up the CesiumUrlTemplateRasterOverlay like stated and plugged in the request headers. I know the request header is correct because I can get a tile to download if I use this url: https://atlas.microsoft.com/map/tile?api-version=2024-04-01&tilesetId=microsoft.base&zoom=12&x=1203&y=1534&tileSize=256&subscription-key=mykey

So I don’t know if I a missing something? In the log window I just get a bunch of: “- Image response for https://atlas.microsoft.com/map/tile?api-version=2.0&tilesetId=microsoft.base&zoom=0&x=0&y=0&tileSize=256 is empty.”

All with zoom “0” for zoom, x, y.

Ok, Actually got it to work with no errors, but I am seeing water / blue instead of the terrain I supposed to see. The URL I am using is: https://atlas.microsoft.com/map/tile?api-version=2024-04-01&tilesetId=microsoft.base.road&zoom={z}&x={x}&y={y}&tileSize={width}

Any idea why? Seems like it’s not querying the correct area on the globe?

Hi @5DRealities,
Try replacing {y} with {reverseY}. We just found a bug in our documentation:

Ah yes, this works! Thanks Kevin.

So I have a question about Azure Maps pricing. Has anyone experimented with this or can understand it? Just for an hour of testing I have used 10’s of thousands of requests as seen in the image I posted… Is this normal? So it appears this is going to be very expensive if I put this into production. Where I have 100’s of weekly users. I am easily going to surpass 500k transactions. Probably within the first week. Has anyone gone to production with Azure Maps yet and have an estimate on costs?

It appears $4.50 for every 1000 transactions? Seems really expensive compared to previous Bing Maps API. But then it says 15 tiles = 1 transaction? I can’t find any metric that just gives me how many transactions I have used… According to this it looks like I am going to get billed between 10 - 80$ just for testing? Although it hasn’t showed up in the billing portal yet. So confused.