# how to persist baselayer selected by user?

**URL:** <https://community.cesium.com/t/how-to-persist-baselayer-selected-by-user/5710>\
**Category:** CesiumJS\
**Created:** [June 27, 2017, 11:07am UTC](https://community.cesium.com/t/how-to-persist-baselayer-selected-by-user/5710 "2017-06-27T11:07:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TS\_chia](https://avatars.discourse-cdn.com/v4/letter/t/8797f3/32.png) [@TS\_chia](https://community.cesium.com/u/TS_chia)\
**Post date:** [June 27, 2017, 11:07am UTC](https://community.cesium.com/t/how-to-persist-baselayer-selected-by-user/5710/1 "2017-06-27T11:07:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TS\_chia](https://avatars.discourse-cdn.com/v4/letter/t/8797f3/32.png) [@TS\_chia](https://community.cesium.com/u/TS_chia)\
**Post date:** [June 27, 2017, 11:43am UTC](https://community.cesium.com/t/how-to-persist-baselayer-selected-by-user/5710/2 "2017-06-27T11:43:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [June 29, 2017, 1:38pm UTC](https://community.cesium.com/t/how-to-persist-baselayer-selected-by-user/5710/3 "2017-06-29T13:38:19Z")

</div>

Hi there,

Look at:

[https://cesiumjs.org/Cesium/Build/Documentation/ImageryLayerCollection.html#layerAdded](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
