requestLocationMeshByAsset
Declaration
func requestLocationMeshByAsset(vpsMapAssetId: String, latitude: Double, longitude: Double, getTexture: Bool, maxChunks: UInt32 = 0, maxSizeKb: UInt32 = 0, 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 download cap in kilobytes. Once exceeded, no new nodes are scheduled; already-completed chunks are still delivered. 0 means no cap. |
| 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.