how to persist baselayer selected by user?

Hi

I would like to know how to persist baselayer selected by user?
For example if user selected “Mapbox Streets”, how can we detected it was selected and persist it.

So that the map will be used when it is reload.

Thanks
TS

Add on to another question, is there a call back method, so that we know which baselayer the user selected ?

Hi there,

Look at:

https://cesiumjs.org/Cesium/Build/Documentation/ImageryLayerCollection.html#layerAdded (multiple events here 0 is the base layer).

Also, please keep in mind that BaseLayerPicker is a list of example layers and should not be used in a production application as-is. You should supply your own layers for production use.

Hope that helps,

  • Rachel