# How to Use Location AR with Code Source: https://www.nianticspatial.com/docs/nsdk/how-to/vps/location_ar_code/ Use VPS2 Site and asset localization for Location AR. Select a Site at runtime, call the platform's `localize` API with its Site ID, and place content relative to the asset that VPS2 localizes against. The Site ID is the localization target. A localized asset ID is available only after visual localization succeeds; use the matching asset's tracking transform for AR placement. Do not use an anchor payload as the map identifier. | Platform | Start localization | Read the asset pose | | --- | --- | --- | | Swift | localize(siteId:) | assetTrackingData(assetId:) | | Kotlin | localize(siteId) | getAssetTrackingData(assetId) | | Unity | TryLocalize(...) | Use the localized asset tracking pose exposed by your installed NSDK version. | You can instead call the latitude, longitude, and radius overload to find eligible Sites nearby. These requests are additive and asynchronous, so wait for a localized asset before trying to render map-relative content. See [Place virtual content with VPS2](https://www.nianticspatial.com/docs/nsdk/how-to/vps2/placing_virtual_content/), [Get started with Sites](https://www.nianticspatial.com/docs/nsdk/how-to/sites/getting_started/), and [Geolocate with VPS2](https://www.nianticspatial.com/docs/nsdk/how-to/vps2/getting_vps2_geoposition/).