GeoJsonPrimitive
open external class GeoJsonPrimitive(options: GeoJsonPrimitiveConstructorOptions? = definedExternally)(source)
Lightweight GeoJSON loader that converts features directly into BufferPointCollection, BufferPolylineCollection, and BufferPolygonCollection.
Unlike GeoJsonDataSource, this path does not create entities. Instead, it exposes high-throughput buffer primitive collections that can be added directly to Scene.primitives.
const loader = await GeoJsonPrimitive.fromUrl("./data.geojson");
viewer.scene.primitives.add(loader);
loader.points; // BufferPointCollection | undefined
loader.polylines; // BufferPolylineCollection | undefined
loader.polygons; // BufferPolygonCollection | undefined
loader.ids; // source feature IDs
loader.properties; // source feature propertiesContent copied to clipboard
See also
Properties
Link copied to clipboard
Feature count represented by the loaded collections.
Link copied to clipboard
Lookup table from integer ID generated by GeoJsonPrimitive, to integer or string Feature ID from GeoJSON source.
Link copied to clipboard
Buffer point collection for point geometries.
Link copied to clipboard
Buffer polygon collection for polygon geometries.
Link copied to clipboard
Buffer polyline collection for linestring geometries.
Link copied to clipboard
Source GeoJSON properties, indexed by generated integer ID.
Link copied to clipboard
Loader source URL when created via GeoJsonPrimitive.fromUrl.