Skip to content

Commit cd6f4a6

Browse files
authored
Merge pull request #97574 from mschofie/user/mschofie/coarse-reloc-api-fix
Remove usage of the deprecated 'ASACreateFactory' call
2 parents 7791a97 + 4c78dd9 commit cd6f4a6

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

articles/spatial-anchors/how-tos/create-locate-anchors-cpp-winrt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Learn more about the [Expiration](https://docs.microsoft.com/cpp/api/spatial-anc
237237
Learn more about the [CreateWatcher](https://docs.microsoft.com/cpp/api/spatial-anchors/winrt/cloudspatialanchorsession#createwatcher) method.
238238

239239
```cpp
240-
AnchorLocateCriteria criteria = m_asafactory.CreateAnchorLocateCriteria();
240+
AnchorLocateCriteria criteria = AnchorLocateCriteria();
241241
criteria.Identifiers({ LR"(id1)", LR"(id2)", LR"(id3)" });
242242
auto cloudSpatialAnchorWatcher = m_cloudSession.CreateWatcher(criteria);
243243
```

articles/spatial-anchors/how-tos/set-up-coarse-reloc-cpp-winrt.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,8 @@ To complete this guide, make sure you have:
3434
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-provider.md)]
3535

3636
```cpp
37-
// Create the ASA factory
38-
SpatialAnchorsFactory m_asaFactory { nullptr };
39-
// . . .
40-
4137
// Create the sensor fingerprint provider
42-
PlatformLocationProvider sensorProvider;
43-
sensorProvider = m_asaFactory.CreatePlatformLocationProvider();
38+
PlatformLocationProvider sensorProvider = PlatformLocationProvider();
4439

4540
// Allow GPS
4641
SensorCapabilities sensors = sensorProvider.Sensors()
@@ -66,12 +61,12 @@ sensors.KnownBeaconProximityUuids(uuids);
6661
cloudSpatialAnchorSession.LocationProvider(sensorProvider);
6762

6863
// Configure the near-device criteria
69-
NearDeviceCriteria nearDeviceCriteria = m_asaFactory.CreateNearDeviceCriteria();
64+
NearDeviceCriteria nearDeviceCriteria = NearDeviceCriteria();
7065
nearDeviceCriteria.DistanceInMeters(5.0f);
7166
nearDeviceCriteria.MaxResultCount(25);
7267

7368
// Set the session's locate criteria
74-
anchorLocateCriteria = m_asaFactory.CreateAnchorLocateCriteria();
69+
anchorLocateCriteria = AnchorLocateCriteria();
7570
anchorLocateCriteria.NearDevice(nearDeviceCriteria);
7671
cloudSpatialAnchorSession.CreateWatcher(anchorLocateCriteria);
7772
```

0 commit comments

Comments
 (0)