Cesium.Viewer with proxy

The following is working :slight_smile:
var widget = new Cesium.CesiumWidget('cesiumContainer', {
   imageryProvider : new Cesium.OpenStreetMapImageryProvier({
      url : 'valid url',
      proxy : new Cesium.DefaultProxy('/proxy')
   })
});

However, the following does not work and is still attempting to load resources from bing maps :frowning:
var viewer = new Cesium.Viewer('cesiumContainer', {
   imageryProvider : new Cesium.OpenStreetMapImageryProvier({
      url : 'same valid url',
      proxy : new Cesium.DefaultProxy('/proxy')
   })
});

Can you use a proxy with a Viewer?
Why does Viewer not honor the proxy configuration?
What is the difference between CesiumWidget and Viewer?

I am trying to follow the tutorial http://cesiumjs.org/2013/11/04/Geometry-and-Appearances/ but on a private network (hence the proxy).

Thanks,

Nathan

“CesiumWidget” is a minimal control that only includes the 3D globe without any additional UI elements (except for the credits display and an error display).

“Viewer” is built on top of that, and adds all the other HTML UI elements (timeline, base layer picker, geocoder, etc.) Because the UI is more complicated, Viewer does not accept an “imageryProvider” parameter when using the BaseLayerPicker. When I run your code, I get:

DeveloperError: options.imageryProvider is not available when using the BaseLayerPicker widget. Either specify options.selectedImageryProviderViewModel instead or set options.baseLayerPicker to false.

For your offline use case, I suggest turning off the baseLayerPicker, since most of the options will be unavailable offline. I recently wrote up an Offline Guide which describes how to configure a Cesium app to work offline:

https://github.com/AnalyticalGraphicsInc/cesium/wiki/Offline-Guide