|
POST
|
If you wish to interactively update the geometry, you can use SketchEditor. If you wish to update programmatically, you can use PolygonBuilder and/or GeometryEngine methods. To use SketchEditor, you will have something like this: xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:MapView x:Name="MyMapView" />
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Right">
<Button Content="Edit"
Click="OnEdit" />
<Button Content="Complete"
Command="{Binding ElementName=MyMapView, Path=SketchEditor.CompleteCommand}" />
</StackPanel>
</Grid> In code-behind, identify the feature to edit, grab its geometry to use SketchEditor, hide the feature while its geometry is being modified, update the feature with geometry from SketchEditor, and make feature visible again. In this sample, Edit will start the geometry edit and Complete will complete the geometry edit. public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2")));
}
private async void OnEdit(object sender, RoutedEventArgs e)
{
ArcGISFeature feature = null;
try
{
var mp = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Point, false) as MapPoint;
var sp = MyMapView.LocationToScreen(mp);
var result = await MyMapView.IdentifyLayersAsync(sp, 2, false);
feature = result.FirstOrDefault(i => i.GeoElements.Any(g => g is ArcGISFeature))?.GeoElements?.FirstOrDefault() as ArcGISFeature;
if (feature?.FeatureTable?.FeatureLayer == null)
return;
feature.FeatureTable.FeatureLayer.SetFeatureVisible(feature, false);
var geometry = await MyMapView.SketchEditor.StartAsync(feature.Geometry);
feature.Geometry = geometry;
await feature.FeatureTable.UpdateFeatureAsync(feature);
feature.FeatureTable.FeatureLayer.SetFeatureVisible(feature, true);
}
catch (TaskCanceledException) { }
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
finally
{
if (feature?.FeatureTable?.FeatureLayer != null)
feature.FeatureTable.FeatureLayer.SetFeatureVisible(feature, true);
}
}
... View more
08-02-2017
10:26 AM
|
0
|
0
|
915
|
|
POST
|
Hi Sam, Yes, this is the current limitation - we seem to be hitting this limit: https://sqlite.org/limits.html so you weren't setting up anything wrong. Thanks for your feedback. I've logged in an issue for the team to consider. default setting for SQLITE_MAX_COLUMN is 2000
... View more
07-26-2017
08:31 AM
|
0
|
0
|
5688
|
|
POST
|
Hi Mark, According to the developer who worked on the fix, you can do the following for the meantime: To avoid the problem user can: Remove indexes for UUID fields Use fields of string type instead of UUID, if it is possible.
... View more
07-26-2017
08:22 AM
|
0
|
1
|
1918
|
|
POST
|
Thanks, Mikkel for providing that information. I think empty symbol JSON means it's attempting to use advanced symbology. What version of the API are you using v100.1? Can you try this code with your geodatabase? var geodatabase = await Geodatabase.OpenAsync(@"c:\data\sample.geodatabase");
foreach (var table in geodatabase.GeodatabaseFeatureTables)
{
table.Loaded += (a, b) =>
{
var json = table.LayerInfo.DrawingInfo.Renderer.ToJson();
System.Diagnostics.Debug.WriteLine(json);
};
table.UseAdvancedSymbology = false;
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(table));
}
... View more
07-25-2017
02:19 PM
|
0
|
1
|
1625
|
|
POST
|
The problem seems to be with the number of fields these services have. Alternatively, you can add the layer as `ArcGISDynamicMapServiceLayer` if using v10.2.x or as `ArcGISMapImageLayer` if using v100.x. What operation are you looking to perform on the layer or features? If in v10.2.x, you can probably use QueryTask to workaround the issue that table cannot be created or loaded.
... View more
07-25-2017
02:05 PM
|
0
|
2
|
5688
|
|
POST
|
Thank you for reporting this issue. You seem to be working with v10.2.x, is that right? I'm also able to reproduce in v100.1. We'll be looking into this and let you know if there's any available workaround. Thanks.
... View more
07-25-2017
01:24 PM
|
0
|
0
|
5688
|
|
POST
|
You'll need to await GenerateCredential if you want to programmatically create the credential and get an exception thrown for bad username/password. The following code should give you an ArcGISWebException `You are not authorized to access this information`. try
{
var credential = await AuthenticationManager.Current.GenerateCredentialAsync(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire_secure_ac/FeatureServer"),
"user1",
"bad_password"); // u/p for this service is user1/user1;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
... View more
07-25-2017
12:47 PM
|
0
|
1
|
3195
|
|
POST
|
If LabelsEnabled is already true, maybe [name] attribute does not exist on that sublayer? If you remove the square brackets ([]), does the text `name` show as labels? You can try out this service and sample https://community.esri.com/thread/198759-label-dont-show-after-define-labeldefinition-for-arcgismapimagesublayer#comment-703333
... View more
07-25-2017
12:36 PM
|
0
|
2
|
1745
|
|
POST
|
Hi Mark, Thanks for reporting this issue. I'm able to reproduce the issue with released versions of the API v100.x. While I am not sure what is causing the basemap layers to fail during load, the issue appears fixed in our current version. I can find out for you if there's a workaround for this.
... View more
07-25-2017
12:11 PM
|
0
|
3
|
1918
|
|
POST
|
By any chance, does your symbology for point features include `visualVariables`? You can check using this code: var useworkaround = ((ArcGISFeatureTable)l.FeatureTable).LayerInfo?.DrawingInfo?.Renderer?.ToJson()?.Contains("visualVariables") ?? false;
If yes, you can mark UseAdvancedSymbology=false on the ArcGISFeatureTable before it is loaded. If not, do you mind sharing repro code/sample/data with us?
... View more
07-25-2017
11:33 AM
|
0
|
3
|
1625
|
|
POST
|
I tried your label JSON and it seems valid. Does 'name' attribute exist on the service? You also might be missing LabelsEnabled=true. I updated the JSON a bit to fit the service in this sample. MyMapView.Map = new Map(Basemap.CreateTopographic());
var layer = new ArcGISMapImageLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer"));
layer.Loaded += (s, e) =>
{
var subLayer = (ArcGISMapImageSublayer)layer.Sublayers[2];
subLayer.LabelsEnabled = true;
subLayer.LabelDefinitions.Add(LabelDefinition.FromJson(("{\"labelExpression\": \"[state_name]\",\"labelPlacement\": \"esriServerPolygonPlacementAlwaysHorizontal\",\"symbol\": {\"color\": [255,0,255,123],\"font\": {\"size\": 16},\"type\": \"esriTS\"}}")));
};
MyMapView.Map.OperationalLayers.Add(layer);
... View more
07-25-2017
11:24 AM
|
1
|
5
|
2851
|
|
POST
|
I'll answer your question with a sample. The basic idea is related tables all participate in the same map - whether it is another layer or a non-spatial table. You can get to the feature by identify/query. Once you have a feature, query its related features by either specifying specific relationship or getting all regardless of source. xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<esri:MapView x:Name="MyMapView" />
<TreeView x:Name="Result" Grid.Column="1" >
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding}">
<TextBlock Text="{Binding RelatedTable.TableName}" />
<HierarchicalDataTemplate.ItemTemplate>
<DataTemplate>
<ItemsControl ItemsSource="{Binding Attributes}"
Grid.Column="1">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Key, StringFormat={}{0} :}" />
<TextBlock Text="{Binding Value, StringFormat={} {0}}"
Grid.Column="1" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</Grid> MyMapView.GeoViewTapped += MyMapView_GeoViewTapped;
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(new Uri("https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/ArcGIS/rest/services/AlaskaNationalParksPreservesSpecies_List/FeatureServer/1")));
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(new Uri("https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/ArcGIS/rest/services/AlaskaNationalParksPreservesSpecies_List/FeatureServer/0")));
MyMapView.Map.Tables.Add(new ServiceFeatureTable(new Uri("https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/ArcGIS/rest/services/AlaskaNationalParksPreservesSpecies_List/FeatureServer/2")));
MyMapView.Map.InitialViewpoint = new Viewpoint(new Envelope(-17677159.6926513, 7932123.08666798, -16355129.8191665, 9451936.95697339, SpatialReferences.WebMercator));
}
private async void MyMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
{
var result = await MyMapView.IdentifyLayersAsync(e.Position, 2, false);
foreach (var identifyResult in result)
{
if (identifyResult.LayerContent is FeatureLayer && ((FeatureLayer)identifyResult.LayerContent).FeatureTable is ArcGISFeatureTable)
{
var table = (ArcGISFeatureTable)((FeatureLayer)identifyResult.LayerContent).FeatureTable;
foreach (ArcGISFeature feature in identifyResult.GeoElements)
{
var queryResults = await table.QueryRelatedFeaturesAsync(feature);
Result.ItemsSource = queryResults.ToArray();
}
}
}
}
... View more
07-25-2017
10:00 AM
|
0
|
19
|
5023
|
|
POST
|
I see, thanks for posting the workaround that worked for you. I'm able to reproduce that Clone omits DefinitionExpression when set in the original. Apparently this clone issue is already logged. Hopefully these issues you found are resolved in future versions of the API. Thanks. If table is already loaded and you only want to do this workaround when necessary, you can add this filter. var useworkaround = ((ArcGISFeatureTable)l.FeatureTable).LayerInfo?.DrawingInfo?.Renderer?.ToJson()?.Contains("visualVariables") ?? false;
... View more
07-14-2017
09:20 AM
|
0
|
2
|
1559
|
|
POST
|
Alternatively, you can load the map to get to its FeatureLayers and load their table to get GeometryType. Since UseAdvancedSymbology can only be set before table is loaded, you will need to clone the original layer and get its unloaded table and modify this property. Also, be sure to replace the original layer with cloned layer. Very similar to Antti's proposed workaround the only difference is not having to open MobileMapPackage twice and I believe you already attempted the clone. var mmpk = await MobileMapPackage.OpenAsync(path);
var map = mmpk.Maps.FirstOrDefault();
await map.LoadAsync();
var layers = map.OperationalLayers.OfType<FeatureLayer>().ToArray();
foreach (var l in layers)
{
await l.FeatureTable.LoadAsync();
if (l.FeatureTable.GeometryType == GeometryType.Point)
{
var clone = l.Clone() as FeatureLayer;
var table = (ArcGISFeatureTable)clone.FeatureTable;
table.UseAdvancedSymbology = false;
map.OperationalLayers.Remove(l);
map.OperationalLayers.Add(clone);
}
}
MyMapView.Map = map;
... View more
07-14-2017
09:00 AM
|
0
|
4
|
1559
|
|
POST
|
No problem, I updated the workaround a bit - no need to load and clone.
... View more
07-07-2017
02:13 PM
|
0
|
0
|
7535
|
| 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
|