I have a map with a cesium cesium Base Layer Picker,
Add the moment, I am adding a list of Imagery like this :
{
imageryProviderViewModels: ImageryHelperService.getImageryProviderViewModels((value: CesiumImageryProviders) => {
this.store$.dispatch(new SettingsStoreAction.SetNavigationSettings({settings : {providerVRMap : value} }));
}),
selectedImageryProviderViewModel: ImageryHelperService.getSelectedImageryProvider(settings.providerVRMap),
}
**Which basically, take from a function a list of Imagery I created and that are static in the code ex : **
static getImageryProviderViewModels(onChange?: (key: CesiumImageryProviders) => void) {
const imageryViewModels = ;
Object.keys(ImageryHelperService.DEFAULT_PROVIDERS).forEach(key => {
if (key in ImageryHelperService.DEFAULT_PROVIDERS) {
const provider = ImageryHelperService.DEFAULT_PROVIDERS[key];
imageryViewModels.push(new Cesium.ProviderViewModel({
name: provider.name,
iconUrl : Cesium.buildModuleUrl(provider.iconUrl),
category : provider.category,
tooltip : provider.tooltip,
creationFunction: () => {
if (onChange) { onChange(Number(key)); }
return provider.creationFunction();
}
}));
}
});
return imageryViewModels;
}
**Anyway, after adding my custom list, I would like to load the Imagery that are in the ION account. I have 3 solution for this, but I do not know which is possible
- ADD and REMOVE Imagery from the baseLayerPicker AFTER setting the initial array of Imagery. Is it poissible ?
- Sync the baseLayerPicker with all the assets in my Ions account ?
- Instead of assigning an array, assign a promise instead and add the layer when the promise is completed, so my **ImageryHelperService.getImageryProviderViewModels()would be just a Promise of an Array of ImageryProvider
Thank you