GeoJsonDataSource

open external class GeoJsonDataSource(var name: String = definedExternally)(source)

A DataSource which processes both GeoJSON and TopoJSON data. simplestyle-spec properties will also be used if they are present.

const viewer = new Viewer('cesiumContainer');
viewer.dataSources.add(GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {
stroke: Color.HOTPINK,
fill: Color.PINK,
strokeWidth: 3,
markerSymbol: '?'
}));

See also

Constructors

Link copied to clipboard
constructor(name: String = definedExternally)

Types

Link copied to clipboard
external object Companion

Properties

Link copied to clipboard

Gets an event that will be raised when the underlying data changes.

Link copied to clipboard
external var clock: DataSourceClock

This DataSource only defines static data, therefore this property is always undefined.

Link copied to clipboard

Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.

Link copied to clipboard
external var credit: Credit

Gets the credit that will be displayed for the data source

Link copied to clipboard

Gets the collection of Entity instances.

Link copied to clipboard
external var errorEvent: DefaultEvent

Gets an event that will be raised if an error is encountered during processing.

Link copied to clipboard
external var isLoading: Boolean

Gets a value indicating if the data source is currently loading data.

Link copied to clipboard

Gets an event that will be raised when the data source either starts or stops loading.

Link copied to clipboard
external var name: String

The name of this data source. If undefined, a name will be taken from the name of the GeoJSON file.

Link copied to clipboard
external var show: Boolean

Gets whether or not this data source should be displayed.

Functions

Link copied to clipboard
suspend external fun load(data: Resource, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): GeoJsonDataSource

Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data.

suspend external fun load(data: JsAny, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): GeoJsonDataSource
suspend external fun load(data: String, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): GeoJsonDataSource
Link copied to clipboard
external fun loadAsync(data: Resource, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): Promise<GeoJsonDataSource>
external fun loadAsync(data: JsAny, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): Promise<GeoJsonDataSource>
external fun loadAsync(data: String, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): Promise<GeoJsonDataSource>
Link copied to clipboard
suspend external fun process(data: Resource, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): GeoJsonDataSource

Asynchronously loads the provided GeoJSON or TopoJSON data, without replacing any existing data.

suspend external fun process(data: JsAny, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): GeoJsonDataSource
suspend external fun process(data: String, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): GeoJsonDataSource
Link copied to clipboard
external fun processAsync(data: Resource, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): Promise<GeoJsonDataSource>
external fun processAsync(data: JsAny, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): Promise<GeoJsonDataSource>
external fun processAsync(data: String, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): Promise<GeoJsonDataSource>
Link copied to clipboard
external fun update(time: JulianDate): Boolean

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.