Skip to main content
←API Reference ←com.nianticspatial.nsdk.mesh ←MeshDownloaderSession

downloadByAsset


Declaration​

fun downloadByAsset( vpsMapAssetId: String, latitude: Double, longitude: Double, getTexture: Boolean, maxChunks: Int = 0, maxSizeKb: Int = 0, ): Flow<NSDKResult<MeshDownloaderData, MeshDownloaderError>>

Summary​

Streams mesh chunks for a VPS map asset, sorted closest-first by GPS position.


MeshDownloader resolves the mesh sibling for vpsMapAssetId via SitesManager, then
downloads chunks. The flow completes normally when all chunks have been delivered
(MeshDownloaderError.NONE) or when the cumulative size cap is hit
(MeshDownloaderError.SIZE_LIMIT_REACHED). Other failures are emitted as
NSDKResult.Error.

Returns​

A Flow that emits NSDKResult.Success for each chunk and a terminal NSDKResult.Error if the download fails or the size limit is reached.