Skip to content

Commit 9872fe5

Browse files
committed
Update portal item and screenshots
1 parent 4a4909c commit 9872fe5

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

src/MAUI/Maui.Samples/Samples/Geometry/NearestVertex/NearestVertex.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ namespace ArcGIS.Samples.NearestVertex
2323
description: "Find the closest vertex and coordinate of a geometry to a point.",
2424
instructions: "Tap anywhere on the map. An orange cross will show at that location. A blue circle will show the polygon's nearest vertex to the point that was clicked. A red diamond will appear at the coordinate on the geometry that is nearest to the point that was clicked. If tapped inside the geometry, the red and orange markers will overlap. The information box showing distance between the tapped point and the nearest vertex/coordinate will be updated with every new location clicked.",
2525
tags: new[] { "analysis", "coordinate", "geometry", "nearest", "proximity", "vertex" })]
26+
[ArcGIS.Samples.Shared.Attributes.OfflineData("8c2d6d7df8fa4142b0a1211c8dd66903")]
2627
public partial class NearestVertex
2728
{
2829
// Hold references to the graphics overlay and the polygon graphic.
@@ -53,7 +54,7 @@ private async Task Initialize()
5354

5455
// Create the feature layer.
5556
ArcGISPortal portal = await ArcGISPortal.CreateAsync();
56-
var portalItem = await PortalItem.CreateAsync(portal, "8c2d6d7df8fa4142b0a1211c8dd66903");
57+
PortalItem portalItem = await PortalItem.CreateAsync(portal, "8c2d6d7df8fa4142b0a1211c8dd66903");
5758
FeatureLayer usaStatesFeatureLayer = new FeatureLayer(portalItem);
5859

5960
// Add the feature layer to the MapView.
Loading
Loading

src/WPF/WPF.Viewer/Samples/Geometry/NearestVertex/NearestVertex.xaml.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
using Esri.ArcGISRuntime.Geometry;
1111
using Esri.ArcGISRuntime.Mapping;
12+
using Esri.ArcGISRuntime.Portal;
1213
using Esri.ArcGISRuntime.Symbology;
1314
using Esri.ArcGISRuntime.UI;
1415
using Esri.ArcGISRuntime.UI.Controls;
@@ -23,6 +24,7 @@ namespace ArcGIS.WPF.Samples.NearestVertex
2324
description: "Find the closest vertex and coordinate of a geometry to a point.",
2425
instructions: "Click anywhere on the map. An orange cross will show at that location. A blue circle will show the polygon's nearest vertex to the point that was clicked. A red diamond will appear at the coordinate on the geometry that is nearest to the point that was clicked. If clicked inside the geometry, the red and orange markers will overlap. The information box showing distance between the clicked point and the nearest vertex/coordinate will be updated with every new location clicked.",
2526
tags: new[] { "analysis", "coordinate", "geometry", "nearest", "proximity", "vertex" })]
27+
[ArcGIS.Samples.Shared.Attributes.OfflineData("8c2d6d7df8fa4142b0a1211c8dd66903")]
2628
public partial class NearestVertex
2729
{
2830
// Hold references to the graphics overlay and the polygon graphic.
@@ -53,8 +55,9 @@ private async Task Initialize()
5355
MyMapView.Map = new Map(californiaZone5SpatialReference);
5456

5557
// Create the feature layer.
56-
Uri uriLayerSource = new Uri("https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_States_Generalized/FeatureServer/0");
57-
FeatureLayer usaStatesFeatureLayer = new FeatureLayer(uriLayerSource);
58+
ArcGISPortal portal = await ArcGISPortal.CreateAsync();
59+
PortalItem portalItem = await PortalItem.CreateAsync(portal, "8c2d6d7df8fa4142b0a1211c8dd66903");
60+
FeatureLayer usaStatesFeatureLayer = new FeatureLayer(portalItem);
5861

5962
// Add the feature layer to the MapView.
6063
MyMapView.Map.OperationalLayers.Add(usaStatesFeatureLayer);
Loading

src/WinUI/ArcGIS.WinUI.Viewer/Samples/Geometry/NearestVertex/NearestVertex.xaml.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99

1010
using Esri.ArcGISRuntime.Geometry;
1111
using Esri.ArcGISRuntime.Mapping;
12+
using Esri.ArcGISRuntime.Portal;
1213
using Esri.ArcGISRuntime.Symbology;
1314
using Esri.ArcGISRuntime.UI;
1415
using Esri.ArcGISRuntime.UI.Controls;
15-
using System;
16+
using System.Threading.Tasks;
1617

1718
namespace ArcGIS.WinUI.Samples.NearestVertex
1819
{
@@ -22,6 +23,7 @@ namespace ArcGIS.WinUI.Samples.NearestVertex
2223
description: "Find the closest vertex and coordinate of a geometry to a point.",
2324
instructions: "Click anywhere on the map. An orange cross will show at that location. A blue circle will show the polygon's nearest vertex to the point that was clicked. A red diamond will appear at the coordinate on the geometry that is nearest to the point that was clicked. If clicked inside the geometry, the red and orange markers will overlap. The information box showing distance between the clicked point and the nearest vertex/coordinate will be updated with every new location clicked.",
2425
tags: new[] { "analysis", "coordinate", "geometry", "nearest", "proximity", "vertex" })]
26+
[ArcGIS.Samples.Shared.Attributes.OfflineData("8c2d6d7df8fa4142b0a1211c8dd66903")]
2527
public partial class NearestVertex
2628
{
2729
// Hold references to the graphics overlay and the polygon graphic.
@@ -38,10 +40,10 @@ public NearestVertex()
3840
InitializeComponent();
3941

4042
// Create the map, set the initial extent, and add the original point graphic.
41-
Initialize();
43+
_ = Initialize();
4244
}
4345

44-
private void Initialize()
46+
private async Task Initialize()
4547
{
4648
// Planar distances are only accurate for geometries that have a defined projected coordinate system.
4749
// Create a spatial reference using the California zone 5 (ftUS) state plane coordinate system.
@@ -52,8 +54,9 @@ private void Initialize()
5254
MyMapView.Map = new Map(californiaZone5SpatialReference);
5355

5456
// Create the feature layer.
55-
Uri uriLayerSource = new Uri("https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_States_Generalized/FeatureServer/0");
56-
FeatureLayer usaStatesFeatureLayer = new FeatureLayer(uriLayerSource);
57+
ArcGISPortal portal = await ArcGISPortal.CreateAsync();
58+
PortalItem portalItem = await PortalItem.CreateAsync(portal, "8c2d6d7df8fa4142b0a1211c8dd66903");
59+
FeatureLayer usaStatesFeatureLayer = new FeatureLayer(portalItem);
5760

5861
// Add the feature layer to the MapView.
5962
MyMapView.Map.OperationalLayers.Add(usaStatesFeatureLayer);

0 commit comments

Comments
 (0)