GeoJsonDataSource

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
object Companion

Properties

Link copied to clipboard

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

Link copied to clipboard

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

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

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

Link copied to clipboard

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

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

Link copied to clipboard

Gets whether or not this data source should be displayed.

Functions

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

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

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

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

suspend fun process(data: Any, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): GeoJsonDataSource
suspend fun process(data: String, options: GeoJsonDataSource.Companion.LoadOptions? = definedExternally): GeoJsonDataSource
Link copied to clipboard
Link copied to clipboard

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.