How to use Natural earth tiles with cesium?

1. A concise explanation of the problem you’re experiencing.

I am trying to use Natural earth Tiles with cesium in offline mode.

Vector tiles over this website I would love to use in our application.

But I am not sure what is correct way to use. Any help regarding this are welcome.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

Context:-

I am trying to have offline map with cesium which will have state and country district boundaries and probably major cities. Alternative idea might also be helpful

4. The Cesium version you’re using, your operating system and browser.

It looks like part of that is raster imagery, which Cesium supports quite well! In fact there’s a Sandcastle example using Natural Earth imagery:

For vector tiles, there’s currently only experiment support for vector tiles, in the 3D Tiles format, not the Mapbox format. So I don’t think there’s an easy way to display those in CesiumJS right now.

Although there seems to be a MapboxImageryProvider but I think that might also be specifically for raster imagery:

https://cesiumjs.org/Cesium/Build/Documentation/MapboxImageryProvider.html?classFilter=MapboxImageryProvider

Thanks omar for your suggestion. I will try

I am new to this. Is there any opensource map tiles till city level in from reliable source which can be compatable with cesium.

Any suggestions are really helpful.

Thanks,

Ankur

You can actually see all the built-in imagery providers by clicking on the little satellite icon in the top right and bringing up this menu:

You can click on OpenStreetMap there to use their imagery in Cesium. You can also initialize it in the viewer this way:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

imageryProvider: Cesium.createOpenStreetMapImageryProvider({

url : ‘https://a.tile.openstreetmap.org/

})

});

``

There’s more info on that in the docs:

https://cesiumjs.org/Cesium/Build/Documentation/createOpenStreetMapImageryProvider.html?classFilter=openstr

You might also find this imagery layers tutorial useful:

Hope this helps!