Skip to content

Commit 30f4737

Browse files
committed
Initial updates. Not ready to merge
1 parent d0e7077 commit 30f4737

7 files changed

+56
-1
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,20 @@ Learn more about the [AnchorLocated](/cpp/api/spatial-anchors/ndk/anchorlocatedd
320320

321321
Learn more about the [DeleteAnchorAsync](/cpp/api/spatial-anchors/ndk/cloudspatialanchorsession#deleteanchorasync) method.
322322

323+
### Delete anchor after locating (recommended)
324+
323325
```cpp
324326
cloudSession_->DeleteAnchorAsync(cloudAnchor, [this](Status status) {
325327
// Perform any processing you may want when delete finishes
326328
});
327329
```
328330
331+
### Delete anchor without locating
332+
```cpp
333+
//TODO
334+
```
335+
336+
329337
[!INCLUDE [Stopping](../../../includes/spatial-anchors-create-locate-anchors-stopping.md)]
330338

331339
Learn more about the [Stop](/cpp/api/spatial-anchors/ndk/cloudspatialanchorsession#stop) method.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,20 @@ Learn more about the [AnchorLocatedDelegate](/cpp/api/spatial-anchors/winrt/anch
276276

277277
Learn more about the [DeleteAnchorAsync](/cpp/api/spatial-anchors/winrt/cloudspatialanchorsession#deleteanchorasync) method.
278278

279+
### Delete anchor after locating (recommended)
280+
279281
```cpp
280282
co_await m_cloudSession.DeleteAnchorAsync(cloudAnchor);
281283
// Perform any processing you may want when delete finishes
282284
```
283285

286+
### Delete anchor without locating
287+
```cpp
288+
//TODO
289+
```
290+
291+
292+
284293
[!INCLUDE [Stopping](../../../includes/spatial-anchors-create-locate-anchors-stopping.md)]
285294

286295
Learn more about the [Stop](/cpp/api/spatial-anchors/winrt/cloudspatialanchorsession#stop) method.

articles/spatial-anchors/how-tos/create-locate-anchors-java.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,21 @@ Learn more about the [AnchorLocatedListener](/java/api/com.microsoft.azure.spati
355355

356356
Learn more about the [deleteAnchorAsync](/java/api/com.microsoft.azure.spatialanchors.cloudspatialanchorsession.deleteanchorasync) method.
357357

358+
### Delete anchor after locating (recommended)
359+
358360
```java
359361
Future deleteAnchorFuture = mCloudSession.deleteAnchorAsync(cloudAnchor);
360362
// Perform any processing you may want when delete finishes (deleteAnchorFuture is done)
361363
```
362364

365+
### Delete anchor without locating
366+
367+
```java
368+
//TODO
369+
```
370+
371+
372+
363373
[!INCLUDE [Stopping](../../../includes/spatial-anchors-create-locate-anchors-stopping.md)]
364374

365375
Learn more about the [stop](/java/api/com.microsoft.azure.spatialanchors.cloudspatialanchorsession.stop) method.

articles/spatial-anchors/how-tos/create-locate-anchors-objc.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,22 @@ Learn more about the [anchorLocated](/objectivec/api/spatial-anchors/asacloudspa
279279

280280
Learn more about the [deleteAnchor](/objectivec/api/spatial-anchors/asacloudspatialanchorsession#deleteanchor) method.
281281

282+
283+
### Delete anchor after locating (recommended)
284+
282285
```objc
283286
[_cloudSession deleteAnchor:cloudAnchor withCompletionHandler:^(NSError *error) {
284287
// Perform any processing you may want when delete finishes
285288
}];
286289
```
287290
291+
### Delete anchor without locating
292+
293+
```objc
294+
//TODO
295+
```
296+
297+
288298
[!INCLUDE [Stopping](../../../includes/spatial-anchors-create-locate-anchors-stopping.md)]
289299

290300
Learn more about the [stop](/objectivec/api/spatial-anchors/asacloudspatialanchorsession#stop) method.

articles/spatial-anchors/how-tos/create-locate-anchors-swift.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,15 @@ Learn more about the [anchorLocated](/objectivec/api/spatial-anchors/asacloudspa
291291

292292
Learn more about the [delete](/objectivec/api/spatial-anchors/asacloudspatialanchorsession#deleteanchor) method.
293293

294+
### Delete anchor after locating (recommended)
295+
294296
```swift
295297
_cloudSession?.delete(cloudAnchor!, withCompletionHandler: { (error: Error?) in
296298
// Perform any processing you may want when delete finishes
297299
})
298300
```
301+
### Delete anchor without locating
302+
299303

300304
[!INCLUDE [Stopping](../../../includes/spatial-anchors-create-locate-anchors-stopping.md)]
301305

articles/spatial-anchors/how-tos/create-locate-anchors-unity.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,24 @@ Learn more about the [AnchorLocatedDelegate](/dotnet/api/microsoft.azure.spatial
295295

296296
Learn more about the [DeleteAnchorAsync](/dotnet/api/microsoft.azure.spatialanchors.cloudspatialanchorsession.deleteanchorasync) method.
297297

298+
### Delete anchor after locating (recommended)
298299
```csharp
299300
await this.cloudSession.DeleteAnchorAsync(cloudAnchor);
300301
// Perform any processing you may want when delete finishes
301302
```
302303

304+
### Delete anchor without locating
305+
//REWORD THIS
306+
307+
one can use the ``GetAnchorPropertiesAsync`` API which takes an anchorId GUID as input to get a CloudSpatialAnchor object, and then pass that to DeleteAnchorAsync to delete it. I just quickly prototyped this in a unit test and was able to delete an anchor without locating it.
308+
309+
```csharp
310+
var anchor = await cloudSession.GetAnchorPropertiesAsync(@"anchorId");
311+
await this.cloudSession.DeleteAnchorAsync(anchor);
312+
```
313+
314+
315+
303316
[!INCLUDE [Stopping](../../../includes/spatial-anchors-create-locate-anchors-stopping.md)]
304317

305318
Learn more about the [Stop](/dotnet/api/microsoft.azure.spatialanchors.cloudspatialanchorsession.stop) method.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
## Delete anchors
22

3-
To delete a cloud spatial anchor, you use the `DeleteAnchor()` method. Deleting anchors when no longer used is a good practice to include early on in your development process and practices, to keep your Azure resources cleaned up.
3+
Deleting anchors when no longer used is a good practice to include early on in your development process and practices, to keep your Azure resources cleaned up.
4+

0 commit comments

Comments
 (0)