|
POST
|
Thanks, Mark. I'm able to reproduce the issue in v100.1 and it looks like it did not render at all in v100. Also, I find that when you opt-out advanced symbology, it renders just at it would in ArcGIS Pro. Do you mind trying the following workaround? var mmpk = await MobileMapPackage.OpenAsync(path);
var map = mmpk.Maps.FirstOrDefault();
foreach(var layer in map.OperationalLayers.OfType<FeatureLayer>())
{
var table = (ArcGISFeatureTable)layer.FeatureTable;
table.UseAdvancedSymbology = false;
}
MyMapView.Map = map; I have logged the issue so our team can investigate further. Thanks. Jennifer
... View more
07-07-2017
02:00 PM
|
0
|
15
|
7536
|
|
POST
|
From ArcGIS Runtime SDK for .NET perspective, if you are using Update 1, you can use OfflineMapTask to generate offline map from map created from portal item with basemap using the following code. Be sure to provide your ArcGIS.com credentials. If you are using v100 or v10.2.x, you can use ExportTileCacheTask (see this post). Both ways will create tpk file at the specified location. public MainWindow()
{
InitializeComponent();
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async(info) =>
{
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, "username", "password");
});
MyMapView.Map = new Map(new Uri("http://www.arcgis.com/home/item.html?id=48b8cec7ebf04b5fbdcaf70d09daff21"));
MyMapView.Map.InitialViewpoint = new Viewpoint(new Envelope(-13640236.783971909, 4543994.3422454093, -13619727.139469307, 4555760.1893863911, SpatialReferences.WebMercator));
}
private async void OnTakeOffline(object sender, RoutedEventArgs e)
{
try
{
var path = Path.Combine(Path.GetTempPath(), "OfflineMap");
if(Directory.Exists(path))
{
var mmpk = await MobileMapPackage.OpenAsync(path);
MyMapView.Map = mmpk.Maps.FirstOrDefault();
return;
}
Directory.CreateDirectory(path);
var task = await OfflineMapTask.CreateAsync(MyMapView.Map);
var areaOfInterest = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry;
var parameters = await task.CreateDefaultGenerateOfflineMapParametersAsync(areaOfInterest);
var job = task.GenerateOfflineMap(parameters, path);
var result =await job.GetResultAsync();
MyMapView.Map = result.OfflineMap;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
... View more
07-07-2017
11:13 AM
|
0
|
0
|
596
|
|
POST
|
Hi Manel, There are a few ways you can troubleshoot a layer that is not loading. One of them is using LayerViewStateChanged. For ArcGISMapImageLayer, you can check sublayer load errors this way. public MainWindow()
{
InitializeComponent();
MyMapView.LayerViewStateChanged += MyMapView_LayerViewStateChanged;
MyMapView.Map = new Map(Basemap.CreateTopographic());
}
private async void MyMapView_LayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
{
var error = e.LayerViewState.Error ?? e.Layer.LoadError;
if (error != null)
MessageBox.Show(error.Message);
if(e.Layer is ArcGISMapImageLayer)
{
var layer = (ArcGISMapImageLayer)e.Layer;
try
{
foreach (var sublayer in layer.Sublayers)
await sublayer.LoadAsync();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
} If it were a rendering issue, you can supply a different renderer provided it matches the geometry type of your service. In snippet below, I only wanted to display the line geometry so I cleared the rest of the sublayers. var layer =(ArcGISMapImageLayer) MyMapView.Map.OperationalLayers.FirstOrDefault();
layer.Sublayers.Clear();
layer.Sublayers.Add(new ArcGISMapImageSublayer(1)
{
Renderer = new SimpleRenderer()
{
Symbol = new SimpleLineSymbol(SimpleLineSymbolStyle.DashDotDot, Colors.Blue, 2)
}
}); You can enable debugging from your ArcGIS Runtime Local Server Utility and use Fiddler or any web debugging tool. When using ArcGISMapImageLayer from a LocalServer, one of the requests should look like this which returns you an image. You should see the same image rendered in your runtime map.
... View more
07-07-2017
10:46 AM
|
1
|
0
|
2009
|
|
POST
|
I think I understand your follow-up question now. If you're trying to replace your FeatureLayer renderer/symbology with scene symbol, this will not work. You can only use 3d symbol in GraphicsOverlay RenderingMode=DynamicMode (which is default mode). So to add a cone symbol interactively in a SceneView, you can do: public MainWindow()
{
InitializeComponent();
MyMapView.Scene = new Scene(Basemap.CreateTopographic());
MyMapView.GeoViewTapped += MyMapView_GeoViewTapped;
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay()
{
Renderer = new SimpleRenderer()
{
Symbol = SimpleMarkerSceneSymbol.CreateCone(Colors.Red, 10000,10000)
}
});
}
private void MyMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
{
var overlay = MyMapView.GraphicsOverlays.FirstOrDefault();
overlay.Graphics.Add(new Graphic(e.Location));
}
To add your FeatureLayer from an MPK, you can do: try
{
var service = new LocalFeatureService(@"c:\data\PointsofInterest.mpk");
await service.StartAsync();
MyMapView.Scene.OperationalLayers.Add(new FeatureLayer(new Uri($"{service.Url}/0")));
MyMapView.Scene.OperationalLayers.Add(new FeatureLayer(new Uri($"{service.Url}/1")));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
} To add a feature, you can do: var layer = (FeatureLayer)MyMapView.Scene.OperationalLayers.FirstOrDefault(o => o is FeatureLayer);
var table = ((ArcGISFeatureTable)layer.FeatureTable);
var template = table.FeatureTemplates.FirstOrDefault() ?? table.FeatureTypes.FirstOrDefault(t => t.Templates.Any())?.Templates?.FirstOrDefault();
var feature = table.CreateFeature(template, e.Location);
await table.AddFeatureAsync(feature); To replace the layer's symbology, you can do: var layer = (FeatureLayer)MyMapView.Scene.OperationalLayers.FirstOrDefault(o => o is FeatureLayer);
layer.Renderer = new SimpleRenderer()
{
Symbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Colors.Red, 10),
}; Note, however that 3D symbols is not supported in FeatureLayer (this is by current design).
... View more
07-07-2017
10:16 AM
|
2
|
0
|
6364
|
|
POST
|
Hi Manel, To reply to your original question, you can follow these steps for installing Local Server and updating your WPF application NuGet reference. Be sure to choose v100.1.0. Either set install path (i.e. LocalServerEnvironment.InstallPath = @"C:\Program Files (x86)\ArcGIS SDKs") or enable SDE and other child packages in your AGSDeployment file. You can use the following code to create EnterpriseGeodatabaseWorkspace. Be sure to replace with correct connection string or full ArcSDE file path. var service = new LocalMapService(@"c:\Data\Sample.mpk");
service.SetDynamicWorkspaces(new DynamicWorkspace[]
{
EnterpriseGeodatabaseWorkspace.CreateFromConnectionString($"{Guid.NewGuid()}", "PASSWORD=password;SERVER=servername;INSTANCE=instancename;DBCLIENT=sqlserver;DB_CONNECTION_PROPERTIES=servername;DATABASE=databasename;USER=username;VERSION=dbo.DEFAULT;AUTHENTICATION_MODE=DBMS"),
EnterpriseGeodatabaseWorkspace.CreateFromConnectionFile($"{Guid.NewGuid()}", @"C:\Data\SampleConnection.sde")
});
await service.StartAsync();
MyMapView.Map.OperationalLayers.Add(new ArcGISMapImageLayer(service.Url)); You can retrieve workspace again using the following code. var workspace = service.GetDynamicWorkspaces().FirstOrDefault(w => w is EnterpriseGeodatabaseWorkspace) as EnterpriseGeodatabaseWorkspace; You can then create sublayer using this workspace. Be sure to replace with correct workspace name and apply the correct symbology (i.e. point features with marker symbols, line features with line symbols, polygon features with fill symbols, etc.). layer.Sublayers.Clear();
layer.Sublayers.Add(new ArcGISMapImageSublayer(0, new TableSublayerSource(workspace.Id, "YourWorkspaceName"))
{
Renderer = new SimpleRenderer(new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Colors.Blue, null))
}); This should work, can you give this a try? As for your follow-up question, I am unclear about what you're trying to do with 3D symbol. Maybe try that you're able to load layers from mpk first. InvalidOperationException may be raised when edit is not enabled or table is not ready. To troubleshoot features not rendering, you can subscribe to LayerViewStateChanged of MapView/SceneView and check for layer view status (i.e. is it Active, OutOfScale, Error, NotVisible? Does layer.LoadError have a value?
... View more
07-07-2017
09:38 AM
|
3
|
3
|
6364
|
|
POST
|
Thank you both for your feedback. We will certainly take them under advisement for future improvements. Perhaps make this behavior change configurable. In v100+, dragging vertex or geometry requires that the feature be highlighted first either it was recently added or previously tapped. Once highlighted, you don't have to tap to select again, just drag vertex/geometry. For MapPoint, you may tap to define its new location or drag it to a new location. The reason for requiring selection first was to avoid unintentional edits and to highlight which tool/geometry is currently active. You may also use any of the GeometryEngine methods if you would like to move geometry programmatically. Thanks. Jennifer
... View more
07-06-2017
09:57 AM
|
0
|
0
|
1575
|
|
POST
|
Thank you both for the additional information. The InvalidOperationException I mentioned previously was for v10.2.x of the API. I'll try to see if I can get a reproducer for v100. Meanwhile, I was wondering if either of you could give Update 1 a try to see if the sync issues are resolved. I'm curious what may be raising InvalidOperationException - if it may be what leads to geodatabase being corrupted. Does it come with additional error message? Is the feature service endpoint token-secured? I am not sure if this will help at all with recovering data from the geodatabase (if it's already corrupted) but there is this tool you can use to convert runtime Geodatabase into FileGeodatabase, perhaps it'll help save whatever offline data they had before the sync failed. http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/copy-runtime-geodatabase-to-file-geodatabase.htm. or maybe create a copy of geodatabase before sync.
... View more
07-06-2017
09:32 AM
|
0
|
0
|
2961
|
|
POST
|
Hi Stephan and Andy, I am sorry to hear that you're experiencing issues with syncing your offline edits. While I'm not exactly sure what's causing geodatabase corruption yet, I know that InvalidOperationException("No data to upload") may occur if the SyncGeodatabaseParameters.SyncDirection is Upload only and there were no changes found in the geodatabase. Before you sync, can you check sync direction and if edits exist on the geodatabase? var hasChanges = geodatabase.FeatureTables.Any(t => t.HasEdits); How do you know that geodatabase is corrupted? At what point or which error message indicates this? If you suspect that geodatabase is corrupted, are you able to do open the geodatabase and add the tables to the map or do any operations on them? For example the following code: var geodatabase = await Geodatabase.OpenAsync(geodatabasePath);
foreach (var table in geodatabase.FeatureTables)
{
var features = await table.QueryAsync(new QueryFilter() { WhereClause = "1=1" });
MyMapView.Map.Layers.Add(new FeatureLayer(table));
} Do either of you plan to upgrade to v100? In our Update 1, we'll have OfflineMapTask and OfflineMapSyncTask that may hopefully make this workflow simpler. We appreciate any other info or call stack you can provide so we can reproduce this and make sure that future versions of the API does not have it. Thanks.
... View more
06-22-2017
01:58 PM
|
0
|
2
|
2961
|
|
POST
|
GraphicsOverlay and GraphicsLayer behave the same under same RenderingMode so when you say Text was then come out in front of any other Symbols this is by current design, which may be noticeable when you have overlapping graphics and/or symbols added after TextSymbol in a CompositeSymbol symbol collection. As for your third case, I added a few screen shots top-left graphic is in bold, bottom-right graphic is in normal font weight. You're right that at FontSize=12, bold and normal seem identical. If you increase font size (i.e. FontSize=20), the weight difference becomes much more noticeable. If you are looking for an identical symbol as rendered in your 2D map in a 3D scene using v10.2.x, you can create an image of your CompositeSymbol and use PictureMarkerSymbol instead, will that work for you? This should avoid alignment, weight and rendering differences for TextSymbol. Alternatively if it is an option for you, you can upgrade to v100. Thanks.
... View more
06-22-2017
11:44 AM
|
0
|
0
|
1992
|
|
POST
|
Hi KyongGu, Thanks for your feedback. I see you're reporting two issues here 1 - Text alignment not respected by symbol 2 - Text rendered topmost (issue when overlapping graphics) I'm able to reproduce both with the following code: xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:SceneView x:Name="MySceneView" SceneViewTapped="MySceneView_SceneViewTapped">
<esri:Scene>
<esri:ArcGISTiledMapServiceLayer ServiceUri="http://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer" />
</esri:Scene>
<esri:SceneView.GraphicsOverlays>
<esri:GraphicsOverlay />
</esri:SceneView.GraphicsOverlays>
</esri:SceneView>
</Grid> private void MySceneView_SceneViewTapped(object sender, MapViewInputEventArgs e)
{
var overlay = MySceneView.GraphicsOverlays[0];
var symbol = new CompositeSymbol();
symbol.Symbols.Add(new SimpleMarkerSymbol() { Style = SimpleMarkerStyle.Circle, Color = Colors.Gray, Size= 20d, Outline = new SimpleLineSymbol() { Style = SimpleLineStyle.Solid, Color = Colors.Black, Width = 2d } });
symbol.Symbols.Add(new TextSymbol() { Text = "#", HorizontalTextAlignment = HorizontalTextAlignment.Center, VerticalTextAlignment = VerticalTextAlignment.Middle });
overlay.Graphics.Add(new Graphic(e.Location, symbol ));
} The alignment issue is fixed in v100. Unfortunately, I don't have a workaround to offer for the version you're using. Are you able to upgrade? The rendering issue is currently by design for GraphicsOverlay with (RenderingMode=Dynamic), which is the default. I'll forward your feedback to the team for consideration to accommodate the graphics and symbol collection order. Thanks.
... View more
06-21-2017
04:36 PM
|
1
|
2
|
1992
|
|
POST
|
Thank you, Xiaoguang for reporting this bug. I'm able to repro the issue that AccessViolationException is thrown when DefinitionExpression is cleared when LabelsEnabled is true in v100. Fortunately, this is no longer reproducible in Update 1. However when using v100, to workaround this bug meanwhile, you can mark LabelsEnabled false if the new DefinitionExpression will be empty and set it back to true. if (string.IsNullOrEmpty(clause) && isLabelsEnabled)
layer.LabelsEnabled = false;
layer.DefinitionExpression = clause;
if(string.IsNullOrEmpty(clause)&& isLabelsEnabled)
layer.LabelsEnabled = true;
... View more
06-19-2017
08:33 AM
|
0
|
1
|
1704
|
|
POST
|
Is `NAME` a field name in the service? If you use a name that does not exist on server you will get the same error: For example, when if I mistyped with `NAM` for `NAME`: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Notes/FeatureServer/0/query?where=NAM+LIKE+%27%25o%25%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=html FeatureTable.Fields should be able to give you the name to use in your query, it includes the same metadata found on server (i.e. FieldType, Name, Alias, IsEditable, etc).
... View more
06-16-2017
04:15 PM
|
0
|
1
|
1634
|
|
POST
|
In current released version v100, you can use GeodatabaseSyncTask.SyncGeodatabase to push your geodatabase edits back to the server, and for its parameters, specify RollbackOnFailure. https://developers.arcgis.com/net/latest/wpf/api-reference//html/P_Esri_ArcGISRuntime_Tasks_Offline_SyncGeodatabaseParameters_RollbackOnFailure.htm If there were any failure on server, you will get this value in the EditResults https://developers.arcgis.com/net/latest/wpf/api-reference//html/T_Esri_ArcGISRuntime_Data_SyncLayerResult.htm var task = await GeodatabaseSyncTask.CreateAsync(new Uri(featureServerUrl));
var parameters = await task.CreateDefaultSyncGeodatabaseParametersAsync(geodatabase);
var job = task.SyncGeodatabase(parameters, geodatabase);
var syncLayerResults = await job.GetResultAsync();
foreach (var result in syncLayerResults)
{
foreach (var editResult in result.EditResults)
{
editResult.CompletedWithErrors;
editResult.EditOperation;
editResult.Error;
}
} Offline map task and Offline map sync task are coming in Update 1.
... View more
06-16-2017
03:05 PM
|
0
|
2
|
1448
|
|
POST
|
Please see reply here: https://community.esri.com/thread/196388-open-an-sde-file-to-get-the-connection-my-geodatabase
... View more
06-16-2017
02:50 PM
|
0
|
0
|
1317
|
|
POST
|
This is a feature that is coming in Update 1 for LocalMapService. You should be able to create EnterpriseGeodatabaseWorkspace from either connection string or ArcSDE connection file and create a TableSublayerSource with this workspace for ArcGISMapImageSublayer. Dynamic rendering for ArcGISMapImageLayer is also new in Update 1.
... View more
06-16-2017
02:25 PM
|
3
|
4
|
6364
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-11-2025 01:30 PM | |
| 1 | 06-06-2025 10:14 AM | |
| 1 | 03-17-2025 09:47 AM | |
| 1 | 07-24-2024 07:32 AM | |
| 1 | 04-05-2024 06:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-12-2026
09:38 AM
|