@JsType(isNative=true, namespace="Cesium", name="GeoJsonDataSource") public class GeoJsonDataSource extends Object implements DataSource
Modifier and Type | Class and Description |
---|---|
static interface |
GeoJsonDataSource.discribe
This callback is displayed as part of the GeoJsonDataSource class.
|
Modifier and Type | Field and Description |
---|---|
Event |
changedEvent
Gets an event that will be raised when the underlying data changes.
|
static boolean |
clampToGround
Gets or sets default of whether to clamp to the ground.
|
DataSourceClock |
clock
This DataSource only defines static data, therefore this property is always undefined.
|
EntityCluster |
clustering
Gets or sets the clustering options for this data source.
|
static Object |
crsLinkHrefs
Gets an object that maps the href property of a crs link to a callback function which takes the crs properties
object and returns a Promise that resolves to a function that takes a GeoJSON coordinate and transforms it into a
WGS84 Earth-fixed Cartesian.
|
static Object |
crsLinkTypes
Gets an object that maps the type property of a crs link to a callback function which takes the crs properties
object and returns a Promise that resolves to a function that takes a GeoJSON coordinate and transforms it into a
WGS84 Earth-fixed Cartesian.
|
static Object |
crsNames
Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate and transforms
it into a WGS84 Earth-fixed Cartesian.
|
EntityCollection |
entities
Gets the collection of Entity instances.
|
Event |
errorEvent
Gets an event that will be raised if an error is encountered during processing.
|
static Color |
fill
Gets or sets default color for polygon interiors.
|
boolean |
isLoading
Gets a value indicating if the data source is currently loading data.
|
Event |
loadingEvent
Gets an event that will be raised when the data source either starts or stops loading.
|
static Color |
markerColor
Gets or sets the default color of the map pin created for each point.
|
static int |
markerSize
Gets or sets the default size of the map pin created for each point, in pixels.
|
static String |
markerSymbol
Gets or sets the default symbol of the map pin created for each point.
|
String |
name
Gets a human-readable name for this instance.
|
boolean |
show
Gets whether or not this data source should be displayed.
|
static Color |
stroke
Gets or sets the default color of polylines and polygon outlines.
|
static double |
strokeWidth
Gets or sets the default width of polylines and polygon outlines.
|
Constructor and Description |
---|
GeoJsonDataSource()
|
GeoJsonDataSource(String name)
|
Modifier and Type | Method and Description |
---|---|
static Promise<GeoJsonDataSource,String> |
load(JsObject data)
Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
|
static Promise<GeoJsonDataSource,String> |
load(JsObject data,
GeoJsonDataSourceOptions options)
Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
|
static Promise<GeoJsonDataSource,String> |
load(String data)
Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
|
static Promise<GeoJsonDataSource,String> |
load(String data,
GeoJsonDataSourceOptions options)
Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
|
boolean |
update(JulianDate time)
Updates the data source to the provided time.
|
@JsProperty public static boolean clampToGround
@JsProperty public static Object crsLinkHrefs
@JsProperty public static Object crsLinkTypes
@JsProperty public static Object crsNames
@JsProperty public static Color fill
Color.YELLOW()
@JsProperty public static Color markerColor
Color.ROYALBLUE()
@JsProperty public static int markerSize
@JsProperty public static String markerSymbol
@JsProperty public static Color stroke
Color.BLACK()
@JsProperty public static double strokeWidth
@JsProperty public Event changedEvent
@JsProperty public DataSourceClock clock
@JsProperty public EntityCluster clustering
@JsProperty public EntityCollection entities
@JsProperty public Event errorEvent
@JsProperty public boolean isLoading
@JsProperty public Event loadingEvent
@JsProperty public String name
@JsProperty public boolean show
@JsConstructor public GeoJsonDataSource()
DataSource
which processes both GeoJSON and TopoJSON data.
simplestyle-spec properties will also be used if they are present.@JsConstructor public GeoJsonDataSource(String name)
DataSource
which processes both GeoJSON and TopoJSON data.
simplestyle-spec properties will also be used if they are present.name
- The name of this data source. If undefined, a name will be taken from the name of the GeoJSON file.@JsMethod public static Promise<GeoJsonDataSource,String> load(JsObject data)
data
- GeoJSON object, or TopoJSON object to be loaded.JsObject jsonObject = JsJSON.parse("{"type":"MultiPolygon","coordinates":[[[[131.50108952,43.666989],[131.50109395,44.00032979],[132.00110764,44.00032626],[132.00110313,43.66698549],[131.50108952,43.666989]]]],"crs":{"type":"name","properties":{"name":"EPSG:4326"}}}");
GeoJsonDataSource.load(jsonObject).then(
new Fulfill<GeoJsonDataSource>() {
{@literal @}Override
public void onFulfilled(GeoJsonDataSource value) {
viewer.dataSources().add(value);
}
},
new Reject<String>() {
{@literal @}Override
public void onRejected(String value) {
Cesium.log(value);
}
});
@JsMethod public static Promise<GeoJsonDataSource,String> load(String data)
data
- A url to be loaded.@JsMethod public static Promise<GeoJsonDataSource,String> load(JsObject data, GeoJsonDataSourceOptions options)
data
- A GeoJSON object, or TopoJSON object to be loaded.options
- OptionsJsObject jsonObject = JsJSON.parse("{"type":"MultiPolygon","coordinates":[[[[131.50108952,43.666989],[131.50109395,44.00032979],[132.00110764,44.00032626],[132.00110313,43.66698549],[131.50108952,43.666989]]]],"crs":{"type":"name","properties":{"name":"EPSG:4326"}}}");
GeoJsonDataSource.load(jsonObject).then(
new Fulfill<GeoJsonDataSource>() {
{@literal @}Override
public void onFulfilled(GeoJsonDataSource value) {
viewer.dataSources().add(value);
}
},
new Reject<String>() {
{@literal @}Override
public void onRejected(String value) {
Cesium.log(value);
}
});
@JsMethod public static Promise<GeoJsonDataSource,String> load(String data, GeoJsonDataSourceOptions options)
data
- A url to be loaded.options
- Options@JsMethod @JsIgnore public boolean update(JulianDate time)
DataSource
update
in interface DataSource
time
- The simulation time.Copyright © 2019. All rights reserved.