requestLocationMeshByAsset
Declaration
func requestLocationMeshByAsset(vpsMapAssetId: String, latitude: Double, longitude: Double, getTexture: Bool, maxChunks: UInt32 = 0, maxSizeKb: UInt32 = 0, maxDecodedSizeKb: UInt32 = NSDKMeshDownloader.defaultMaxDecodedSizeKb, pollingInterval: TimeInterval = 0.1) -> AsyncThrowingStream<MeshDownloaderChunk, Error>
Summary
Returns
An AsyncThrowingStream that yields MeshDownloaderChunk values as they
arrive and finishes when all chunks have been delivered.
Throws
CancellationErrorif the Task running this function was cancelled.MeshDownloaderResults/Errorif the download encountered an error.
Parameters
| Name | Type | Summary |
|---|---|---|
| vpsMapAssetId | String | The portal VPS map asset ID string. |
| latitude | Double | User latitude in decimal degrees, used to sort nodes closest-first. |
| longitude | Double | User longitude in decimal degrees. |
| getTexture | Bool | If true, texture bytes are included in each chunk. |
| maxChunks | UInt32 | Maximum number of graph nodes to download. 0 means no limit. |
| maxSizeKb | UInt32 | Cumulative size cap in kilobytes, counting bytes served from the on-disk cache as well as downloaded ones. Once exceeded, no new nodes are scheduled; already-completed chunks are still delivered. 0 means no cap. |
| maxDecodedSizeKb | UInt32 | Cumulative budget in kilobytes for what the delivered chunks occupy once decoded, cached or downloaded: vertices, UVs, indices and per-vertex colours at 4 bytes each, plus texture bytes as received. Once reached, no new nodes are scheduled; already-completed chunks are still delivered. 0 means no budget. |
| pollingInterval | TimeInterval | Interval between polls (default: 0.1 seconds). |
Downloads mesh chunks for a portal asset, streaming each chunk as it completes.
Initiates a network request to the portal API for the given
vpsMapAssetId. Graph nodes aresorted by proximity to the provided GPS position and downloaded sequentially, closest first.
Each decoded chunk is yielded to the returned stream immediately upon completion, enabling
incremental mesh generation without waiting for the full download.