localize
Declaration
Summary
Throws
NSDKError.invalidArgumentif the site ID is empty.
Note: Starts the session if it is not already active.
Parameters
| Name | Type | Summary |
|---|---|---|
| siteId | String | The identifier of the site to localize to. |
Overload 1
Summary
Requests localization to one VPS map asset of a site.
Like localize(siteId:), but assetId narrows it to that single asset of any
deployment, including non-production ones. assetId is the VPS map asset's ID, as a
UUID (32 hex digits, optionally 0x-prefixed, or the canonical 8-4-4-4-12 form). This
is not the ID of the asset group's mesh or splat. An empty string localizes against the
site's production-deployed assets, exactly as localize(siteId:) does.
Asynchronous: observe $latestLocalization for the outcome. When the site has no
localizable asset with that ID, the request fails with an assets-not-found error in
the localization request records. stopLocalize(siteId:) with the site's ID stops it.
Throws
NSDKError.invalidArgumentif the site ID is empty, orassetIdis neither empty nor a UUID.
Note: Starts the session if it is not already active.
Parameters
| Name | Type | Summary |
|---|---|---|
| siteId | String | The identifier of the site the asset belongs to. |
| assetId | String | The VPS map asset's ID, or empty for the site's production assets. |
Overload 2
Summary
Requests localization near a geographic coordinate.
Looks up every site holding VPS assets within radiusMeters of the coordinate and
localizes against all of their assets. The radius is the only way to narrow the
search. Asynchronous: observe $latestLocalization for the outcome.
Requests are additive: calling this again does not disturb a request already in
flight, and the assets accumulate.
Throws
NSDKError.invalidArgumentif a coordinate is out of range, the radius is negative, or any argument is not a finite number.
Note: Starts the session if it is not already active.
Warning: Submitted assets stay in the localization set until stopLocalize(siteId:) removes them. Every extra asset grows each cloud localization request, so keep radiusMeters small.
Parameters
| Name | Type | Summary |
|---|---|---|
| latitude | Double | Latitude of the search centre, in the range [-90, 90]. |
| longitude | Double | Longitude of the search centre, in the range [-180, 180]. |
| radiusMeters | Double | Search radius in meters. Pass 0 (the default) to use the default radius of 100 m. Must not be negative. |
Requests localization to a site, identified by its site ID.
Localizes against the site's production-deployed VPS assets and only those: an
asset that has not been deployed to production cannot be localized against.
Asynchronous: observe
$latestLocalizationfor the outcome.Requests are additive: calling this again does not disturb a request already in
flight, and the sites accumulate.