import defaultValue from '../../../support_modules/defaultValue.js'
import getWebGLStub from '../../../support_modules/getWebGLStub.js'
I have it declared in the same file.
let options = defaultValue( options, {} )
options.contextOptions = defaultValue( options.contextOptions, {} )
options.contextOptions.webgl = defaultValue( options.contextOptions.webgl, {} )
if ( !!window.webglStub ) {
options.contextOptions.getWebGLStub = getWebGLStub
}
this.view = new Cesium.Viewer( 'cesium', options )
This is how I'm defining the options.
All of the files needed:
clone.js
defaultValue.js
defined.js
DeveloperError.js
freezeObject.js
getWebGLStub.js
WebGLConstants.js
These files are all in the same folder together and all of their requirements match up to the same directory as well eg.
define( [
'./clone',
'./defaultValue',
'./defined',
'./DeveloperError',
'./WebGLConstants'
], function(
clone,
defaultValue,
defined,
DeveloperError,
WebGLConstants ) ...
For the rest of the initialization of cesium, I'm doing this:
this.view.scene.globe.imageryLayers._layers[ 0 ].name = 'Natural Earth (Default)'
this.eventhandler = new Cesium.ScreenSpaceEventHandler( this.view.scene.canvas )
this.createCollections()
Cesium.knockout.getObservable( this.view.animation.viewModel, 'timeLabel' ).subscribe( this.throttleEmitTimeUpdate.call( this ) )
this.ipc.on( 'render-data', ( event, sources ) => this.render( sources ) )
this.ipc.on( 'clear-data', () => {
this.view.dataSources.removeAll()
this.createCollections()
} )
Cesium.CzmlDataSource.updaters.push( this.processCustomStaticProperty )
Cesium.DataSourceCollection.prototype.__defineGetter__( 'sources', function() {
return this._dataSources
} )
Cesium.CzmlDataSource.prototype.getById = function( id ) {
return _.find( this.entities.values, {
id: id
} )
}
this.registerCustomEventEmitters()
}
AFAIK, nothing I've done here should cause the webGL stub to break.
Currently the scene still renders and tries to default to Bing.
I feel like I'm missing something to do with activating the stub.
Was I supposed to take all of those files out of cesium?
Am I supposed to pass something to the stub as parameters when assigning it to: options.contextOptions.getWebGLStub = getWebGLStub
I'm not quite sure what I'm missing and have no logs to follow.
Thanks a bunch for the help!