3using System.Threading.Tasks;
16 [ReinteropNativeImplementation(
17 "CesiumForUnityNative::CesiumGeoJsonDocumentImpl",
18 "CesiumGeoJsonDocumentImpl.h")]
19 public partial class CesiumGeoJsonDocument
24 internal CesiumGeoJsonDocument()
26 CreateImplementation();
45 public static CesiumGeoJsonDocument
Parse(
string geoJsonString)
47 var document =
new CesiumGeoJsonDocument();
48 if (document.ParseInternal(geoJsonString))
58 internal partial
bool ParseInternal(
string geoJsonString);
67 var tcs =
new TaskCompletionSource<CesiumGeoJsonDocument>();
68 LoadFromUrl(url, (document) =>
70 tcs.SetResult(document);
72 return await tcs.Task;
80 private static partial
void LoadFromUrl(
string url, Action<CesiumGeoJsonDocument> callback);
91 string ionAccessToken =
"",
94 var tcs =
new TaskCompletionSource<CesiumGeoJsonDocument>();
96 string token = !
string.IsNullOrEmpty(ionAccessToken)
100 LoadFromCesiumIon(ionAssetId, token, serverUrl, (document) =>
102 tcs.SetResult(document);
104 return await tcs.Task;
114 private static partial
void LoadFromCesiumIon(
116 string ionAccessToken,
118 Action<CesiumGeoJsonDocument> callback);
partial CesiumGeoJsonObject GetRootObject()
Gets the root object of this GeoJSON document.
static async Task< CesiumGeoJsonDocument > LoadFromCesiumIonAsync(long ionAssetId, string ionAccessToken="", CesiumIonServer ionServer=null)
Loads a GeoJSON document from Cesium ion asynchronously.
static async Task< CesiumGeoJsonDocument > LoadFromUrlAsync(string url)
Loads a GeoJSON document from a URL asynchronously.
static CesiumGeoJsonDocument Parse(string geoJsonString)
Parses a GeoJSON document from a string.
partial bool IsValid()
Checks whether this GeoJSON document is valid.
Represents an object in a GeoJSON document.
Defines a Cesium ion Server.
string apiUrl
The URL of the main API endpoint of the Cesium ion server.
string defaultIonAccessToken
The default token used to access Cesium ion assets at runtime.
static CesiumIonServer defaultServer
Gets the default Cesium ion Server (ion.cesium.com).