POST
|
Thanks for following-up and sharing with us the root of the problem. I am curious to know how the table was created and why ServiceGeodatabase do not see this edit. If you loaded the feature service from a webmap or called ServiceGeodatabase.getTable() to create the ServiceFeatureTable, the ServiceFeatureTable will have a ServiceGeodatabase property. You'd see ServiceGeodatabase.connectedTables include this table. Your feature should have access to the same ServiceGeodatabase. If however, you used a ServiceFeatureTable constructor, then the table will not have a ServiceGeodatabase. You can add a check to ServiceGeodatabase.hasLocalEdits() or ServiceFeatureTable.hasLocalEdits(), before calling the appropriate applyEdits. If this returns false, there are no edits to send to server. It is best to use ServiceGeodatabase, for these reasons: https://developers.arcgis.com/net/edit-features/apply-edits/ if (feature.FeatureTable is ServiceFeatureTable sft && sft.ServiceGeodatabase is ServiceGeodatabase sgdb)
{
if (sgdb.HasLocalEdits())
{
await sgdb.ApplyEditsAsync();
}
}
... View more
3 weeks ago
|
0
|
0
|
58
|
POST
|
Could your ApplyEdits be wrapped in a try-catch? Can you see if exception has message/details? Could the new feature be rejected by server because of geometry (has or lack of m/z-value, spatial reference, outside layer extent) or attributes (any unspecified required fields, data type mismatch, domain errors, or perhaps constraint rule violation)? Few other things you can try: After addFeatureAsyc, check getAddedFeaturesCountAsync to ensure new feature was added. Before applyEdits subscribe to ArcGISHttpClientHandler events: HttpBeginRequest and HttpResponseEnd. You can check request URI on Begin to ensure an /applyEdits request was made. And read content as string on End to ensure an appropriate server response in JSON was received. This should provide objectid or globalid when successful or an error code/message. If the message is the generic unable to complete, you can check server logs for verbose message if you have access to the server.
... View more
3 weeks ago
|
1
|
1
|
105
|
POST
|
I used your code to generate geodatabase from a feature service portal item but I only see 1 replica created. We also have branch versioning enabled on this feature service. What ArcGIS Enterprise version are you using? I tried ArcGIS Enterprise 11.0, utility network version 6. ArcGIS Runtime WPF build 200.2.
... View more
11-14-2023
01:20 PM
|
0
|
0
|
464
|
POST
|
You can try the following simplified sample that contains the MapView with GraphicsOverlay for displaying the new geometry and some buttons that Start/Stop/DeleteVertex on GeometryEditor. Using the PropertyChanged event of the GeometryEditor, you can check its Geometry and update its VertexTool properties. The PolylineBuilder's IsSketchValid currently checks the minimum required number of points for a polyline so having two unique points is considered valid. Per Shelly's recommendation, if you want to continue to edit the geometry, you can use the Tools' InteractionConfiguration to enable/disable which vertex editing is allowed. For example, disable new vertex creation. <esri:MapView x:Name="MyMapView" />
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Right">
<Button Content="Line Segment"
Click="OnDrawLine" />
<Button Content="Delete Vertex"
Click="OnDeleteVertex" />
<Button Content="Complete Line Segment"
Click="OnCompleteDraw" />
</StackPanel> public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(SpatialReferences.WebMercator);
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay()
{
Renderer = new SimpleRenderer(new SimpleLineSymbol() { Color = Color.Blue, Style = SimpleLineSymbolStyle.Solid, Width = 2 })
});
MyMapView.GeometryEditor.PropertyChanged += OnGeometryPropertyChanged;
}
private bool EnsureTwoPoints => MyMapView.GeometryEditor?.Geometry is Polyline polyline &&
new PolylineBuilder(polyline).IsSketchValid;
private void OnGeometryPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(GeometryEditor.Geometry))
{
if (MyMapView.GeometryEditor.Tool is VertexTool vertexTool)
{
vertexTool.Configuration.AllowVertexCreation = !EnsureTwoPoints;
}
}
}
private void OnDrawLine(object sender, RoutedEventArgs e)
{
if (MyMapView.GeometryEditor.IsStarted)
{
return;
}
MyMapView.GeometryEditor.Start(GeometryType.Polyline);
}
private void OnDeleteVertex(object sender, RoutedEventArgs e)
{
if (!MyMapView.GeometryEditor.IsStarted)
return;
if (MyMapView.GeometryEditor.SelectedElement is GeometryEditorVertex)
MyMapView.GeometryEditor.DeleteSelectedElement();
}
private void OnCompleteDraw(object sender, RoutedEventArgs e)
{
if (!MyMapView.GeometryEditor.IsStarted || !EnsureTwoPoints)
return;
var geometry = MyMapView.GeometryEditor.Stop();
if (MyMapView.GraphicsOverlays.FirstOrDefault() is GraphicsOverlay overlay)
{
overlay.Graphics.Add(new Graphic(geometry));
}
} Click Line Segment button to start drawing Click Delete Vertex button to remove selected vertex Click Complete Line Segment button to stop drawing. Notice in this small sample code, vertex creation is only allowed when you have not met the minimum 2 points.
... View more
11-13-2023
09:05 AM
|
1
|
0
|
414
|
POST
|
You can subscribe to `GeometryEditor.PropertyChanged` event and monitor the `GeometryEditor.Geometry` property. If this is a polyline, you can use `PolylineBuilder` it's `IsSketchValid()` method already checks for the minimum set, 2 unique points. You can check the code-snippet in the Asynchronous start task with geometry result section of this blog post. You can have it throw an error or call `GeometryEditor.Stop()` so drawing is completed once you have at most 2 points.
... View more
11-06-2023
01:56 PM
|
0
|
0
|
476
|
BLOG
|
Thank you to our dear MVP's for remaining engaged in our esri community! Your feedback and contributions are most invaluable not only to your fellow developers using the Native Maps SDK (Runtime); but especially to us, in the development team, who are continuously learning, growing, and building the product with you. Thank you!
... View more
05-26-2023
09:42 AM
|
4
|
0
|
3079
|
POST
|
Inspecting fiddler capture will definitely help you troubleshoot whether the query you're making on the browser is identical to the request made through Runtime. In addition should they be different... A quick check if you will need to use paging query is to FeatureTable.QueryFeatureCountAsync if the result is more than the LayerInfo.MaxRecordCount and LayerInfo.SupportsPagination is true, you can pass a ResultOffset and MaxFeaturesCount in the QueryParameters. Another cause why query result count is different from server is you may have set a DefinitionExpression on the table which will limit the features accessible to you.
... View more
05-26-2023
09:30 AM
|
1
|
0
|
394
|
POST
|
Thanks for your feedback. You are right that there's no way of updating or providing your own predicate for AddCommand to have it respond only to touch event. How are you passing the CommandParameter for AddCommand? This is only enabled with MapPoint. If you don't want AddCommand to execute and add vertex to your polyline/polygon, could you may be provide MapPoint vertex only when a touch gesture is detected? Alternatively, you can call InsertVertexAfterSelectedVertex method with a more restrictive check. Or you may pause SketchEditor from responding to interaction using its IsEnabled property. If only vertex-editing need to be suspended you can set SketchEditConfiguration.VertexEditMode to SelectionOnly.
... View more
04-15-2021
09:53 AM
|
1
|
1
|
774
|
POST
|
Does layer.InitializeAsync trigger a challenge if you subscribe to ChallengeHandler? IdentityManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
{
var cred = await
IdentityManager.Current.GenerateCredentialAsync(info.ServiceUri, "<username>", "<password>");
return cred;
}); It may be possible that you need to AddCredential for ServiceUri that match server https://<portal server>/server/rest
... View more
04-15-2021
09:52 AM
|
0
|
1
|
1600
|
POST
|
Thanks for reporting this bug. I can reproduce that updating vertex by interaction allows undo/redo while updating vertex by code with MoveSelectedVertex, cannot be undone without the vertex being deleted. It also appears that GeometryChanged event does not report this as move vertex but as move geometry. As a workaround, you may subscribe to SelectedVertexChanged event and use this to track the newly inserted vertex (e.NewVertex.Point will be the unmodified/unsnapped vertex). Whether you interactively add point or call InsertAfterSelectedVertex, this event will fire.
... View more
02-16-2021
08:47 AM
|
1
|
0
|
912
|
POST
|
There may be a few SketchEditor commands that you can specify in XAML (like Complete/Cancel/Undo/Redo/Delete). However, you can only begin a draw in code-behind using one of the StartAsync methods. Based on SketchCreation mode, shape is drawn based on MapView events. For example, tap/click for point or adding vertices in polyline/polygon, drag/move for freehand, arrow, rectangle, triangle, circle, ellipse shapes. Few XAML example code would be to set DataContext to MapView's SketchEditor and use Command Binding. <Grid DataContext="{Binding ElementName=MyMapView,Path=SketchEditor}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding IsEnabled, Mode=TwoWay}"
Content="IsEnabled" />
<CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay}"
Content="IsVisible"
Grid.Column="1" />
<Slider Minimum="0"
Maximum="1"
Value="{Binding Opacity, Mode=TwoWay}"
Grid.ColumnSpan="2"
Grid.Row="1" />
<Button x:Name="AddButton"
Content="Add"
Command="{Binding AddCommand}"
Grid.Row="2" />
<Button Content="Delete"
Command="{Binding DeleteCommand}"
Grid.Row="2"
Grid.Column="1" />
<Button Content="Undo"
Command="{Binding UndoCommand}"
Grid.Row="3" />
<Button Content="Redo"
Command="{Binding RedoCommand}"
Grid.Row="3"
Grid.Column="1" />
<Button Content="Cancel"
Command="{Binding CancelCommand}"
Grid.Row="4" />
<Button Content="Complete"
Command="{Binding CompleteCommand}"
Grid.Row="4"
Grid.Column="1" />
</Grid> If you have provided SketchEditorConfiguration in resource, you can access this by key and update it's properties using XAML-binding too. <Window.Resources>
<esri:SketchEditConfiguration x:Key="MySketchEditConfiguration" />
</Window.Resources>
<StackPanel DataContext="{StaticResource MySketchEditConfiguration}">
<ComboBox x:Name="ResizeModes"
SelectedItem="{Binding ResizeMode, Mode=TwoWay}" />
<CheckBox IsChecked="{Binding RequireSelectionBeforeDrag, Mode=TwoWay}"
Content="RequireSelectionBeforeDrag" />
<CheckBox IsChecked="{Binding AllowMove, Mode=TwoWay}"
Content="AllowMove" />
<ComboBox x:Name="VertexEditModes"
SelectedItem="{Binding VertexEditMode, Mode=TwoWay}" />
<CheckBox IsChecked="{Binding AllowVertexEditing, Mode=TwoWay}"
Content="AllowVertexEditing" />
<CheckBox IsChecked="{Binding AllowRotate, Mode=TwoWay}"
Content="AllowRotate" />
</StackPanel>x Depending whether you are creating a new shape or editing an existing geometry, you may call any of the StartAsync methods. var editConfig = this.Resources["MySketchEditConfiguration"] as SketchEditConfiguration;
var geometry = await MyMapView.SketchEditor.StartAsync(creationMode, editConfig);
... View more
11-10-2020
09:36 AM
|
0
|
0
|
1065
|
POST
|
What version of ArcGIS Runtime SDK for .NET are you using? There should be a Stop which may be less awkward to call in code than Complete command but they function the same. Could it be possible that StartAsync for the next draw is triggered, maybe events are stepping on each other? You can also check SketchEditor.IsEnabled and SketchEditor.Geometry?.IsEmpty() == false to know that something is actively being drawn/edited. You can put breakpoint where `catch(TaskCanceledException){}` is handled or where you have any StartAsync call to see if maybe another session cancels the draw.
... View more
10-01-2020
09:24 AM
|
0
|
1
|
2737
|
POST
|
When drawAndEdit parameter is true as in your code snippet, after the drawing a shape it will go to edit mode and wait for Complete command. If you wanted to complete draw as soon as you release the mouse/touch, you'd want drawAndEdit=false for shapes like Arrow, Circle, Ellipse, FreehandLine, FreehandPolygon. You can try the following sample and toggle the value for drawAndEdit, use the Complete/Cancel buttons to end draw/edit mode. Another way is to call MyMapView.SketchEditor.StopAsync() at any time which will also complete the draw/edit. <Grid>
<esri:MapView x:Name="MyMapView" />
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Right"
Orientation="Horizontal">
<ComboBox x:Name="DrawModes" />
<CheckBox x:Name="DrawAndEdit"
Content="DrawAndEdit"
IsChecked="False" />
<Button Content="Draw"
Click="OnDraw" />
<Button Content="Complete"
Command="{Binding ElementName=MyMapView, Path=SketchEditor.CompleteCommand}" />
<Button Content="Cancel"
Command="{Binding ElementName=MyMapView, Path=SketchEditor.CancelCommand}" />
</StackPanel>
</Grid> public MainWindow()
{
InitializeComponent();
DrawModes.ItemsSource = Enum.GetValues(typeof(SketchCreationMode));
MyMapView.Map = new Map(Basemap.CreateTopographicVector());
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay());
}
private SimpleFillSymbol _fillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Color.Blue, null);
private async void OnDraw(object sender, RoutedEventArgs e)
{
try
{
var drawAndEdit = DrawAndEdit.IsChecked.HasValue && DrawAndEdit.IsChecked.Value;
if (DrawModes.SelectedItem is SketchCreationMode creationMode)
{
var geometry = await MyMapView.SketchEditor.StartAsync(creationMode, drawAndEdit);
MyMapView.GraphicsOverlays[0].Graphics.Add(new Graphic(geometry, _fillSymbol));
}
}
catch (TaskCanceledException) { }
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
}
}
... View more
10-01-2020
08:40 AM
|
0
|
5
|
2737
|
POST
|
Hi Joe, I think you may be missing a `FeatureTable.UpdateFeatureAsync(feature)` call. You can also check `ArcGISFeatureTable.GetUpdatedFeatures/CountAsync()` if the related feature is included or that this edit results to `ArcGISFeatureTable.HasLocalEdits()` or `Geodatabase.HasLocalEdits()` returning true. Jennifer
... View more
09-25-2020
10:15 AM
|
1
|
1
|
756
|
POST
|
Thank you, Joe for the valuable information you sent us. The issue appears to be the definition expression that is on some of the layers. These expressions are loaded from the webmap, and are filtering out the results returned from GetFeaturesForElementsAsync(). We’ve logged an issue to ignore the expression during this function call. It looks like the definition expressions are being used to create multiple layers, one for each AssetGroup. If you have Pro 2.6 and Enterprise 10.8.1, you can create a map in Pro that contains subtype group layers and publish it to a webmap. This webmap can be consumed using Runtime 100.9, which just shipped today. We suggest using a single SubtypeGroupLayer instead for each server endpoint (i.e. Gas Device/Line/Junction) when you publish your webmap using ArcGIS Pro. This will improve performance, and eliminate the need for using the definition expression. The Runtime equivalent of this layer is SubtypeFeatureLayer. Since it is a sub-class of FeatureLayer, there’s minimal to no change in code necessary. If you are identifying features from this layer, the result will be in SublayerResults. var feature = result.FirstOrDefault(r => r.SublayerResults.Any(sr => sr.GeoElements.Any(g => g is ArcGISFeature)))
?.SublayerResults?.FirstOrDefault()?.GeoElements?.FirstOrDefault() as ArcGISFeature;
... View more
08-27-2020
02:31 PM
|
0
|
1
|
2558
|
Title | Kudos | Posted |
---|---|---|
1 | 3 weeks ago | |
1 | 11-13-2023 09:05 AM | |
1 | 04-26-2011 06:50 PM | |
1 | 05-26-2023 09:30 AM | |
4 | 05-26-2023 09:42 AM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|