I'm trying to write bindings for CustomDataSource
from cesium
here's what I have so far
#[wasm_bindgen(module = "cesium")]
extern "C" {
pub type CustomDataSource;
pub type Event;
pub type DataSourceClock;
pub type EntityCluster;
pub type EntityCollection;
#[wasm_bindgen(constructor)]
pub fn new() -> CustomDataSource;
#[wasm_bindgen(method, getter)]
pub fn changedEvent(this: &CustomDataSource) -> Event;
#[wasm_bindgen(method, getter)]
pub fn clock(this: &CustomDataSource) -> DataSourceClock;
#[wasm_bindgen(method, setter)]
pub fn set_clock(this: &CustomDataSource, val: DataSourceClock);
#[wasm_bindgen(method, getter)]
pub fn clustering(this: &CustomDataSource) -> EntityCluster;
#[wasm_bindgen(method, setter)]
pub fn set_clustering(this: &CustomDataSource, val: EntityCluster);
#[wasm_bindgen(method, getter)]
pub fn entities(this: &CustomDataSource) -> EntityCollection;
#[wasm_bindgen(method, getter)]
pub fn isLoading(this: &CustomDataSource) -> bool;
#[wasm_bindgen(method, setter)]
pub fn set_isLoading(this: &CustomDataSource, val: bool);
#[wasm_bindgen(method, getter)]
pub fn name(this: &CustomDataSource) -> String;
#[wasm_bindgen(method, setter)]
pub fn set_name(this: &CustomDataSource, val: String);
#[wasm_bindgen(method, getter)]
pub fn show(this: &CustomDataSource) -> bool;
#[wasm_bindgen(method, setter)]
pub fn set_show(this: &CustomDataSource, val: bool);
}
And here's the definition from the documentation of cesium
new Cesium.CustomDataSource(name)engine/Source/DataSources/CustomDataSource.js 28 A DataSource implementation which can be used to manually manage a group of entities. Name Type Description name string optionalA human-readable name for this instance.
- Members
- changedEvent : Eventengine/Source/DataSources/CustomDataSource.js 100 Gets an event that will be raised when the underlying data changes.
- clock : DataSourceClockengine/Source/DataSources/CustomDataSource.js 61 Gets or sets the clock for this instance.
- clustering : EntityClusterengine/Source/DataSources/CustomDataSource.js 145 Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
- entities : EntityCollectionengine/Source/DataSources/CustomDataSource.js 77 Gets the collection of Entity instances.
- errorEvent : Eventengine/Source/DataSources/CustomDataSource.js 110 Gets an event that will be raised if an error is encountered during processing.
- isLoading : booleanengine/Source/DataSources/CustomDataSource.js 87 Gets or sets whether the data source is currently loading data.
- loadingEvent : Eventengine/Source/DataSources/CustomDataSource.js 120 Gets an event that will be raised when the data source either starts or stops loading.
- name : stringengine/Source/DataSources/CustomDataSource.js 45 Gets or sets a human-readable name for this instance.
- show : booleanengine/Source/DataSources/CustomDataSource.js 130 Gets whether or not this data source should be displayed. Methods
- update(time) → booleanengine/Source/DataSources/CustomDataSource.js 169 Updates the data source to the provided time. This function is optional and is not required to be implemented. It is provided for data sources which retrieve data based on the current animation time or scene state. If implemented, update will be called by DataSourceDisplay once a frame. Name Type Description time JulianDate The simulation time. Returns: True if this data source is ready to be displayed at the provided time, false otherwise.
How would I go about overriding the update
method on this class? It seems to be a hook that's used to tie into the cesium event loop.