Loading Mapbox Studio styles in Cesium

Hi,

Is there any possibility to get maps created in Mapbox Studio (not Classic) as an imagery provider? Maps created with Mapbox Studio do not get a map id, but they have style url's.

Am I correct in assuming that currently the only way is to use a WMTS service? In Mapbox, this feature is only available for paying plans. If this is the only way, I'm sure the client is willing to pay, but since we're still in the research phase, I thought I'd check if there may be another way.

Thanks!

Hello,

I’m guessing adding the map via the WMTS service would be the way to go. Cesium expects the imagery to be tiled.

We have an issue open to update our MapboxImageryProvider to use styles here: https://github.com/AnalyticalGraphicsInc/cesium/issues/4015

In the meantime, you should be able to use a UrlTemplateImageryProvider to add the imagery to the globe.

Best,

Hannah

Fantastic, thank you. UrlTemplateImageryProvider made it work.

Do you happen to know how this reflects to map views in Mapbox? I can imagine tiling a globe would count for a lot of views.

I’m not sure how Mapbox tracks views, but Cesium does need to load a number of tiles to cover the surface, particularly for tilted views.

You can use this code to see the boundaries of the tiles needed for particular views:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {
baseLayerPicker : false,
imageryProvider: new Cesium.TileCoordinatesImageryProvider()
});

``

We’ve been working on reducing the number of tiles by adding features like fog, and it’s on our roadmap to improve this more in the future

-Hannah

I checked, and on https://www.mapbox.com/help/define-map-view/ it says that 4 tiles constitutes a single map view. For the bit of testing I did this morning, I already have 350 views. We are definitely going for a paid Mapbox plan, but even with the Standard plan (https://www.mapbox.com/pricing/), I think we'll hit the views ceiling quite fast when the site goes live.

Not sure if using WMTS (which we'll be able to use with the Standard plan) would reduce the amount of views. The other option is to only show the cesium globe only when zoomed out fully, and then switch to a mapbox gl view when the user wants to see more detail.

But it just looks so nice now :slight_smile: