Example:
const provider = await Cesium.GeoJsonFeatureLayerProvider.fromUrl(
"roads.geojson",
{ name: "Roads" },
);
provider.featureLayers.get(0).show = false;
Experimental
This feature is not final and is subject to change without Cesium's standard deprecation policy.
Members
readonly featureLayers : FeatureLayerCollection
The feature layers provided by this instance. A GeoJSON document is one
layer, so this always contains exactly one.
Methods
static Cesium.GeoJsonFeatureLayerProvider.fromGeoJson(geoJson, options) → GeoJsonFeatureLayerProvider
Creates a provider for the features of a GeoJSON object.
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
geoJson |
object | A GeoJSON object. | ||||||
options |
object |
optional
An object with the following properties:
|
Returns:
The provider.
async static Cesium.GeoJsonFeatureLayerProvider.fromUrl(url, options) → Promise.<GeoJsonFeatureLayerProvider>
Fetches a GeoJSON file and creates a provider for its features.
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
url |
Resource | string | The URL of the GeoJSON file. | ||||||
options |
object |
optional
An object with the following properties:
|
Returns:
A promise that resolves to the provider.
Throws:
-
RuntimeError : Failed to load GeoJSON.
