diff --git a/src/Android/Xamarin.Android/ArcGISRuntime.Xamarin.Samples.Android.csproj b/src/Android/Xamarin.Android/ArcGISRuntime.Xamarin.Samples.Android.csproj index 7b3738b7f1..8e545a635a 100644 --- a/src/Android/Xamarin.Android/ArcGISRuntime.Xamarin.Samples.Android.csproj +++ b/src/Android/Xamarin.Android/ArcGISRuntime.Xamarin.Samples.Android.csproj @@ -718,7 +718,7 @@ - + Designer MSBuild:UpdateGeneratedFiles diff --git a/src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.axml b/src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.xml similarity index 100% rename from src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.axml rename to src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.xml diff --git a/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs b/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs index fea72ea885..de756d8efd 100644 --- a/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs +++ b/src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs @@ -81,7 +81,7 @@ private async Task Initialize() { // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "editor01"; - string sampleServer7Pass = "editor01.password"; + string sampleServer7Pass = "S7#i2LWmYH75"; return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) @@ -100,7 +100,7 @@ private async Task Initialize() _protectionSpinner.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, _accessLevels.Select(l => Enum.GetName(typeof(VersionAccess), l)).ToList()); // Create and load a service geodatabase. - _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0")); + _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/DamageAssessment/FeatureServer/0")); await _serviceGeodatabase.LoadAsync(); // When the service geodatabase has loaded get the default version name. diff --git a/src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs b/src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs index 4b897059ed..206efb0860 100644 --- a/src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs +++ b/src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs @@ -60,7 +60,7 @@ protected override void OnCreate(Bundle bundle) private async Task Initialize() { // Create a raster layer using an image service. - _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer")); + _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer")); RasterLayer rasterLayer = new RasterLayer(_imageServiceRaster); await rasterLayer.LoadAsync(); diff --git a/src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/readme.md b/src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/readme.md index be7e94dda7..4dbb64cc62 100644 --- a/src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/readme.md +++ b/src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/readme.md @@ -32,7 +32,7 @@ When the rasters are loaded, choose from a list of preset mosaic rules to apply ## About the data -This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. +This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. ## Additional information diff --git a/src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs b/src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs index ec7d114308..7cae252073 100644 --- a/src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs +++ b/src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -14,9 +14,11 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI.Controls; using System; +using System.Diagnostics; namespace ArcGISRuntimeXamarin.Samples.DisplaySubtypeFeatureLayer { @@ -59,6 +61,23 @@ protected override void OnCreate(Bundle bundle) private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Starting viewpoint for the map view. @@ -68,7 +87,7 @@ private async void Initialize() _myMapView.Map = new Map(BasemapStyle.ArcGISStreetsNight) { InitialViewpoint = _startingViewpoint }; // NOTE: This layer supports any ArcGIS Feature Table that define subtypes. - SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100"))); + SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0"))); _myMapView.Map.OperationalLayers.Add(subtypeFeatureLayer); // Select sublayer to control. diff --git a/src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md b/src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md index de8c49a589..4b2721d95a 100644 --- a/src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md +++ b/src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md @@ -30,8 +30,12 @@ The sample loads with the sublayer visible on the map. Change the sublayer's vis ## About the data -The [feature service layer](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. +The [feature service layer](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range \ No newline at end of file +asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range diff --git a/src/Android/Xamarin.Android/Samples/Map/ApplyScheduledUpdates/readme.md b/src/Android/Xamarin.Android/Samples/Map/ApplyScheduledUpdates/readme.md index addd711121..61d006ee36 100644 --- a/src/Android/Xamarin.Android/Samples/Map/ApplyScheduledUpdates/readme.md +++ b/src/Android/Xamarin.Android/Samples/Map/ApplyScheduledUpdates/readme.md @@ -50,4 +50,4 @@ The data in this sample shows the roads and trails in the Canyonlands National P ## Tags -offline, preplanned, pre-planned, synchronize, update \ No newline at end of file +offline, preplanned, pre-planned, synchronize, update diff --git a/src/Android/Xamarin.Android/Samples/Map/DownloadPreplannedMap/readme.md b/src/Android/Xamarin.Android/Samples/Map/DownloadPreplannedMap/readme.md index fbae76d8ee..d836dadf87 100644 --- a/src/Android/Xamarin.Android/Samples/Map/DownloadPreplannedMap/readme.md +++ b/src/Android/Xamarin.Android/Samples/Map/DownloadPreplannedMap/readme.md @@ -49,4 +49,4 @@ For more information about offline workflows, see [Offline maps, scenes, and dat ## Tags -map area, offline, pre-planned, preplanned \ No newline at end of file +map area, offline, pre-planned, preplanned diff --git a/src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs b/src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs index 43c3450e48..14ef3b9124 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs +++ b/src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -15,6 +15,7 @@ using Android.Widget; using ArcGISRuntime; using Esri.ArcGISRuntime.Data; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; @@ -45,7 +46,7 @@ public class ConfigureSubnetworkTrace : Activity private View _mainView; // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; private UtilityNetwork _utilityNetwork; // For creating the default starting location. @@ -90,6 +91,23 @@ protected override void OnCreate(Bundle bundle) private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Disable interaction until the data is loaded. diff --git a/src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/readme.md b/src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/readme.md index 5058f89ac4..8c0ea6c8cf 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/readme.md +++ b/src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/readme.md @@ -58,8 +58,12 @@ Example barrier conditions for the default dataset: ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency \ No newline at end of file +category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency diff --git a/src/Android/Xamarin.Android/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.cs b/src/Android/Xamarin.Android/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.cs index 12be64a7ff..aeb2ef4621 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.cs +++ b/src/Android/Xamarin.Android/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -13,6 +13,7 @@ using Esri.ArcGISRuntime; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; @@ -41,7 +42,7 @@ public class DisplayUtilityAssociations : Activity private ImageView _attachmentImageView; // Feature server for the utility network. - private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // This viewpoint shows several associations clearly in the utility network. private readonly Viewpoint InitialViewpoint = new Viewpoint(new MapPoint(-9812697.41544719, 5131928.28213524, SpatialReferences.WebMercator), 73.4352610787649); @@ -67,6 +68,24 @@ protected override void OnCreate(Bundle bundle) private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Create the utility network. diff --git a/src/Android/Xamarin.Android/Samples/Utility network/DisplayUtilityAssociations/readme.md b/src/Android/Xamarin.Android/Samples/Utility network/DisplayUtilityAssociations/readme.md index b2fd5dd45f..73eb5e7512 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/DisplayUtilityAssociations/readme.md +++ b/src/Android/Xamarin.Android/Samples/Utility network/DisplayUtilityAssociations/readme.md @@ -34,8 +34,12 @@ Pan and zoom around the map. Observe graphics that show utility associations bet ## About the data -The [feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. +The [feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -associating, association, attachment, connectivity, containment, relationships \ No newline at end of file +associating, association, attachment, connectivity, containment, relationships diff --git a/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.cs b/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.cs index 6bd3f2811f..9a5b92d6cd 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.cs +++ b/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.cs @@ -14,6 +14,7 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; @@ -31,7 +32,7 @@ namespace ArcGISRuntimeXamarin.Samples.PerformValveIsolationTrace description: "Run a filtered trace to locate operable features that will isolate an area from the flow of network resources.", instructions: "Create and set the configuration's filter barriers by selecting a category. Check or uncheck 'Include Isolated Features'. Tap 'Trace' to run a subnetwork-based isolation trace.", tags: new[] { "category comparison", "condition barriers", "isolated features", "network analysis", "subnetwork trace", "trace configuration", "trace filter", "utility network" })] - [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("PerformValveIsolationTrace.axml")] + [ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("PerformValveIsolationTrace.xml")] public class PerformValveIsolationTrace : Activity { // Hold references to the UI controls. @@ -42,7 +43,7 @@ public class PerformValveIsolationTrace : Activity private ProgressBar _loadingBar; // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; private const int LineLayerId = 3; private const int DeviceLayerId = 0; private UtilityNetwork _utilityNetwork; @@ -73,6 +74,24 @@ protected override void OnCreate(Bundle bundle) private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Disable the UI. diff --git a/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/readme.md b/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/readme.md index ec521db265..761175b18d 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/readme.md +++ b/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/readme.md @@ -46,7 +46,11 @@ Create and set the configuration's filter barriers by selecting a category. Chec ## About the data -The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. +The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags diff --git a/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/readme.metadata.json b/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/readme.metadata.json index 5b9f2328a7..56990eb244 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/readme.metadata.json +++ b/src/Android/Xamarin.Android/Samples/Utility network/PerformValveIsolationTrace/readme.metadata.json @@ -40,7 +40,7 @@ "UtilityTraceType" ], "snippets": [ - "../../../Resources/layout/PerformValveIsolationTrace.axml", + "../../../Resources/layout/PerformValveIsolationTrace.xml", "PerformValveIsolationTrace.cs" ], "title": "Perform valve isolation trace" diff --git a/src/Android/Xamarin.Android/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.cs b/src/Android/Xamarin.Android/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.cs index 0e005964b4..647f424f6c 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.cs +++ b/src/Android/Xamarin.Android/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.cs @@ -16,6 +16,7 @@ using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Http; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; @@ -51,7 +52,7 @@ public class TraceUtilityNetwork : Activity private bool isAddingStart = true; // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // Viewpoint in the utility network area. private Viewpoint _startingViewpoint = new Viewpoint(new Envelope(-9812980.8041217551, 5128523.87694709, -9812798.4363710005, 5128627.6261982173, SpatialReferences.WebMercator)); @@ -82,6 +83,24 @@ protected override void OnCreate(Bundle bundle) private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { _progressBar.Visibility = Android.Views.ViewStates.Visible; @@ -94,14 +113,14 @@ private async void Initialize() }; // Add the layer with electric distribution lines. - FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/115")); + FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/3")); UniqueValue mediumVoltageValue = new UniqueValue("N/A", "Medium Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.DarkCyan, 3), 5); UniqueValue lowVoltageValue = new UniqueValue("N/A", "Low Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.DarkCyan, 3), 3); lineLayer.Renderer = new UniqueValueRenderer(new List() { "ASSETGROUP" }, new List() { mediumVoltageValue, lowVoltageValue }, "", new SimpleLineSymbol()); _myMapView.Map.OperationalLayers.Add(lineLayer); // Add the layer with electric devices. - FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/100")); + FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/0")); _myMapView.Map.OperationalLayers.Add(electricDevicelayer); // Set the selection color for features in the map view. diff --git a/src/Android/Xamarin.Android/Samples/Utility network/TraceUtilityNetwork/readme.md b/src/Android/Xamarin.Android/Samples/Utility network/TraceUtilityNetwork/readme.md index 4f9aff1d5a..7fdcaa8729 100644 --- a/src/Android/Xamarin.Android/Samples/Utility network/TraceUtilityNetwork/readme.md +++ b/src/Android/Xamarin.Android/Samples/Utility network/TraceUtilityNetwork/readme.md @@ -14,20 +14,21 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## How it works -1. Create a `MapView` and subscribe to its `GeoViewTapped` event. -2. Create and load a `Map` that contains `FeatureLayer`(s) that are part of a utility network. -3. Create and load a `UtilityNetwork` using the utility network feature service URL and the map created in step 2. -4. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. -5. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. -6. Create a `UtilityElement` for the identified feature. -7. Determine the type of this element using its `NetworkSource.SourceType` property. -8. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `Terminal` property with the selected terminal. -9. If an edge, set its `FractionAlongLine` property using `GeometryEngine.FractionAlong`. -10. Add this `UtilityElement` to a collection of starting locations or barriers. -11. Create `TraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). -12. Set the `TraceParameters.TraceConfiguration` with the utility tier's `TraceConfiguration` property. -13. Run a `UtilityNetwork.TraceAsync` with the specified parameters. -14. For every `FeatureLayer` in the map, select the features using the `UtilityElement.ObjectId` from the filtered list of `UtilityElementTraceResult.Elements`. +1. Create a `MapView` and subscribe to its `GeoViewTapped` event. +2. Create and load a `ServiceGeodatabase` with a feature service URL and get tables by their layer IDs. +3. Create a `Map` that contains `FeatureLayer`(s) created from the `ServiceGeodatabase`'s tables. +4. Create and load a `UtilityNetwork` with the same feature service URL and this `Map`. +5. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. +6. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. +7. Create a `UtilityElement` for the identified feature. +8. Determine the type of this element using its `UtilityNetworkSource.SourceType` property. +9. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `UtilityTerminal` property with the selected terminal. +10. If an edge, set its `FractionAlongEdge` property using `GeometryEngine.FractionAlong`. +11. Add this `UtilityElement` to a collection of starting locations or barriers. +12. Create `UtilityTraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). +13. Set the `UtilityTraceParameters.TraceConfiguration` with the tier's `UtilityTier.TraceConfiguration` property. +14. Run a `UtilityNetwork.TraceAsync` with the specified parameters. +15. For every `FeatureLayer` in the map, select the features returned with `GetFeaturesForElementsAsync` from the elements matching their `UtilityNetworkSource.FeatureTable` with the layer's `FeatureTable`. ## Relevant API @@ -49,8 +50,12 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency \ No newline at end of file +condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency diff --git a/src/Forms/Shared/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs b/src/Forms/Shared/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs index 6a42b84043..9bc98cef12 100644 --- a/src/Forms/Shared/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs +++ b/src/Forms/Shared/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs @@ -54,7 +54,7 @@ private async Task Initialize() { // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "editor01"; - string sampleServer7Pass = "editor01.password"; + string sampleServer7Pass = "S7#i2LWmYH75"; return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) @@ -74,7 +74,7 @@ private async Task Initialize() DamageBox.ItemsSource = _damageLevels; // Create and load a service geodatabase. - _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0")); + _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/DamageAssessment/FeatureServer/0")); await _serviceGeodatabase.LoadAsync(); // When the service geodatabase has loaded get the default version name. diff --git a/src/Forms/Shared/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs b/src/Forms/Shared/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs index b3282dd61f..2f2348cbe6 100644 --- a/src/Forms/Shared/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs +++ b/src/Forms/Shared/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs @@ -46,7 +46,7 @@ public ApplyMosaicRule() private async Task Initialize() { // Create a raster layer using an image service. - _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer")); + _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer")); RasterLayer rasterLayer = new RasterLayer(_imageServiceRaster); await rasterLayer.LoadAsync(); diff --git a/src/Forms/Shared/Samples/Layers/ApplyMosaicRule/readme.md b/src/Forms/Shared/Samples/Layers/ApplyMosaicRule/readme.md index be7e94dda7..4dbb64cc62 100644 --- a/src/Forms/Shared/Samples/Layers/ApplyMosaicRule/readme.md +++ b/src/Forms/Shared/Samples/Layers/ApplyMosaicRule/readme.md @@ -32,7 +32,7 @@ When the rasters are loaded, choose from a list of preset mosaic rules to apply ## About the data -This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. +This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. ## Additional information diff --git a/src/Forms/Shared/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs b/src/Forms/Shared/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs index 1209c78358..c1174d4054 100644 --- a/src/Forms/Shared/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs +++ b/src/Forms/Shared/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -10,9 +10,11 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using System; using System.ComponentModel; +using System.Diagnostics; using Xamarin.Forms; namespace ArcGISRuntimeXamarin.Samples.DisplaySubtypeFeatureLayer @@ -43,6 +45,23 @@ public DisplaySubtypeFeatureLayer() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Starting viewpoint for the map view. @@ -52,7 +71,7 @@ private async void Initialize() MyMapView.Map = new Map(BasemapStyle.ArcGISStreetsNight) { InitialViewpoint = _startingViewpoint }; // NOTE: This layer supports any ArcGIS Feature Table that define subtypes. - SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100"))); + SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0"))); MyMapView.Map.OperationalLayers.Add(subtypeFeatureLayer); // Select sublayer to control. diff --git a/src/Forms/Shared/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md b/src/Forms/Shared/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md index de8c49a589..4b2721d95a 100644 --- a/src/Forms/Shared/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md +++ b/src/Forms/Shared/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md @@ -30,8 +30,12 @@ The sample loads with the sublayer visible on the map. Change the sublayer's vis ## About the data -The [feature service layer](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. +The [feature service layer](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range \ No newline at end of file +asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range diff --git a/src/Forms/Shared/Samples/Map/ApplyScheduledUpdates/readme.md b/src/Forms/Shared/Samples/Map/ApplyScheduledUpdates/readme.md index b6bc5676f5..b49b4e9a1d 100644 --- a/src/Forms/Shared/Samples/Map/ApplyScheduledUpdates/readme.md +++ b/src/Forms/Shared/Samples/Map/ApplyScheduledUpdates/readme.md @@ -50,4 +50,4 @@ The data in this sample shows the roads and trails in the Canyonlands National P ## Tags -offline, preplanned, pre-planned, synchronize, update \ No newline at end of file +offline, preplanned, pre-planned, synchronize, update diff --git a/src/Forms/Shared/Samples/Map/DownloadPreplannedMap/readme.md b/src/Forms/Shared/Samples/Map/DownloadPreplannedMap/readme.md index fbae76d8ee..d836dadf87 100644 --- a/src/Forms/Shared/Samples/Map/DownloadPreplannedMap/readme.md +++ b/src/Forms/Shared/Samples/Map/DownloadPreplannedMap/readme.md @@ -49,4 +49,4 @@ For more information about offline workflows, see [Offline maps, scenes, and dat ## Tags -map area, offline, pre-planned, preplanned \ No newline at end of file +map area, offline, pre-planned, preplanned diff --git a/src/Forms/Shared/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs b/src/Forms/Shared/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs index 21fc60a70d..c5201b9c7c 100644 --- a/src/Forms/Shared/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs +++ b/src/Forms/Shared/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -8,9 +8,11 @@ // language governing permissions and limitations under the License. using Esri.ArcGISRuntime.Data; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Xamarin.Forms; @@ -25,7 +27,7 @@ namespace ArcGISRuntimeXamarin.Samples.ConfigureSubnetworkTrace public partial class ConfigureSubnetworkTrace : ContentPage { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; private UtilityNetwork _utilityNetwork; private UtilityTier _sourceTier; @@ -51,6 +53,23 @@ public ConfigureSubnetworkTrace() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { ConfigureTable.IsEnabled = false; diff --git a/src/Forms/Shared/Samples/Utility network/ConfigureSubnetworkTrace/readme.md b/src/Forms/Shared/Samples/Utility network/ConfigureSubnetworkTrace/readme.md index 5058f89ac4..8c0ea6c8cf 100644 --- a/src/Forms/Shared/Samples/Utility network/ConfigureSubnetworkTrace/readme.md +++ b/src/Forms/Shared/Samples/Utility network/ConfigureSubnetworkTrace/readme.md @@ -58,8 +58,12 @@ Example barrier conditions for the default dataset: ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency \ No newline at end of file +category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency diff --git a/src/Forms/Shared/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs b/src/Forms/Shared/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs index 5097d4b40f..e0f1dd8e9a 100644 --- a/src/Forms/Shared/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs +++ b/src/Forms/Shared/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -10,11 +10,13 @@ using Esri.ArcGISRuntime; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Xamarin.Forms; using Color = System.Drawing.Color; @@ -30,7 +32,7 @@ namespace ArcGISRuntimeXamarin.Samples.DisplayUtilityAssociations public partial class DisplayUtilityAssociations : ContentPage { // Feature server for the utility network. - private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // This viewpoint shows several associations clearly in the utility network. private readonly Viewpoint InitialViewpoint = new Viewpoint(new MapPoint(-9812697.41544719, 5131928.28213524, SpatialReferences.WebMercator), 73.4352610787649); @@ -52,6 +54,24 @@ public DisplayUtilityAssociations() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Create the utility network. @@ -95,11 +115,10 @@ private async void Initialize() var connectivityValue = new UniqueValue("Connectivity", string.Empty, connectivitySymbol, UtilityAssociationType.Connectivity.ToString()); _associationsOverlay.Renderer = new UniqueValueRenderer(new List { "AssociationType" }, new List { attachmentValue, connectivityValue }, string.Empty, null); - // Populate the legend in the UI. RuntimeImage attachmentSwatch = await attachmentSymbol.CreateSwatchAsync(); AttachmentImage.Source = await Esri.ArcGISRuntime.Xamarin.Forms.RuntimeImageExtensions.ToImageSourceAsync(attachmentSwatch); - + RuntimeImage connectSwatch = await connectivitySymbol.CreateSwatchAsync(); ConnectivityImage.Source = await Esri.ArcGISRuntime.Xamarin.Forms.RuntimeImageExtensions.ToImageSourceAsync(connectSwatch); diff --git a/src/Forms/Shared/Samples/Utility network/DisplayUtilityAssociations/readme.md b/src/Forms/Shared/Samples/Utility network/DisplayUtilityAssociations/readme.md index b2fd5dd45f..73eb5e7512 100644 --- a/src/Forms/Shared/Samples/Utility network/DisplayUtilityAssociations/readme.md +++ b/src/Forms/Shared/Samples/Utility network/DisplayUtilityAssociations/readme.md @@ -34,8 +34,12 @@ Pan and zoom around the map. Observe graphics that show utility associations bet ## About the data -The [feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. +The [feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -associating, association, attachment, connectivity, containment, relationships \ No newline at end of file +associating, association, attachment, connectivity, containment, relationships diff --git a/src/Forms/Shared/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs b/src/Forms/Shared/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs index e39879909a..b614fa5a67 100644 --- a/src/Forms/Shared/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs +++ b/src/Forms/Shared/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs @@ -10,6 +10,7 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UtilityNetworks; @@ -29,7 +30,7 @@ namespace ArcGISRuntimeXamarin.Samples.PerformValveIsolationTrace public partial class PerformValveIsolationTrace : ContentPage { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; private const int LineLayerId = 3; private const int DeviceLayerId = 0; private UtilityNetwork _utilityNetwork; @@ -54,6 +55,24 @@ public PerformValveIsolationTrace() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Disable the UI. diff --git a/src/Forms/Shared/Samples/Utility network/PerformValveIsolationTrace/readme.md b/src/Forms/Shared/Samples/Utility network/PerformValveIsolationTrace/readme.md index ec521db265..761175b18d 100644 --- a/src/Forms/Shared/Samples/Utility network/PerformValveIsolationTrace/readme.md +++ b/src/Forms/Shared/Samples/Utility network/PerformValveIsolationTrace/readme.md @@ -46,7 +46,11 @@ Create and set the configuration's filter barriers by selecting a category. Chec ## About the data -The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. +The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags diff --git a/src/Forms/Shared/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs b/src/Forms/Shared/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs index da0da24ce4..992f0287fd 100644 --- a/src/Forms/Shared/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs +++ b/src/Forms/Shared/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs @@ -11,6 +11,7 @@ using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Http; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UtilityNetworks; @@ -20,7 +21,6 @@ using System.Linq; using System.Threading.Tasks; using Xamarin.Forms; -using SelectionMode = Esri.ArcGISRuntime.Mapping.SelectionMode; namespace ArcGISRuntimeXamarin.Samples.TraceUtilityNetwork { @@ -34,7 +34,7 @@ namespace ArcGISRuntimeXamarin.Samples.TraceUtilityNetwork public partial class TraceUtilityNetwork : ContentPage { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // Viewpoint in the utility network area. private Viewpoint _startingViewpoint = new Viewpoint(new Envelope(-9812980.8041217551, 5128523.87694709, -9812798.4363710005, 5128627.6261982173, SpatialReferences.WebMercator)); @@ -61,6 +61,24 @@ public TraceUtilityNetwork() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { BusyIndicator.IsVisible = true; @@ -73,14 +91,14 @@ private async void Initialize() }; // Add the layer with electric distribution lines. - FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/115")); + FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/3")); UniqueValue mediumVoltageValue = new UniqueValue("N/A", "Medium Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.DarkCyan, 3), 5); UniqueValue lowVoltageValue = new UniqueValue("N/A", "Low Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.DarkCyan, 3), 3); lineLayer.Renderer = new UniqueValueRenderer(new List() { "ASSETGROUP" }, new List() { mediumVoltageValue, lowVoltageValue }, "", new SimpleLineSymbol()); MyMapView.Map.OperationalLayers.Add(lineLayer); // Add the layer with electric devices. - FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/100")); + FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/0")); MyMapView.Map.OperationalLayers.Add(electricDevicelayer); // Set the selection color for features in the map view. diff --git a/src/Forms/Shared/Samples/Utility network/TraceUtilityNetwork/readme.md b/src/Forms/Shared/Samples/Utility network/TraceUtilityNetwork/readme.md index 4f9aff1d5a..7fdcaa8729 100644 --- a/src/Forms/Shared/Samples/Utility network/TraceUtilityNetwork/readme.md +++ b/src/Forms/Shared/Samples/Utility network/TraceUtilityNetwork/readme.md @@ -14,20 +14,21 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## How it works -1. Create a `MapView` and subscribe to its `GeoViewTapped` event. -2. Create and load a `Map` that contains `FeatureLayer`(s) that are part of a utility network. -3. Create and load a `UtilityNetwork` using the utility network feature service URL and the map created in step 2. -4. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. -5. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. -6. Create a `UtilityElement` for the identified feature. -7. Determine the type of this element using its `NetworkSource.SourceType` property. -8. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `Terminal` property with the selected terminal. -9. If an edge, set its `FractionAlongLine` property using `GeometryEngine.FractionAlong`. -10. Add this `UtilityElement` to a collection of starting locations or barriers. -11. Create `TraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). -12. Set the `TraceParameters.TraceConfiguration` with the utility tier's `TraceConfiguration` property. -13. Run a `UtilityNetwork.TraceAsync` with the specified parameters. -14. For every `FeatureLayer` in the map, select the features using the `UtilityElement.ObjectId` from the filtered list of `UtilityElementTraceResult.Elements`. +1. Create a `MapView` and subscribe to its `GeoViewTapped` event. +2. Create and load a `ServiceGeodatabase` with a feature service URL and get tables by their layer IDs. +3. Create a `Map` that contains `FeatureLayer`(s) created from the `ServiceGeodatabase`'s tables. +4. Create and load a `UtilityNetwork` with the same feature service URL and this `Map`. +5. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. +6. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. +7. Create a `UtilityElement` for the identified feature. +8. Determine the type of this element using its `UtilityNetworkSource.SourceType` property. +9. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `UtilityTerminal` property with the selected terminal. +10. If an edge, set its `FractionAlongEdge` property using `GeometryEngine.FractionAlong`. +11. Add this `UtilityElement` to a collection of starting locations or barriers. +12. Create `UtilityTraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). +13. Set the `UtilityTraceParameters.TraceConfiguration` with the tier's `UtilityTier.TraceConfiguration` property. +14. Run a `UtilityNetwork.TraceAsync` with the specified parameters. +15. For every `FeatureLayer` in the map, select the features returned with `GetFeaturesForElementsAsync` from the elements matching their `UtilityNetworkSource.FeatureTable` with the layer's `FeatureTable`. ## Relevant API @@ -49,8 +50,12 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency \ No newline at end of file +condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs index 0f229b0682..163bc8ad8d 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs @@ -55,7 +55,7 @@ private async Task Initialize() { // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "editor01"; - string sampleServer7Pass = "editor01.password"; + string sampleServer7Pass = "S7#i2LWmYH75"; return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) @@ -75,7 +75,7 @@ private async Task Initialize() DamageBox.ItemsSource = new List { "Destroyed", "Inaccessible", "Major", "Minor", "Affected" }; // Create and load a service geodatabase. - _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0")); + _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/DamageAssessment/FeatureServer/0")); await _serviceGeodatabase.LoadAsync(); // When the service geodatabase has loaded get the default version name. diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs index 7c4cf07931..876bff6a06 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs @@ -54,7 +54,7 @@ public ApplyMosaicRule() private async Task Initialize() { // Create a raster layer using an image service. - _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer")); + _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer")); RasterLayer rasterLayer = new RasterLayer(_imageServiceRaster); await rasterLayer.LoadAsync(); diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/ApplyMosaicRule/readme.md b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/ApplyMosaicRule/readme.md index be7e94dda7..4dbb64cc62 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/ApplyMosaicRule/readme.md +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/ApplyMosaicRule/readme.md @@ -32,7 +32,7 @@ When the rasters are loaded, choose from a list of preset mosaic rules to apply ## About the data -This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. +This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. ## Additional information diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs index 6b452a3710..19488d72c2 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -10,8 +10,10 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using System; +using System.Diagnostics; using System.Drawing; using Windows.UI.Popups; using Windows.UI.Xaml; @@ -44,6 +46,23 @@ public DisplaySubtypeFeatureLayer() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Starting viewpoint for the map view. @@ -53,7 +72,7 @@ private async void Initialize() MyMapView.Map = new Map(BasemapStyle.ArcGISStreetsNight) { InitialViewpoint = _startingViewpoint }; // NOTE: This layer supports any ArcGIS Feature Table that define subtypes. - SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100"))); + SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0"))); MyMapView.Map.OperationalLayers.Add(subtypeFeatureLayer); // Select sublayer to control. diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md index de8c49a589..4b2721d95a 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md @@ -30,8 +30,12 @@ The sample loads with the sublayer visible on the map. Change the sublayer's vis ## About the data -The [feature service layer](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. +The [feature service layer](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range \ No newline at end of file +asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md index 538cfa5827..aa283710a3 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md @@ -50,4 +50,4 @@ The data in this sample shows the roads and trails in the Canyonlands National P ## Tags -offline, preplanned, pre-planned, synchronize, update \ No newline at end of file +offline, preplanned, pre-planned, synchronize, update diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Map/DownloadPreplannedMap/readme.md b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Map/DownloadPreplannedMap/readme.md index ba957516a4..b0bd4637bc 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Map/DownloadPreplannedMap/readme.md +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Map/DownloadPreplannedMap/readme.md @@ -49,4 +49,4 @@ For more information about offline workflows, see [Offline maps, scenes, and dat ## Tags -map area, offline, pre-planned, preplanned \ No newline at end of file +map area, offline, pre-planned, preplanned diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs index 2f4562d553..9965153039 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -8,9 +8,11 @@ // language governing permissions and limitations under the License. using Esri.ArcGISRuntime.Data; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Windows.UI.Popups; using Windows.UI.Xaml; @@ -27,7 +29,7 @@ namespace ArcGISRuntime.UWP.Samples.ConfigureSubnetworkTrace public partial class ConfigureSubnetworkTrace { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; private UtilityNetwork _utilityNetwork; // For creating the default starting location. @@ -57,6 +59,23 @@ public ConfigureSubnetworkTrace() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Create and load the utility network. diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md index bd67ed5ee0..a038d3565d 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md @@ -58,8 +58,12 @@ Example barrier conditions for the default dataset: ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency \ No newline at end of file +category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs index def417d0fd..07dd9dd506 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -10,11 +10,13 @@ using Esri.ArcGISRuntime; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.Linq; using Windows.UI.Popups; @@ -32,7 +34,7 @@ namespace ArcGISRuntime.UWP.Samples.DisplayUtilityAssociations public partial class DisplayUtilityAssociations { // Feature server for the utility network. - private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // This viewpoint shows several associations clearly in the utility network. private readonly Viewpoint InitialViewpoint = new Viewpoint(new MapPoint(-9812698.37297436, 5131928.33743317, SpatialReferences.WebMercator), 22d); @@ -54,6 +56,24 @@ public DisplayUtilityAssociations() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Create the utility network. diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md index b2fd5dd45f..73eb5e7512 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md @@ -34,8 +34,12 @@ Pan and zoom around the map. Observe graphics that show utility associations bet ## About the data -The [feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. +The [feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -associating, association, attachment, connectivity, containment, relationships \ No newline at end of file +associating, association, attachment, connectivity, containment, relationships diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs index 95f66047e7..d0f48ea88c 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs @@ -10,6 +10,7 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UtilityNetworks; @@ -30,7 +31,7 @@ namespace ArcGISRuntime.UWP.Samples.PerformValveIsolationTrace public partial class PerformValveIsolationTrace { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; private const int LineLayerId = 3; private const int DeviceLayerId = 0; private UtilityNetwork _utilityNetwork; @@ -55,6 +56,24 @@ public PerformValveIsolationTrace() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Disable the UI. diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md index 73e214e1e8..59e92cc614 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md @@ -46,7 +46,11 @@ Create and set the configuration's filter barriers by selecting a category. Chec ## About the data -The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. +The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs index 9cfb2a3cc0..26d0d15b09 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs @@ -11,12 +11,14 @@ using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Http; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Windows.UI.Popups; @@ -35,7 +37,7 @@ namespace ArcGISRuntime.UWP.Samples.TraceUtilityNetwork public partial class TraceUtilityNetwork { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // Viewpoint in the utility network area. private Viewpoint _startingViewpoint = new Viewpoint(new Envelope(-9812980.8041217551, 5128523.87694709, -9812798.4363710005, 5128627.6261982173, SpatialReferences.WebMercator)); @@ -61,6 +63,24 @@ public TraceUtilityNetwork() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { IsBusy.Visibility = Visibility.Visible; @@ -73,14 +93,14 @@ private async void Initialize() }; // Add the layer with electric distribution lines. - FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/115")); + FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/3")); UniqueValue mediumVoltageValue = new UniqueValue("N/A", "Medium Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.DarkCyan, 3), 5); UniqueValue lowVoltageValue = new UniqueValue("N/A", "Low Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.DarkCyan, 3), 3); lineLayer.Renderer = new UniqueValueRenderer(new List() { "ASSETGROUP" }, new List() { mediumVoltageValue, lowVoltageValue }, "", new SimpleLineSymbol()); MyMapView.Map.OperationalLayers.Add(lineLayer); // Add the layer with electric devices. - FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/100")); + FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/0")); MyMapView.Map.OperationalLayers.Add(electricDevicelayer); // Set the selection color for features in the map view. diff --git a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md index fe9279869b..a3c1812c15 100644 --- a/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md +++ b/src/UWP/ArcGISRuntime.UWP.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md @@ -14,20 +14,21 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## How it works -1. Create a `MapView` and subscribe to its `GeoViewTapped` event. -2. Create and load a `Map` that contains `FeatureLayer`(s) that are part of a utility network. -3. Create and load a `UtilityNetwork` using the utility network feature service URL and the map created in step 2. -4. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. -5. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. -6. Create a `UtilityElement` for the identified feature. -7. Determine the type of this element using its `NetworkSource.SourceType` property. -8. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `Terminal` property with the selected terminal. -9. If an edge, set its `FractionAlongLine` property using `GeometryEngine.FractionAlong`. -10. Add this `UtilityElement` to a collection of starting locations or barriers. -11. Create `TraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). -12. Set the `TraceParameters.TraceConfiguration` with the utility tier's `TraceConfiguration` property. -13. Run a `UtilityNetwork.TraceAsync` with the specified parameters. -14. For every `FeatureLayer` in the map, select the features using the `UtilityElement.ObjectId` from the filtered list of `UtilityElementTraceResult.Elements`. +1. Create a `MapView` and subscribe to its `GeoViewTapped` event. +2. Create and load a `ServiceGeodatabase` with a feature service URL and get tables by their layer IDs. +3. Create a `Map` that contains `FeatureLayer`(s) created from the `ServiceGeodatabase`'s tables. +4. Create and load a `UtilityNetwork` with the same feature service URL and this `Map`. +5. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. +6. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. +7. Create a `UtilityElement` for the identified feature. +8. Determine the type of this element using its `UtilityNetworkSource.SourceType` property. +9. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `UtilityTerminal` property with the selected terminal. +10. If an edge, set its `FractionAlongEdge` property using `GeometryEngine.FractionAlong`. +11. Add this `UtilityElement` to a collection of starting locations or barriers. +12. Create `UtilityTraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). +13. Set the `UtilityTraceParameters.TraceConfiguration` with the tier's `UtilityTier.TraceConfiguration` property. +14. Run a `UtilityNetwork.TraceAsync` with the specified parameters. +15. For every `FeatureLayer` in the map, select the features returned with `GetFeaturesForElementsAsync` from the elements matching their `UtilityNetworkSource.FeatureTable` with the layer's `FeatureTable`. ## Relevant API @@ -49,8 +50,12 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency \ No newline at end of file +condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs index 3edecf3265..e0920edc4c 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Data/EditBranchVersioning/EditBranchVersioning.xaml.cs @@ -53,7 +53,7 @@ private async Task Initialize() { // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "editor01"; - string sampleServer7Pass = "editor01.password"; + string sampleServer7Pass = "S7#i2LWmYH75"; return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) @@ -73,7 +73,7 @@ private async Task Initialize() DamageBox.ItemsSource = new List { "Destroyed", "Inaccessible", "Major", "Minor", "Affected" }; // Create and load a service geodatabase. - _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0")); + _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/DamageAssessment/FeatureServer/0")); await _serviceGeodatabase.LoadAsync(); // When the service geodatabase has loaded get the default version name. diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Geoprocessing/AnalyzeViewshed/AnalyzeViewshed.xaml.cs b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Geoprocessing/AnalyzeViewshed/AnalyzeViewshed.xaml.cs index 8f710edbf3..d51d856fec 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Geoprocessing/AnalyzeViewshed/AnalyzeViewshed.xaml.cs +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Geoprocessing/AnalyzeViewshed/AnalyzeViewshed.xaml.cs @@ -17,9 +17,9 @@ using Esri.ArcGISRuntime.UI.Controls; using System; using System.Collections.Generic; +using System.Drawing; using System.Threading.Tasks; using System.Windows; -using System.Drawing; namespace ArcGISRuntime.WPF.Samples.AnalyzeViewshed { @@ -131,7 +131,6 @@ private async Task CalculateViewshed(MapPoint location) GeoprocessingParameters myViewshedParameters = new GeoprocessingParameters(GeoprocessingExecutionType.SynchronousExecute) { - // Request the output features to use the same SpatialReference as the map view OutputSpatialReference = MyMapView.SpatialReference }; diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs index c15bc259a7..1b5977a757 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.xaml.cs @@ -44,7 +44,7 @@ public ApplyMosaicRule() private async Task Initialize() { // Create a raster layer using an image service. - _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer")); + _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer")); RasterLayer rasterLayer = new RasterLayer(_imageServiceRaster); await rasterLayer.LoadAsync(); diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/ApplyMosaicRule/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/ApplyMosaicRule/readme.md index be7e94dda7..4dbb64cc62 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/ApplyMosaicRule/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/ApplyMosaicRule/readme.md @@ -32,7 +32,7 @@ When the rasters are loaded, choose from a list of preset mosaic rules to apply ## About the data -This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. +This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. ## Additional information diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs index 306fa97ea2..9941014c8d 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.xaml.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -10,8 +10,10 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using System; +using System.Diagnostics; using System.Drawing; using System.Windows; @@ -43,6 +45,23 @@ public DisplaySubtypeFeatureLayer() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Starting viewpoint for the map view. @@ -52,7 +71,7 @@ private async void Initialize() MyMapView.Map = new Map(BasemapStyle.ArcGISStreetsNight) { InitialViewpoint = _startingViewpoint }; // NOTE: This layer supports any ArcGIS Feature Table that define subtypes. - SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100"))); + SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0"))); MyMapView.Map.OperationalLayers.Add(subtypeFeatureLayer); // Select sublayer to control. diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md index de8c49a589..4b2721d95a 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md @@ -30,8 +30,12 @@ The sample loads with the sublayer visible on the map. Change the sublayer's vis ## About the data -The [feature service layer](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. +The [feature service layer](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range \ No newline at end of file +asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md index 0b1d20aee3..040eca1cf8 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md @@ -46,8 +46,8 @@ The data in this sample shows the roads and trails in the Canyonlands National P ## Additional information -**Note:** preplanned areas using the Scheduled Updates workflow are read-only. For preplanned areas that can be edited on the end-user device, see the [Download preplanned map area](https://developers.arcgis.com/net/wpf/sample-code/download-preplanned-map-area/) sample. For more information about offline workflows, see [Offline maps, scenes, and data](https://developers.arcgis.com/documentation/mapping-apis-and-location-services/offline-maps-scenes-and-data/) in the *ArcGIS Developers* guide. +**Note:** preplanned areas using the Scheduled Updates workflow are read-only. For preplanned areas that can be edited on the end-user device, see the [Download preplanned map area](https://developers.arcgis.com/net/wpf/sample-code/download-preplanned-map-area/) sample. For more information about offline workflows, see [Offline maps, scenes, and data](https://developers.arcgis.com/documentation/mapping-apis-and-location-services/offline/) in the *ArcGIS Developers* guide. ## Tags -offline, preplanned, pre-planned, synchronize, update \ No newline at end of file +offline, preplanned, pre-planned, synchronize, update diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Map/DownloadPreplannedMap/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Map/DownloadPreplannedMap/readme.md index bde7deb09a..b0bd4637bc 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Map/DownloadPreplannedMap/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Map/DownloadPreplannedMap/readme.md @@ -45,8 +45,8 @@ The [Naperville stormwater network map](https://arcgisruntime.maps.arcgis.com/ho * `SyncWithFeatureServices` - Changes, including local edits, will be synced directly with the underlying feature services. This is the default update mode. * `DownloadScheduledUpdates` - Scheduled, read-only updates will be downloaded from the online map area and applied to the local mobile geodatabases. -For more information about offline workflows, see [Offline maps, scenes, and data](https://developers.arcgis.com/documentation/mapping-apis-and-location-services/offline-maps-scenes-and-data/) in the *ArcGIS Developers* guide. +For more information about offline workflows, see [Offline maps, scenes, and data](https://developers.arcgis.com/documentation/mapping-apis-and-location-services/offline/) in the *ArcGIS Developers* guide. ## Tags -map area, offline, pre-planned, preplanned \ No newline at end of file +map area, offline, pre-planned, preplanned diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Search/FindPlace/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Search/FindPlace/readme.md index 2da786a75c..96caa627bf 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Search/FindPlace/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Search/FindPlace/readme.md @@ -33,7 +33,7 @@ Choose a type of place in the first field and an area to search within in the se ## About the data -This sample uses the [Geocoding service](https://developers.arcgis.com/documentation/mapping-apis-and-location-services/geocode-and-search/services/geocoding-service/). +This sample uses the [Geocoding service](https://developers.arcgis.com/documentation/mapping-apis-and-location-services/search/services/geocoding-service/). ## Relevant API diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs index d0ca42a700..c030cb9e49 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.xaml.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -8,9 +8,11 @@ // language governing permissions and limitations under the License. using Esri.ArcGISRuntime.Data; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Windows; using System.Windows.Controls; @@ -26,7 +28,7 @@ namespace ArcGISRuntime.WPF.Samples.ConfigureSubnetworkTrace public partial class ConfigureSubnetworkTrace { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; private UtilityNetwork _utilityNetwork; // For creating the default starting location. @@ -56,6 +58,23 @@ public ConfigureSubnetworkTrace() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { Configuration.IsEnabled = false; diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md index bd67ed5ee0..a038d3565d 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md @@ -58,8 +58,12 @@ Example barrier conditions for the default dataset: ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency \ No newline at end of file +category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs index 77420100cd..abf4e95072 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.xaml.cs @@ -10,11 +10,13 @@ using Esri.ArcGISRuntime; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.Linq; using System.Windows; @@ -30,7 +32,7 @@ namespace ArcGISRuntime.WPF.Samples.DisplayUtilityAssociations public partial class DisplayUtilityAssociations { // Feature server for the utility network. - private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // This viewpoint shows several associations clearly in the utility network. private readonly Viewpoint InitialViewpoint = new Viewpoint(new MapPoint(-9812698.37297436, 5131928.33743317, SpatialReferences.WebMercator), 22d); @@ -52,6 +54,24 @@ public DisplayUtilityAssociations() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Create the utility network. diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md index b2fd5dd45f..73eb5e7512 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md @@ -34,8 +34,12 @@ Pan and zoom around the map. Observe graphics that show utility associations bet ## About the data -The [feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. +The [feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -associating, association, attachment, connectivity, containment, relationships \ No newline at end of file +associating, association, attachment, connectivity, containment, relationships diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs index b154193eec..03f4ae07d0 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs @@ -10,6 +10,7 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UtilityNetworks; @@ -29,7 +30,7 @@ namespace ArcGISRuntime.WPF.Samples.PerformValveIsolationTrace public partial class PerformValveIsolationTrace { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; private const int LineLayerId = 3; private const int DeviceLayerId = 0; private UtilityNetwork _utilityNetwork; @@ -54,6 +55,24 @@ public PerformValveIsolationTrace() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Disable the UI. diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md index 73e214e1e8..59e92cc614 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md @@ -46,7 +46,11 @@ Create and set the configuration's filter barriers by selecting a category. Chec ## About the data -The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. +The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs index 69bcc275f9..14dc862edc 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs @@ -11,12 +11,14 @@ using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Http; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; using Esri.ArcGISRuntime.UtilityNetworks; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using System.Windows; @@ -33,7 +35,7 @@ namespace ArcGISRuntime.WPF.Samples.TraceUtilityNetwork public partial class TraceUtilityNetwork { // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // Viewpoint in the utility network area. private Viewpoint _startingViewpoint = new Viewpoint(new Envelope(-9812980.8041217551, 5128523.87694709, -9812798.4363710005, 5128627.6261982173, SpatialReferences.WebMercator)); @@ -59,6 +61,24 @@ public TraceUtilityNetwork() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { IsBusy.Visibility = Visibility.Visible; @@ -71,14 +91,14 @@ private async void Initialize() }; // Add the layer with electric distribution lines. - FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/115")); + FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/3")); UniqueValue mediumVoltageValue = new UniqueValue("N/A", "Medium Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.DarkCyan, 3), 5); UniqueValue lowVoltageValue = new UniqueValue("N/A", "Low Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.DarkCyan, 3), 3); lineLayer.Renderer = new UniqueValueRenderer(new List() { "ASSETGROUP" }, new List() { mediumVoltageValue, lowVoltageValue }, "", new SimpleLineSymbol()); MyMapView.Map.OperationalLayers.Add(lineLayer); // Add the layer with electric devices. - FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/100")); + FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/0")); MyMapView.Map.OperationalLayers.Add(electricDevicelayer); // Set the selection color for features in the map view. @@ -88,7 +108,7 @@ private async void Initialize() _utilityNetwork = await UtilityNetwork.CreateAsync(new Uri(FeatureServiceUrl), MyMapView.Map); // Update the trace configuration UI. - TraceTypes.ItemsSource = new List() {UtilityTraceType.Connected, UtilityTraceType.Subnetwork, UtilityTraceType.Upstream, UtilityTraceType.Downstream}; + TraceTypes.ItemsSource = new List() { UtilityTraceType.Connected, UtilityTraceType.Subnetwork, UtilityTraceType.Upstream, UtilityTraceType.Downstream }; TraceTypes.SelectedIndex = 0; // Get the utility tier used for traces in this network. For this data set, the "Medium Voltage Radial" tier from the "ElectricDistribution" domain network is used. diff --git a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md index fe9279869b..a3c1812c15 100644 --- a/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md +++ b/src/WPF/ArcGISRuntime.WPF.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md @@ -14,20 +14,21 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## How it works -1. Create a `MapView` and subscribe to its `GeoViewTapped` event. -2. Create and load a `Map` that contains `FeatureLayer`(s) that are part of a utility network. -3. Create and load a `UtilityNetwork` using the utility network feature service URL and the map created in step 2. -4. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. -5. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. -6. Create a `UtilityElement` for the identified feature. -7. Determine the type of this element using its `NetworkSource.SourceType` property. -8. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `Terminal` property with the selected terminal. -9. If an edge, set its `FractionAlongLine` property using `GeometryEngine.FractionAlong`. -10. Add this `UtilityElement` to a collection of starting locations or barriers. -11. Create `TraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). -12. Set the `TraceParameters.TraceConfiguration` with the utility tier's `TraceConfiguration` property. -13. Run a `UtilityNetwork.TraceAsync` with the specified parameters. -14. For every `FeatureLayer` in the map, select the features using the `UtilityElement.ObjectId` from the filtered list of `UtilityElementTraceResult.Elements`. +1. Create a `MapView` and subscribe to its `GeoViewTapped` event. +2. Create and load a `ServiceGeodatabase` with a feature service URL and get tables by their layer IDs. +3. Create a `Map` that contains `FeatureLayer`(s) created from the `ServiceGeodatabase`'s tables. +4. Create and load a `UtilityNetwork` with the same feature service URL and this `Map`. +5. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. +6. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. +7. Create a `UtilityElement` for the identified feature. +8. Determine the type of this element using its `UtilityNetworkSource.SourceType` property. +9. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `UtilityTerminal` property with the selected terminal. +10. If an edge, set its `FractionAlongEdge` property using `GeometryEngine.FractionAlong`. +11. Add this `UtilityElement` to a collection of starting locations or barriers. +12. Create `UtilityTraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). +13. Set the `UtilityTraceParameters.TraceConfiguration` with the tier's `UtilityTier.TraceConfiguration` property. +14. Run a `UtilityNetwork.TraceAsync` with the specified parameters. +15. For every `FeatureLayer` in the map, select the features returned with `GetFeaturesForElementsAsync` from the elements matching their `UtilityNetworkSource.FeatureTable` with the layer's `FeatureTable`. ## Relevant API @@ -49,8 +50,12 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency \ No newline at end of file +condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency diff --git a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md index de8c49a589..4b2721d95a 100644 --- a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md +++ b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md @@ -30,8 +30,12 @@ The sample loads with the sublayer visible on the map. Change the sublayer's vis ## About the data -The [feature service layer](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. +The [feature service layer](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range \ No newline at end of file +asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range diff --git a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md index b0eaca63ca..3c3cbb24e9 100644 --- a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md +++ b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Map/ApplyScheduledUpdates/readme.md @@ -50,4 +50,4 @@ The data in this sample shows the roads and trails in the Canyonlands National P ## Tags -offline, preplanned, pre-planned, synchronize, update \ No newline at end of file +offline, preplanned, pre-planned, synchronize, update diff --git a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Map/DownloadPreplannedMap/readme.md b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Map/DownloadPreplannedMap/readme.md index ba957516a4..b0bd4637bc 100644 --- a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Map/DownloadPreplannedMap/readme.md +++ b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Map/DownloadPreplannedMap/readme.md @@ -49,4 +49,4 @@ For more information about offline workflows, see [Offline maps, scenes, and dat ## Tags -map area, offline, pre-planned, preplanned \ No newline at end of file +map area, offline, pre-planned, preplanned diff --git a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md index bd67ed5ee0..a038d3565d 100644 --- a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md +++ b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/ConfigureSubnetworkTrace/readme.md @@ -58,8 +58,12 @@ Example barrier conditions for the default dataset: ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency \ No newline at end of file +category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency diff --git a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md index b2fd5dd45f..73eb5e7512 100644 --- a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md +++ b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/DisplayUtilityAssociations/readme.md @@ -34,8 +34,12 @@ Pan and zoom around the map. Observe graphics that show utility associations bet ## About the data -The [feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. +The [feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -associating, association, attachment, connectivity, containment, relationships \ No newline at end of file +associating, association, attachment, connectivity, containment, relationships diff --git a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md index 73e214e1e8..59e92cc614 100644 --- a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md +++ b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/PerformValveIsolationTrace/readme.md @@ -46,7 +46,11 @@ Create and set the configuration's filter barriers by selecting a category. Chec ## About the data -The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. +The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags diff --git a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md index fe9279869b..a3c1812c15 100644 --- a/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md +++ b/src/WinUI/ArcGISRuntime.WinUI.Viewer/Samples/Utility network/TraceUtilityNetwork/readme.md @@ -14,20 +14,21 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## How it works -1. Create a `MapView` and subscribe to its `GeoViewTapped` event. -2. Create and load a `Map` that contains `FeatureLayer`(s) that are part of a utility network. -3. Create and load a `UtilityNetwork` using the utility network feature service URL and the map created in step 2. -4. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. -5. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. -6. Create a `UtilityElement` for the identified feature. -7. Determine the type of this element using its `NetworkSource.SourceType` property. -8. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `Terminal` property with the selected terminal. -9. If an edge, set its `FractionAlongLine` property using `GeometryEngine.FractionAlong`. -10. Add this `UtilityElement` to a collection of starting locations or barriers. -11. Create `TraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). -12. Set the `TraceParameters.TraceConfiguration` with the utility tier's `TraceConfiguration` property. -13. Run a `UtilityNetwork.TraceAsync` with the specified parameters. -14. For every `FeatureLayer` in the map, select the features using the `UtilityElement.ObjectId` from the filtered list of `UtilityElementTraceResult.Elements`. +1. Create a `MapView` and subscribe to its `GeoViewTapped` event. +2. Create and load a `ServiceGeodatabase` with a feature service URL and get tables by their layer IDs. +3. Create a `Map` that contains `FeatureLayer`(s) created from the `ServiceGeodatabase`'s tables. +4. Create and load a `UtilityNetwork` with the same feature service URL and this `Map`. +5. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. +6. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. +7. Create a `UtilityElement` for the identified feature. +8. Determine the type of this element using its `UtilityNetworkSource.SourceType` property. +9. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `UtilityTerminal` property with the selected terminal. +10. If an edge, set its `FractionAlongEdge` property using `GeometryEngine.FractionAlong`. +11. Add this `UtilityElement` to a collection of starting locations or barriers. +12. Create `UtilityTraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). +13. Set the `UtilityTraceParameters.TraceConfiguration` with the tier's `UtilityTier.TraceConfiguration` property. +14. Run a `UtilityNetwork.TraceAsync` with the specified parameters. +15. For every `FeatureLayer` in the map, select the features returned with `GetFeaturesForElementsAsync` from the elements matching their `UtilityNetworkSource.FeatureTable` with the layer's `FeatureTable`. ## Relevant API @@ -49,8 +50,12 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency \ No newline at end of file +condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency diff --git a/src/iOS/Xamarin.iOS/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs b/src/iOS/Xamarin.iOS/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs index 98c275c951..35ff1fa1f8 100644 --- a/src/iOS/Xamarin.iOS/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs +++ b/src/iOS/Xamarin.iOS/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs @@ -81,7 +81,7 @@ private async Task Initialize() { // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. string sampleServer7User = "editor01"; - string sampleServer7Pass = "editor01.password"; + string sampleServer7Pass = "S7#i2LWmYH75"; return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); } catch (Exception ex) @@ -97,7 +97,7 @@ private async Task Initialize() _myMapView.Map = new Map(BasemapStyle.ArcGISStreets); // Create and load a service geodatabase. - _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0")); + _serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/DamageAssessment/FeatureServer/0")); await _serviceGeodatabase.LoadAsync(); // When the service geodatabase has loaded get the default version name. diff --git a/src/iOS/Xamarin.iOS/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs b/src/iOS/Xamarin.iOS/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs index d363d16d53..002c3e982e 100644 --- a/src/iOS/Xamarin.iOS/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs +++ b/src/iOS/Xamarin.iOS/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs @@ -52,7 +52,7 @@ public ApplyMosaicRule() private async Task Initialize() { // Create a raster layer using an image service. - _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer")); + _imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer")); RasterLayer rasterLayer = new RasterLayer(_imageServiceRaster); await rasterLayer.LoadAsync(); diff --git a/src/iOS/Xamarin.iOS/Samples/Layers/ApplyMosaicRule/readme.md b/src/iOS/Xamarin.iOS/Samples/Layers/ApplyMosaicRule/readme.md index be7e94dda7..4dbb64cc62 100644 --- a/src/iOS/Xamarin.iOS/Samples/Layers/ApplyMosaicRule/readme.md +++ b/src/iOS/Xamarin.iOS/Samples/Layers/ApplyMosaicRule/readme.md @@ -32,7 +32,7 @@ When the rasters are loaded, choose from a list of preset mosaic rules to apply ## About the data -This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. +This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany. ## Additional information diff --git a/src/iOS/Xamarin.iOS/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs b/src/iOS/Xamarin.iOS/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs index 140386a384..521a069b29 100644 --- a/src/iOS/Xamarin.iOS/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs +++ b/src/iOS/Xamarin.iOS/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -11,10 +11,12 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI.Controls; using Foundation; using System; +using System.Diagnostics; using System.Drawing; using UIKit; @@ -54,6 +56,23 @@ public DisplaySubtypeFeatureLayer() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Starting viewpoint for the map view. @@ -63,7 +82,7 @@ private async void Initialize() _myMapView.Map = new Map(BasemapStyle.ArcGISStreetsNight) { InitialViewpoint = _startingViewpoint }; // NOTE: This layer supports any ArcGIS Feature Table that define subtypes. - SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100"))); + SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0"))); _myMapView.Map.OperationalLayers.Add(subtypeFeatureLayer); // Select sublayer to control. diff --git a/src/iOS/Xamarin.iOS/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md b/src/iOS/Xamarin.iOS/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md index de8c49a589..4b2721d95a 100644 --- a/src/iOS/Xamarin.iOS/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md +++ b/src/iOS/Xamarin.iOS/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md @@ -30,8 +30,12 @@ The sample loads with the sublayer visible on the map. Change the sublayer's vis ## About the data -The [feature service layer](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. +The [feature service layer](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range \ No newline at end of file +asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range diff --git a/src/iOS/Xamarin.iOS/Samples/Map/ApplyScheduledUpdates/readme.md b/src/iOS/Xamarin.iOS/Samples/Map/ApplyScheduledUpdates/readme.md index a88bdaaa93..189fde5529 100644 --- a/src/iOS/Xamarin.iOS/Samples/Map/ApplyScheduledUpdates/readme.md +++ b/src/iOS/Xamarin.iOS/Samples/Map/ApplyScheduledUpdates/readme.md @@ -50,4 +50,4 @@ The data in this sample shows the roads and trails in the Canyonlands National P ## Tags -offline, preplanned, pre-planned, synchronize, update \ No newline at end of file +offline, preplanned, pre-planned, synchronize, update diff --git a/src/iOS/Xamarin.iOS/Samples/Map/DownloadPreplannedMap/readme.md b/src/iOS/Xamarin.iOS/Samples/Map/DownloadPreplannedMap/readme.md index fbae76d8ee..d836dadf87 100644 --- a/src/iOS/Xamarin.iOS/Samples/Map/DownloadPreplannedMap/readme.md +++ b/src/iOS/Xamarin.iOS/Samples/Map/DownloadPreplannedMap/readme.md @@ -49,4 +49,4 @@ For more information about offline workflows, see [Offline maps, scenes, and dat ## Tags -map area, offline, pre-planned, preplanned \ No newline at end of file +map area, offline, pre-planned, preplanned diff --git a/src/iOS/Xamarin.iOS/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs b/src/iOS/Xamarin.iOS/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs index 78308e3248..8d66ec5e73 100644 --- a/src/iOS/Xamarin.iOS/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs +++ b/src/iOS/Xamarin.iOS/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -9,10 +9,12 @@ using ArcGISRuntime; using Esri.ArcGISRuntime.Data; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.UtilityNetworks; using Foundation; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using UIKit; @@ -40,7 +42,7 @@ public class ConfigureSubnetworkTrace : UIViewController private UIButton _resetButton; // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; private UtilityNetwork _utilityNetwork; // For creating the default starting location. @@ -77,6 +79,23 @@ public ConfigureSubnetworkTrace() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Disable interaction until the data is loaded. diff --git a/src/iOS/Xamarin.iOS/Samples/Utility network/ConfigureSubnetworkTrace/readme.md b/src/iOS/Xamarin.iOS/Samples/Utility network/ConfigureSubnetworkTrace/readme.md index 5058f89ac4..8c0ea6c8cf 100644 --- a/src/iOS/Xamarin.iOS/Samples/Utility network/ConfigureSubnetworkTrace/readme.md +++ b/src/iOS/Xamarin.iOS/Samples/Utility network/ConfigureSubnetworkTrace/readme.md @@ -58,8 +58,12 @@ Example barrier conditions for the default dataset: ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency \ No newline at end of file +category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency diff --git a/src/iOS/Xamarin.iOS/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.cs b/src/iOS/Xamarin.iOS/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.cs index b5d695c66e..1747302ed4 100644 --- a/src/iOS/Xamarin.iOS/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.cs +++ b/src/iOS/Xamarin.iOS/Samples/Utility network/DisplayUtilityAssociations/DisplayUtilityAssociations.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Esri. +// Copyright 2021 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 @@ -11,6 +11,7 @@ using Esri.ArcGISRuntime; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; @@ -18,6 +19,7 @@ using Foundation; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.Linq; using UIKit; @@ -39,7 +41,7 @@ public class DisplayUtilityAssociations : UIViewController private UIImageView _connectivityImage; // Feature server for the utility network. - private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // This viewpoint shows several associations clearly in the utility network. private readonly Viewpoint InitialViewpoint = new Viewpoint(new MapPoint(-9812697.41544719, 5131928.28213524, SpatialReferences.WebMercator), 73.4352610787649); @@ -60,6 +62,24 @@ public DisplayUtilityAssociations() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { // Create the utility network. diff --git a/src/iOS/Xamarin.iOS/Samples/Utility network/DisplayUtilityAssociations/readme.md b/src/iOS/Xamarin.iOS/Samples/Utility network/DisplayUtilityAssociations/readme.md index b2fd5dd45f..73eb5e7512 100644 --- a/src/iOS/Xamarin.iOS/Samples/Utility network/DisplayUtilityAssociations/readme.md +++ b/src/iOS/Xamarin.iOS/Samples/Utility network/DisplayUtilityAssociations/readme.md @@ -34,8 +34,12 @@ Pan and zoom around the map. Observe graphics that show utility associations bet ## About the data -The [feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. +The [feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -associating, association, attachment, connectivity, containment, relationships \ No newline at end of file +associating, association, attachment, connectivity, containment, relationships diff --git a/src/iOS/Xamarin.iOS/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.cs b/src/iOS/Xamarin.iOS/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.cs index a1579fcf2d..4542cffac5 100644 --- a/src/iOS/Xamarin.iOS/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.cs +++ b/src/iOS/Xamarin.iOS/Samples/Utility network/PerformValveIsolationTrace/PerformValveIsolationTrace.cs @@ -11,6 +11,7 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; @@ -40,7 +41,7 @@ public class PerformValveIsolationTrace : UIViewController private UIActivityIndicatorView _loadingView; // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer"; private const int LineLayerId = 3; private const int DeviceLayerId = 0; private UtilityNetwork _utilityNetwork; @@ -66,6 +67,24 @@ public PerformValveIsolationTrace() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + return null; + } + }); + try { _loadingView.StartAnimating(); diff --git a/src/iOS/Xamarin.iOS/Samples/Utility network/PerformValveIsolationTrace/readme.md b/src/iOS/Xamarin.iOS/Samples/Utility network/PerformValveIsolationTrace/readme.md index ec521db265..761175b18d 100644 --- a/src/iOS/Xamarin.iOS/Samples/Utility network/PerformValveIsolationTrace/readme.md +++ b/src/iOS/Xamarin.iOS/Samples/Utility network/PerformValveIsolationTrace/readme.md @@ -46,7 +46,11 @@ Create and set the configuration's filter barriers by selecting a category. Chec ## About the data -The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. +The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags diff --git a/src/iOS/Xamarin.iOS/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.cs b/src/iOS/Xamarin.iOS/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.cs index 060db1aee0..f69c98fd44 100644 --- a/src/iOS/Xamarin.iOS/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.cs +++ b/src/iOS/Xamarin.iOS/Samples/Utility network/TraceUtilityNetwork/TraceUtilityNetwork.cs @@ -12,6 +12,7 @@ using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Http; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; @@ -19,6 +20,7 @@ using Foundation; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using UIKit; @@ -47,7 +49,7 @@ public class TraceUtilityNetwork : UIViewController private UIButton _tracePickerButton; // Feature service for an electric utility network in Naperville, Illinois. - private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; + private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer"; // Viewpoint in the utility network area. private Viewpoint _startingViewpoint = new Viewpoint(new Envelope(-9812980.8041217551, 5128523.87694709, -9812798.4363710005, 5128627.6261982173, SpatialReferences.WebMercator)); @@ -73,6 +75,24 @@ public TraceUtilityNetwork() private async void Initialize() { + // As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations. + AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) => + { + try + { + // WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample. + string sampleServer7User = "viewer01"; + string sampleServer7Pass = "I68VGU^nMurF"; + + return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass); + } + catch (Exception ex) + { + Debug.WriteLine(ex.Message); + return null; + } + }); + try { _activityIndicator.StartAnimating(); @@ -85,14 +105,14 @@ private async void Initialize() }; // Add the layer with electric distribution lines. - FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/115")); + FeatureLayer lineLayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/3")); UniqueValue mediumVoltageValue = new UniqueValue("N/A", "Medium Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.DarkCyan, 3), 5); UniqueValue lowVoltageValue = new UniqueValue("N/A", "Low Voltage", new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.DarkCyan, 3), 3); lineLayer.Renderer = new UniqueValueRenderer(new List() { "ASSETGROUP" }, new List() { mediumVoltageValue, lowVoltageValue }, "", new SimpleLineSymbol()); _myMapView.Map.OperationalLayers.Add(lineLayer); // Add the layer with electric devices. - FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/100")); + FeatureLayer electricDevicelayer = new FeatureLayer(new Uri($"{FeatureServiceUrl}/0")); _myMapView.Map.OperationalLayers.Add(electricDevicelayer); // Set the selection color for features in the map view. diff --git a/src/iOS/Xamarin.iOS/Samples/Utility network/TraceUtilityNetwork/readme.md b/src/iOS/Xamarin.iOS/Samples/Utility network/TraceUtilityNetwork/readme.md index 4f9aff1d5a..7fdcaa8729 100644 --- a/src/iOS/Xamarin.iOS/Samples/Utility network/TraceUtilityNetwork/readme.md +++ b/src/iOS/Xamarin.iOS/Samples/Utility network/TraceUtilityNetwork/readme.md @@ -14,20 +14,21 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## How it works -1. Create a `MapView` and subscribe to its `GeoViewTapped` event. -2. Create and load a `Map` that contains `FeatureLayer`(s) that are part of a utility network. -3. Create and load a `UtilityNetwork` using the utility network feature service URL and the map created in step 2. -4. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. -5. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. -6. Create a `UtilityElement` for the identified feature. -7. Determine the type of this element using its `NetworkSource.SourceType` property. -8. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `Terminal` property with the selected terminal. -9. If an edge, set its `FractionAlongLine` property using `GeometryEngine.FractionAlong`. -10. Add this `UtilityElement` to a collection of starting locations or barriers. -11. Create `TraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). -12. Set the `TraceParameters.TraceConfiguration` with the utility tier's `TraceConfiguration` property. -13. Run a `UtilityNetwork.TraceAsync` with the specified parameters. -14. For every `FeatureLayer` in the map, select the features using the `UtilityElement.ObjectId` from the filtered list of `UtilityElementTraceResult.Elements`. +1. Create a `MapView` and subscribe to its `GeoViewTapped` event. +2. Create and load a `ServiceGeodatabase` with a feature service URL and get tables by their layer IDs. +3. Create a `Map` that contains `FeatureLayer`(s) created from the `ServiceGeodatabase`'s tables. +4. Create and load a `UtilityNetwork` with the same feature service URL and this `Map`. +5. Add a `GraphicsOverlay` with symbology that distinguishes starting locations from barriers. +6. Identify features on the map and add a `Graphic` that represents its purpose (starting location or barrier) at the tapped location. +7. Create a `UtilityElement` for the identified feature. +8. Determine the type of this element using its `UtilityNetworkSource.SourceType` property. +9. If the element is a junction with more than one terminal, display a terminal picker. Then set the junction's `UtilityTerminal` property with the selected terminal. +10. If an edge, set its `FractionAlongEdge` property using `GeometryEngine.FractionAlong`. +11. Add this `UtilityElement` to a collection of starting locations or barriers. +12. Create `UtilityTraceParameters` with the selected trace type along with the collected starting locations and barriers (if applicable). +13. Set the `UtilityTraceParameters.TraceConfiguration` with the tier's `UtilityTier.TraceConfiguration` property. +14. Run a `UtilityNetwork.TraceAsync` with the specified parameters. +15. For every `FeatureLayer` in the map, select the features returned with `GetFeaturesForElementsAsync` from the elements matching their `UtilityNetworkSource.FeatureTable` with the layer's `FeatureTable`. ## Relevant API @@ -49,8 +50,12 @@ Tap on one or more features while 'Add starting locations' or 'Add barriers' is ## About the data -The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. +The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample. + +## Additional information + +Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm). ## Tags -condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency \ No newline at end of file +condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency diff --git a/tools/readme_copy/readme_copy.py b/tools/readme_copy/readme_copy.py index d4a3a2fbe6..3c8a797d32 100644 --- a/tools/readme_copy/readme_copy.py +++ b/tools/readme_copy/readme_copy.py @@ -36,6 +36,8 @@ def replace_readmes(category, formal_name, sample_root): platformcontent = copy.copy(wpfcontent) # Fix the guide doc url for the platform + platformcontent = platformcontent.replace("wpf/guide", str.lower(platform)+"/guide") + platformcontent = platformcontent.replace("wpf/sample-code/", str.lower(platform)+"/sample-code/") #platformcontent = platformcontent.replace("oldlink", "newlink") # Change `click` to `tap` for mobile platforms