BLOG
|
With the 100.15 release, the Toolkit for ArcGIS Runtime SDK for .NET now includes a powerful tool for working with Utility Networks. The Utility Network Trace Tool is a drop-in component that allows you to select and run Named Trace Configurations, including the ability to compare results. (Utility Network Trace Tool is also available for the ArcGIS Runtime SDK for Java Toolkit.) About Utility Networks ArcGIS Utility Networks enable you to model, visualize, and analyze utility equipment, such as gas and electric distribution systems. The following video offers a brief introduction. Add the Utility Network Trace Tool to your app The Utility Network Trace Tool is designed to be easy to use and integrate with your app with minimal configuration. For most apps, configuration is a two-step process: Add the Toolkit dependency to your project (if you aren’t already using Toolkit). Add the tool to a page in your app. Then connect it to a MapView. Toolkit for ArcGIS Runtime SDK for .NET is hosted as a Nuget package. You can get started by adding the following line to your project’s .csproj file: <PackageReference Include="Esri.ArcGISRuntime.Toolkit" Version="100.15.0" /> Or you can use the package manager in Visual Studio: After the package is added to your project, you're just one more line of code away from a working trace tool: <esri:UtilityNetworkTraceTool GeoView="{Binding ElementName=MyMapView}" /> To learn more about additional (optional) configuration options, see the Toolkit documentation. Run network traces and view results Web maps power the Utility Network Trace Tool. When a map includes a utility network, any associated named trace configurations are loaded. If there are multiple utility networks, you can select which network to use. Otherwise, the first step is to choose a trace configuration from the list: After selecting the trace configuration, you define starting points for the trace. You can add starting points programmatically or by interacting with the map. Trace starting points often overlap, so the tool uses a wide area tolerance to simplify selecting the desired point. You can then inspect the popups for individual starting points if you need additional information to make the right choice. While in the inspection view, you can see the popup and symbology, with the option to delete the starting point: After selecting the desired trace configuration and starting points, you can run the trace. You can also choose a name and a result color to help keep track of and compare multiple results. After the trace completes, you will see graphics, features, and function results, with the option to hide and show trace results. Learn more and next steps The Utility Network Trace Tool for .NET is available today for WPF, UWP, and Xamarin.Forms. And because Toolkit for ArcGIS Runtime SDK for .NET is open source, you can view the code and fork at will. We can’t wait to see what you’ll do with it, and look forward to hearing your feedback and questions in Esri Community. Links: Toolkit repo on GitHub Documentation Esri Community
... View more
08-26-2022
03:48 PM
|
3
|
0
|
1015
|
POST
|
For the explicit load, I recommend waiting for `LoadAsync` on the `Map` before adding it to the `MapView`. If that doesn't work, I recommend working through the layers, and doing the same for the `ArcGISMapImageLayer` and then each of the sublayers. That will help narrow down the issue. From the behavior you're seeing, it isn't clear if the problem exists in the Toolkit or in Runtime.
... View more
05-02-2022
02:00 PM
|
0
|
0
|
1225
|
POST
|
I’m sorry to hear that you’re seeing problems with the Toolkit’s TOC control. Toolkit is open source, so you are always welcome to fork it, make modifications, file issues, and suggest improvements. Ideally, it would work out of the box without changes. Does the layer display properly in the ArcGIS Online Web Map Viewer? Are you able to share the layer you’re using, or a similarly configured public service? You may want to try explicitly loading the map image layer and all of its sublayers before adding it to the map. If it works with the explicit load, that would help narrow down the issue. I hope that helps.
... View more
04-28-2022
02:31 PM
|
1
|
2
|
1241
|
POST
|
I'm sorry to hear you're having problems with labeling for Vector Tiles in Runtime. For authoring, I've found documentation on what is supported for labels in vector tiles: https://pro.arcgis.com/en/pro-app/latest/help/mapping/map-authoring/labeling-in-vector-tiles.htm The text-allow-overlap and possibly icon-allow-overlap properties may be of interest. I did some light tinkering starting with Esri's published reference style, and was able to get better (although not perfect) behavior. Using the Vector Tile Style Editor, I was also able to change the "spacing" property in the symbol position group, which fixed an issue with labeling gaps. I hope that information can be a useful starting point while I inquire about options for solving the problem. To better understand and diagnose the issue, it would be helpful to know the resolution and screen size of the device that is being used.
... View more
03-25-2022
12:45 PM
|
0
|
6
|
1479
|
POST
|
Tom, Yes, ideally viewpoint should be set after the map is added to the MapView. That may require a small amount of refactoring to break this code into two parts, one to create the map, another to call `mapView.SetViewpoint` or `mapView.SetViewpointAsync`. Alternatively, you might be able to follow the pattern in `AddGraphicsOverlays` to interact with the MapView. Since the GetMap is already an async Task, you should be able to insert `await _map.LoadAsync` before returning the map. That will ensure the map is loaded before it is added to the map. If you explicitly load the map by calling `_map.LoadAsync` before returning, you can then check `_map.LoadStatus` rather than setting up an event. Although if you are already making the change to calling SetViewpoint on the MapView, then you should only need the explicit loading step if you want to do error handling. Updated code might look something like the following: try
{
var basemap = await _currentMapStyle.ToEsri();
_map = new Map(basemap);
await _map.LoadAsync();
_mapView.Map = _map; // Or alternatively do this in a separate method
AddGraphicsOverlays();
await _mapView.SetViewpointAsync(initialLatitude, initialLongitude, _defaultZoom);
}
catch //... error handling - explicit loading of map should throw exceptions that you can catch
... View more
02-09-2022
12:33 PM
|
0
|
1
|
1093
|
POST
|
I'm sorry to see that you're having trouble updating to the latest version of ArcGIS Runtime. Can you please confirm the versions of the NuGet packages you have installed for each project in your application? That will help me better understand the problem. Consider checking the minimum and target version of UWP in the UWP project. The minimum supported UWP version has changed between 100.8 and 100.13, and that may be related to the problem. You can update the minimum UWP version to 18362 in the properties page for the UWP project.
... View more
02-08-2022
12:37 PM
|
0
|
1
|
673
|
POST
|
Hi, I’m sorry to hear you’re seeing problems with Map display. It is hard to tell for certain what is going on without seeing the full code, but I do have some ideas based on what you’ve shared. The InitialViewpoint property is mostly intended for use in situations where a map is being opened from a Portal item. In cases involving programmatic creation of maps, it is preferred to set the viewpoint on the MapView directly. Setting the viewpoint after the map loads should be more reliable. What is happening in the _currentMapStyle.ToEsri()? Consider trying to await the basemap creation, using the basemap as a constructor parameter for the map, and then setting the InitialViewpoint on the map. My hunch is that maybe in the process of applying the basemap, is resetting the initial viewpoint. You might also consider waiting for the map to load before returning the map, to rule out any timing issues. I see in the video that the map appears to be moving in the cases where the viewpoint successfully loads. Are you using a LocationDisplay or LocationDataSource to navigate the map based on device location after the map is displayed? Thanks, Nathan
... View more
02-04-2022
05:30 PM
|
0
|
3
|
1107
|
POST
|
The Map and the MapView are two separate objects. MapView is the UI component that displays the content, and the Map defines what is to be displayed. The code you shared references the Map, but you can only control navigation from the MapView. Typically the MapView will be defined in XAML somewhere, but it doesn't have to be. The following tutorial might be helpful, because it shows a common design pattern and the map/mapview separation: https://developers.arcgis.com/net/maps-2d/tutorials/display-a-map/
... View more
01-31-2022
03:27 PM
|
0
|
1
|
885
|
POST
|
Hello, Changing the extent of the basemap's item won't directly affect the view. The extent on an item is used as metadata for other parts of the ArcGIS system (e.g. searching a Portal/ArcGIS Online). You should be able to set the viewpoint on the MapView that is being used to show esriMap with something like the following: esriMapView.SetViewpoint(new Viewpoint(foundLayer.FullExtent));
... View more
01-28-2022
09:09 AM
|
0
|
0
|
906
|
POST
|
There was a change to the default behavior between .NET Core 3.1 and .NET 5. Adding the following line to the ClickOnce .pubxml publish profile should solve the problem: <IncludeAllContentForSelfExtract>True</IncludeAllContentForSelfExtract> Visual Studio/ClickOnce still produces additional files alongside the single-file executable, but they aren't necessary to run the single file app. Alternatively, if you disable the 'Produce Single File' option, the publish will work without IncludeAllContentForSelfExtract line. Microsoft has documentation on single file deployments that you might find helpful: https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file#including-native-libraries
... View more
01-25-2022
03:12 PM
|
2
|
1
|
7664
|
POST
|
Apologies for the late response, it took me longer than expected to narrow down the issue. If you open App.xaml.cs in your UWP project (not the shared project) you should see a line like the following in the OnLaunched method: Xamarin.Forms.Forms.Init(e, new Assembly[] { typeof(global::Esri.ArcGISRuntime.Xamarin.Forms.MapView).GetTypeInfo().Assembly }); Replacing that line with the following should solve the problem. Xamarin.Forms.Forms.Init(e, new Assembly[] { typeof(global::Esri.ArcGISRuntime.Xamarin.Forms.MapView).GetTypeInfo().Assembly, typeof(global::Esri.ArcGISRuntime.Toolkit.Xamarin.Forms.Compass).GetTypeInfo().Assembly }); Let me know if that works for you.
... View more
09-21-2021
02:26 PM
|
1
|
0
|
1078
|
POST
|
I'm sorry you're experiencing this problem. Can you please share some more details about your project? Which versions of Xamarin.Forms, ArcGIS Runtime, and Toolkit are you using? What is the XAML you are using to show the compass? Is the AutoHide property on the compass set? Which architecture (x86, x64, ARM) are you using to build the project? Which version of Visual Studio are you using to build? Those details will help me reproduce and hopefully fix the issue.
... View more
09-16-2021
02:14 PM
|
0
|
2
|
1110
|
POST
|
It sounds like GeometryEngine.Project is the right option for what you're trying to do. CoordinateFormatter is primarily meant for showing coordinates in various different text formats, while you're primarily after the underlying x,y/lat,long values. GeometryEngine.Project will produce a point in the right spatial reference with access to the spatial properties intact. MapPoint mp = MainMapView.ScreenToLocation(e.GetPosition(MainMapView));
// GeometryEngine.Project returns a Geometry object, but if the input is a MapPoint, the output can be assumed to be a MapPoint
mp = (MapPoint)GeometryEngine.Project(mp, SpatialReferences.Wgs84);
// Note that WGS84 lat/long corresponds to WebMercator Y/X
Trace.WriteLine(mp.Y + " " + mp.X);
... View more
06-23-2021
10:57 AM
|
0
|
0
|
3702
|
POST
|
It looks like you have a point in the web mercator spatial reference (which is what the Esri basemaps tend to use) and want to get that point in WGS84, which is what GPS and most consumer services use. CoordinateFormatter should work. There is an example in the Format Coordinates sample: https://developers.arcgis.com/net/wpf/sample-code/format-coordinates/. Can you please share your code so I can understand what might be happening? Until then, you can use GeometryEngine to project from web mercator to WGS84: using Esri.ArcGISRuntime.Geometry;
//....
MapPoint inputPoint = new MapPoint(-10503190, 5653794, SpatialReferences.WebMercator);
var outputPoint = (MapPoint)GeometryEngine.Project(inputPoint, SpatialReferences.Wgs84);
System.Diagnostics.Debug.WriteLine($"{outputPoint.Y}, {outputPoint.X}");
// output: 45.20462984270032, -94.35176109011317
... View more
06-22-2021
07:02 PM
|
0
|
2
|
3736
|
POST
|
When a graphic is added to a graphics overlay that is already in a mapview or sceneview, the graphic will be shown automatically, assuming there is a renderer or the graphic is configured with a symbol. Based on the code you shared, it looks like you're following the pattern set in the template projects and the developer tutorials. If that is the case, you will see something like the following in your MainWindow.xaml file: <Window.Resources>
<local:MapViewModel x:Key="MapViewModel" />
</Window.Resources> That code will create an instance of your viewmodel when InitializeComponent is called. The MapView's Map and GraphicsOverlays properties are set via binding: <esri:MapView x:Name="MainMapView"
Map="{Binding Map, Source={StaticResource MapViewModel}}"
GraphicsOverlays="{Binding GraphicsOverlays, Source={StaticResource MapViewModel}}" /> The view is bound to the specific instance of the viewmodel that is added to the `Window.Resources` dictionary. Your code is creating another instance of viewmodel, but that instance is never connected to the view in any way, so the view won't update to reflect changes in viewmodel state. You could fix this by re-setting up bindings when you create the viewmodel, or by using the existing viewmodel instance created in XAML. I recommend updating your code to reference the copy of the ViewModel created in XAML: You could use something like the following to get a reference to the viewmodel: mvm = FindResource("MapViewModel") as MapViewModel;
... View more
06-22-2021
12:22 PM
|
1
|
1
|
5075
|
Title | Kudos | Posted |
---|---|---|
3 | 08-26-2022 03:48 PM | |
1 | 04-28-2022 02:31 PM | |
2 | 01-25-2022 03:12 PM | |
1 | 09-21-2021 02:26 PM | |
1 | 06-22-2021 12:22 PM |
Online Status |
Offline
|
Date Last Visited |
03-13-2024
01:51 AM
|