baseLayerPicker problem

I want to use custom base layerpicker. I have the following code based on the example in the doc (BTW it is not updated with the current release)


var imageryViewModels = ;

imageryViewModels.push(new Cesium.ProviderViewModel({
name : ‘Open\u00adStreet\u00adMap’,
iconUrl : Cesium.buildModuleUrl(‘Widgets/Images/ImageryProviders/openStreetMap.png’),
tooltip : ‘OpenStreetMap (OSM) is a collaborative project to create a free editable
map of the world.\n’,
creationFunction : function() {
return new Cesium.OpenStreetMapImageryProvider({
url : ‘//

imageryViewModels.push(new Cesium.ProviderViewModel({
name : ‘Black Marble’,
iconUrl : Cesium.buildModuleUrl(‘Widgets/Images/ImageryProviders/blackMarble.png’),
tooltip : ‘The lights of cities and villages trace the outlines of civilization
in this global view of the Earth at night as seen by NASA/NOAA’s Suomi NPP satellite.’,
creationFunction : function() {
return new Cesium.TileMapServiceImageryProvider({
url : ‘//’,
maximumLevel : 8,
credit : ‘Black Marble imagery courtesy NASA Earth Observatory’


var viewer = new Cesium.Viewer('cesiumContainer', {
    timeline : false,
    navigationHelpButton: false,
    scene3DOnly: true,
    fullscreenButton: false,
    selectionIndicator: false,
    sceneMode : Cesium.SceneMode.SCENE3D

// add baselayer picker ( I have my HTML baseLayerPickerContainer object as in the DOC of BaseLayerPicker)

var baseLayerPicker = new Cesium.BaseLayerPicker(‘baseLayerPickerContainer’, {globe:scene.globe, imageryProviderViewModels:imageryViewModels});

so when I run this code, first my maps shows Bing images, second I have a map with LayerSelection with my two maps that I can click, however when I click on the map, nothing happens, imagery is not changed.

What I am doing wrong ? How to assign this picker to a viewer object ?

Try passing

imageryProvider : false

into the Viewer constructor in addition to your other parameters. There are two ways that default imagery is added to the globe, depending on whether the default base layer picker is enabled or not.

That worked for me perfectly. Many thanks !