GeoJsonFeatureLayerProvider

A FeatureLayerProvider for a GeoJSON object. Provides one FeatureLayer containing all of its features.

Do not construct this directly. Use GeoJsonFeatureLayerProvider.fromGeoJson or GeoJsonFeatureLayerProvider.fromUrl.

internal constructor new Cesium.GeoJsonFeatureLayerProvider()

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

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:
Name Type Description
name string optional The layer name.
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:
Name Type Description
name string optional The layer name.
Returns:
A promise that resolves to the provider.
Throws:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.