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)

// TWO IMAGINARY MODELS

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.\nhttp://www.openstreetmap.org’,
creationFunction : function() {
return new Cesium.OpenStreetMapImageryProvider({
url : ‘//a.tile.openstreetmap.org/
});
}
}));

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 : ‘//cesiumjs.org/blackmarble’,
maximumLevel : 8,
credit : ‘Black Marble imagery courtesy NASA Earth Observatory’
});
}
}));

// VIEWER

var viewer = new Cesium.Viewer('cesiumContainer', {
    timeline : false,
    navigationHelpButton: false,
    scene3DOnly: true,
    fullscreenButton: false,
    baseLayerPicker:false,
    homeButton:false,
    infoBox:false,
    sceneModePicker:false,
    selectionIndicator: false,
    animation:false,
    geocoder: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 !

M.