| Name | Type | Description |
|---|---|---|
options |
GeoJsonPrimitiveConstructorOptions | optional |
Example:
const loader = await Cesium.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 properties
Experimental
This feature is not final and is subject to change without Cesium's standard deprecation policy.
Members
已加载集合所表示的特征数量。
从 GeoJsonPrimitive 生成的整型 ID 到 GeoJSON 源中的整型或字符串 Feature ID 的查找表。
readonly points : BufferPointCollection|undefined
用于点几何的缓冲点集合。
readonly polygons : BufferPolygonCollection|undefined
用于多边形几何的缓冲多边形集合。
readonly polylines : BufferPolylineCollection|undefined
用于线几何(linestring)的缓冲折线集合。
源 GeoJSON 属性,按生成的整型 ID 索引。
通过
GeoJsonPrimitive.fromUrl 创建时的加载器源 URL。
Methods
static Cesium.GeoJsonPrimitive.fromGeoJson(geoJson, options) → GeoJsonPrimitive
直接从已解析的 GeoJSON 对象创建加载器。
| Name | Type | Description |
|---|---|---|
geoJson |
object | |
options |
GeoJsonPrimitiveConstructorOptions | optional |
Returns:
async static Cesium.GeoJsonPrimitive.fromUrl(url, options) → Promise.<GeoJsonPrimitive>
从 URL 或
Resource 加载 GeoJSON。
| Name | Type | Description |
|---|---|---|
url |
Resource | string | |
options |
GeoJsonPrimitiveConstructorOptions | optional |
Returns:
| Name | Type | Description |
|---|---|---|
featureId |
number |
| Name | Type | Description |
|---|---|---|
featureId |
number |
