How to show mapbox 3D maps tiles with labels on the Cesium Globe

Hi Team,
I’m trying to add Mapbox 3D maps on the cesium using given code which is working fine:-
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
imageryProvider: new Cesium.MapboxStyleImageryProvider({
styleId: ‘satellite-streets-v10’,
accessToken: ‘pk.eyJ1IjoibWFwYm94c2hhc2hpIiwiYSI6ImNsNHhzdjEwejAzM2UzZHBteXdwb2s4amoifQ.iV3NdKNtWDP9LCr0vgEN8g’,
zoom: 1.5,
center: [30, 50],
projection: ‘globe’
})
});

But what i want is labels should be movable like given link pls go through it :- Display a globe on a webpage | Mapbox GL JS | Mapbox
Use ctrl+leftMouseButton to move the globe and see the labels behaviour, i want same on the
Cesium Globe.
If it’s possible pls provide the solution.

Thanks

Well, the map is a graphical tiled map where those labels are part of the graphics streaming onto the globe. The normal way to deal with this is a) to use a map with no labels, and b) find (lots of sources online) a KML or GeoJSON of countries (or whatever else you want to display) and add those labels to the map with clustered and distance-based display options. Now you can click on labels (using pick()/drillPick() ) and do things with it from there.

Cheers,

Alex

@Alexander_Johannesen
It’s doesn’t work in this case. I’ve to show more that 60 millions of the labels of all india. Clustering is the good option i’ve implemented it and working fine. But while calling the data from the api is making slow my application.
So just i want to show the MapBox vector map(WMTS) on the cesium globe.
Does cesium globe supports MapBox vector maps?

No, not the last time I checked.

Hmm, the way I would solve it would be to still grab the GeoJSON of all placenames, and either;

  1. create different GeoJSONs for the various zoom levels and regions you want to support, and dynamically load and unload them accordingly (mind you, loading something into a Kml or GeoJSON stream “restarts” it, so you can probably just reuse the same resource), or

  2. dynamically generate and update a GeoJSON stream from your server (API) for your zoom level and region (you can probably easily match the selection region to the camera view) at some interval and / or other things like camera position / distance to map.

I think you have to make your own at this point.

Cheers,

Alex

@Alexander_Johannesen
Thanks i’m doing the same but it’s not very smooth and fast like google and mapbox. After extent or certain defined height change i’m calling api and getting geojson data.

@Alexander_Johannesen
Please provide me if there are any solution to add mapbox 3D vector map (.pbf) if it’s possible.

Well, I’ve done something similar in some of our systems, and the way I’ve done it is that in the transition between regional/zoom-level GeoJSONs switches between two datasources with a timed fade (low-step fade, for example 8 steps over 5 seconds, depending on the number of entities, and only on items in the visible cluster). A slight improvement to the above is to find entities with a certain proximity to each other, and only render one of them (simulating clustering in the transition period).

Hope any of that made sense. :slight_smile: I have a framework of plugins that timed the entity collections in and out of the map according to zoom and location on the map.

As to any Pbf or Vector mapping you’d have to ask the Cesium guys. Maybe look to see if Cesium Ion have a resource that does something like this.

As an alternative, btw, is to use raster maps with labels as normal, and when you click on anything you can do a location search and create / update a Label entity based on that. If the map is WMS, there’s support for that in Cesium. Don’t know if you run your own servers or not, might be a different way to do it (albeit not with floating labels).

Cheers,

Alex

1 Like

Thanks