Cesium for Unity 1.26.0
Loading...
Searching...
No Matches
CesiumForUnity.CesiumCartographicPolygon Class Reference

A spline-based polygon used to rasterize 2D polygons on top of Cesium3DTilesets. More...

Inheritance diagram for CesiumForUnity.CesiumCartographicPolygon:

Public Member Functions

delegate void CartographicPolygonLoadFailureDelegate (CesiumCartographicPolygonLoadFailureDetails details)
 Encapsulates a method that receives details of a cartographic polygon load failure.
 
void Refresh ()
 Reloads the polygon's spline from the configured source and rebuilds any CesiumPolygonRasterOverlay that references this polygon, so the cutout in the tileset matches the latest data.
 

Properties

CesiumCartographicPolygonSource source [get, set]
 The source from which this polygon's shape is derived.
 
string url [get, set]
 The URL from which to load the GeoJSON document.
 
int polygonIndex [get, set]
 The zero-based index of the polygon to use when the source geometry is a MultiPolygon.
 
int featureIndex [get, set]
 The zero-based index of the feature to use when the GeoJSON root is a FeatureCollection.
 
long ionAssetID [get, set]
 The ID of the Cesium ion asset to use.
 
string ionAccessToken [get, set]
 The access token to use to access the Cesium ion resource.
 
CesiumIonServer ionServer [get, set]
 The Cesium ion server from which this polygon's GeoJSON is loaded.
 
CesiumGeoJsonDocument document [get, set]
 Gets or sets the GeoJSON document used by this polygon.
 

Events

static CartographicPolygonLoadFailureDelegate OnCesiumCartographicPolygonLoadFailure
 An event that is raised when the polygon encounters an error that prevents it from loading.
 

Detailed Description

A spline-based polygon used to rasterize 2D polygons on top of Cesium3DTilesets.

Cartographic polygons are only supported for Unity 2022.2 or later.

The polygon's shape is defined by a spline that is georeferenced using a CesiumGlobeAnchor. The spline can either be edited manually, or its knots can be generated automatically from a GeoJSON document loaded from Cesium ion, a URL, or a document that has been parsed and assigned in code.

Definition at line 60 of file CesiumCartographicPolygon.cs.

Member Function Documentation

◆ CartographicPolygonLoadFailureDelegate()

delegate void CesiumForUnity.CesiumCartographicPolygon.CartographicPolygonLoadFailureDelegate ( CesiumCartographicPolygonLoadFailureDetails details)

Encapsulates a method that receives details of a cartographic polygon load failure.

Parameters
detailsThe details of the load failure.

◆ Refresh()

void CesiumForUnity.CesiumCartographicPolygon.Refresh ( )
inline

Reloads the polygon's spline from the configured source and rebuilds any CesiumPolygonRasterOverlay that references this polygon, so the cutout in the tileset matches the latest data.

This has no effect on the spline when source is set to CesiumCartographicPolygonSource.Manual, but dependent raster overlays are still rebuilt so that manual edits to the spline are reflected in the cutout.

Definition at line 383 of file CesiumCartographicPolygon.cs.

Property Documentation

◆ document

CesiumGeoJsonDocument CesiumForUnity.CesiumCartographicPolygon.document
getset

Gets or sets the GeoJSON document used by this polygon.

Setting this property automatically changes source to CesiumCartographicPolygonSource.FromDocument.

Definition at line 271 of file CesiumCartographicPolygon.cs.

◆ featureIndex

int CesiumForUnity.CesiumCartographicPolygon.featureIndex
getset

The zero-based index of the feature to use when the GeoJSON root is a FeatureCollection.

If the root object is a single Feature, this value is ignored. If the index is out of range (negative or >= the number of features), the cutout will not be applied and any previous cutout will be cleared. Setting this property triggers a reload when a non-Manual source is active.

Definition at line 176 of file CesiumCartographicPolygon.cs.

◆ ionAccessToken

string CesiumForUnity.CesiumCartographicPolygon.ionAccessToken
getset

The access token to use to access the Cesium ion resource.

Only used when source is set to CesiumCartographicPolygonSource.FromCesiumIon. If empty, the default token from the ion server will be used.

Definition at line 220 of file CesiumCartographicPolygon.cs.

◆ ionAssetID

long CesiumForUnity.CesiumCartographicPolygon.ionAssetID
getset

The ID of the Cesium ion asset to use.

Only used when source is set to CesiumCartographicPolygonSource.FromCesiumIon.

Definition at line 196 of file CesiumCartographicPolygon.cs.

◆ ionServer

CesiumIonServer CesiumForUnity.CesiumCartographicPolygon.ionServer
getset

The Cesium ion server from which this polygon's GeoJSON is loaded.

Only used when source is set to CesiumCartographicPolygonSource.FromCesiumIon.

Definition at line 243 of file CesiumCartographicPolygon.cs.

◆ polygonIndex

int CesiumForUnity.CesiumCartographicPolygon.polygonIndex
getset

The zero-based index of the polygon to use when the source geometry is a MultiPolygon.

If the source geometry is a simple Polygon, this value is ignored. If the index is out of range (negative or >= the number of polygons in a MultiPolygon), the cutout will not be applied and any previous cutout will be cleared. Setting this property triggers a reload when a non-Manual source is active.

Definition at line 154 of file CesiumCartographicPolygon.cs.

◆ source

CesiumCartographicPolygonSource CesiumForUnity.CesiumCartographicPolygon.source
getset

The source from which this polygon's shape is derived.

Setting this to CesiumCartographicPolygonSource.FromCesiumIon, CesiumCartographicPolygonSource.FromDocument, or CesiumCartographicPolygonSource.FromUrl will reload the polygon's spline from the configured GeoJSON source. Setting it to CesiumCartographicPolygonSource.Manual leaves the current spline as-is, allowing it to be edited by hand.

Definition at line 109 of file CesiumCartographicPolygon.cs.

◆ url

string CesiumForUnity.CesiumCartographicPolygon.url
getset

The URL from which to load the GeoJSON document.

Only used when source is set to CesiumCartographicPolygonSource.FromUrl.

Definition at line 129 of file CesiumCartographicPolygon.cs.

Event Documentation

◆ OnCesiumCartographicPolygonLoadFailure

CartographicPolygonLoadFailureDelegate CesiumForUnity.CesiumCartographicPolygon.OnCesiumCartographicPolygonLoadFailure
static

An event that is raised when the polygon encounters an error that prevents it from loading.

Definition at line 75 of file CesiumCartographicPolygon.cs.


The documentation for this class was generated from the following file: