|
POST
|
Thank you for reporting this bug. We have logged the issue and I had just verified core fix. Please try again in the next release of ArcGIS Runtime SDK for .NET. I also could not find an elegant workaround for this. I don't know if it's an option for you to temporarily remove the layer from the map until SyncGeodatabaseJob completes. MyMapView.Map.OperationalLayers.Remove(layer);
var result = await job.GetResultAsync();
MyMapView.Map.OperationalLayers.Add(layer); Should you decide to reset `FeatureLayer.DefinitionExpression`, you might also want to set the visibility of the features that do not satisfy definition expression. // Reset `DefinitionExpression`
layer.DefinitionExpression = "1=1";
var table = layer.FeatureTable as ArcGISFeatureTable;
// Change visibility of features that do not satisfy `DefinitionExpression`
var features = await table.QueryFeaturesAsync(new QueryParameters() { WhereClause = "type <> 2" });
layer.SetFeaturesVisible(features, false);
var result = await job.GetResultAsync();
// Set `DefinitionExpression` back
layer.DefinitionExpression = "type = 2"; Thanks again.
... View more
05-07-2018
10:40 AM
|
0
|
3
|
1141
|
|
POST
|
Thank you, Andy. We have an open design issue for allowing drag from fill. As for the EditConfiguration not taking effect next time - is because it's not a global setting. StartAsync has an optional parameter that accepts SketchEditConfiguration. If this is not supplied, we determine based on the type of geometry whether to enable scale/rotate/vertex editing, etc. The default setting for RequireSelectionBeforeDrag is true. To set it to false, you can either, pass the parameter or set it after StartAsync or set to false in a two-way binding. MyMapView.SketchEditor.StartAsync(
SketchCreationMode.Polygon,
new SketchEditConfiguration() { RequireSelectionBeforeDrag = false } // as parameter
);
// or set after StartAsync
MyMapView.SketchEditor.EditConfiguration.RequireSelectionBeforeDrag = false; If you used two-way binding, you would notice that next call to StartAsync will reset this back to true(checked). <CheckBox Content="Select" IsChecked="{Binding ElementName=MyMapView, Path=SketchEditor.EditConfiguration.RequireSelectionBeforeDrag, Mode=TwoWay}"/>
... View more
04-03-2018
12:43 PM
|
0
|
1
|
6189
|
|
POST
|
You can add this conditional compile directive #if NETFX_CORE
using Color = Windows.UI.Colors;
#else
using Color = System.Drawing.Color;
#endif which should allow you to create symbols the same way as before. It may had just been trying to resolve Color using Xamarin.Forms so you need to select the appropriate namespace. var symbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Cross, Color.Blue, null);
... View more
03-15-2018
10:24 AM
|
1
|
2
|
1752
|
|
POST
|
Hi Xiaoguang, `RequireSelectionBeforeDrag` only changes the behavior of when a geometry or tool (vertex, scale, rotate) gets moved, it would be immediate once dragged, no need to tap/highlight. But you are right, in 10.2.x, one can drag geometry from the fill/area and in 100.x one can drag geometry only from its outline. The reason for this design is to allow vertices to be added/moved inside the geometry fill as well which was a limitation in 10.2.x. I will forward this request to runtime design lead for consideration. We have also included in 100.2.x enhancements ability to select, insert/move/delete vertices programmatically - I'm not sure if helps your current workflow. Meanwhile, if it's a challenge to select the polygon outline, you might want to update SketchEditor.Style. // change symbol
MyMapView.SketchEditor.Style = new SketchStyle()
{
LineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Colors.Green, 8)
};
// or just increase width of default symbol
(MyMapView.SketchEditor.Style.LineSymbol as LineSymbol).Width = 8; You may also at any time without restarting your draw/edit turn on/off any of the configuration <CheckBox Content="VertexEditing" IsChecked="{Binding ElementName=MyMapView, Path=SketchEditor.EditConfiguration.AllowVertexEditing, Mode=TwoWay}"/> Hopefully, these make interacting with polygon outline better.
... View more
03-08-2018
10:43 AM
|
0
|
0
|
2944
|
|
POST
|
I know this is quite an old post but EditConfiguration has `RequireSelectionBeforeDrag` property since v100.2 when set to false will have the same 10.2.x behavior geometry or vertex/scale/rotate tools can be dragged without being tapped or highlighted first.
... View more
03-07-2018
12:07 PM
|
0
|
2
|
2944
|
|
POST
|
If you are looking for guide docs/samples on saving the changes you made on your map to back to portal, you can look at these links: https://developers.arcgis.com/net/latest/forms/guide/save-a-map.htm https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/master/src/WPF/ArcGISRuntime.WPF.Samples/Samples/Map/AuthorMap https://developers.arcgis.com/net/latest/forms/guide/save-a-map.htm
... View more
02-28-2018
03:09 PM
|
0
|
0
|
832
|
|
POST
|
Thanks for your feedback. From within runtime, you can use the same file path to create multiple instances of ShapefileFeatureTable without lock issue. I have also tried multiple instances of this app and the tables are created and loaded without a problem. However, I have not tried another software that fails to open the shape file because it's in use. Is the other software attempting to edit simultaneously with your runtime app? I can put in an enhancement to include Close method but we'd also appreciate more information. Thank you.
... View more
02-28-2018
01:42 PM
|
0
|
1
|
1142
|
|
POST
|
Hi Max, Thank you for your feedback. While it was intentional for geometry to be returned when mouse/touch is released for shapes drawn by drag (i.e. Arrow, Circle, Ellipse, Rectangle, FreehandLine, FreehandPolygon) when drawAndEdit=false and its expected complete gesture of mouse/touch up occurs, I can see how the behavior is in conflict with the other creation modes (i.e. Polyline, Polygon) which would have returned a multi-part geometry with shared vertices when its expected complete gesture of double tap occurs. The return type would still be dependent on the creation mode, which means we cannot return a MapPoint if Rectangle mode was used but we should probably return you a Polygon with shared vertices as the other two modes do. As for your specific use case, you should be able to do something like this which subscribes to GeoViewTapped event only when needed and use tapped location as fallback if the gesture did not result into a polygon. I still logged an issue for consideration so we can be more consistent in returning geometry for all modes. private async Task<Esri.ArcGISRuntime.Geometry.Geometry> GetSelectionGeometryAsync()
{
MapPoint selectionPoint = null;
EventHandler<GeoViewInputEventArgs> handler = (a, b) =>
{
selectionPoint = b.Location;
};
try
{
MyMapView.GeoViewTapped += handler;
var geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false);
var selectionGeometry = geometry ?? selectionPoint;
return geometry;
}
catch (TaskCanceledException) { }
finally
{
MyMapView.GeoViewTapped -= handler;
}
return selectionPoint;
}
... View more
02-28-2018
10:14 AM
|
2
|
1
|
1610
|
|
POST
|
As you pointed out `drawAndEdit`, which completes draw by double-click for SketchCreationMode.Polygon/Polygline, is not an option when passing existing geometry. But you should be able to execute Cancel/Complete any time to mimic the same behavior during edit. Are you seeing a regression in v100.2.0? I had just tried the following code with latest. GeoViewDoubleTapped event fires just fine, CompleteCommand also gets executed returning the updated geometry. public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay());
MyMapView.GeoViewDoubleTapped += (s, e) =>
{
if (_editStarted && MyMapView.SketchEditor.CompleteCommand.CanExecute(null))
MyMapView.SketchEditor.CompleteCommand.Execute(null);
};
}
private async void OnDraw(object sender, RoutedEventArgs e)
{
try
{
var geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Polygon, false);
var overlay = MyMapView.GraphicsOverlays[0];
overlay.Graphics.Add(new Graphic(geometry, new SimpleFillSymbol()));
}
catch (TaskCanceledException) { }
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
}
private bool _editStarted = false;
private async void OnEdit(object sender, RoutedEventArgs e)
{
Graphic graphic = null;
try
{
var overlay = MyMapView.GraphicsOverlays[0];
graphic = overlay.Graphics.FirstOrDefault();
if (graphic == null)
return;
graphic.IsVisible = false;
_editStarted = true;
var geometry = await MyMapView.SketchEditor.StartAsync(graphic.Geometry);
graphic.Geometry = geometry;
}
catch (TaskCanceledException) { }
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
finally
{
_editStarted = false;
if (graphic != null)
graphic.IsVisible = true;
}
}
Can you share some code on how I may be able to reproduce the issue? Thank you.
... View more
01-18-2018
12:43 PM
|
0
|
2
|
2798
|
|
POST
|
You can use NavigationCompleted event and GeometryEngine to check if the current extent is still within MaximumExtent. Something like this? Any of the SetView calls will raise NavigationCompleted and you can do checks then. Envelope lastExtent = null;
MyMapView.NavigationCompleted += (s, e) =>
{
if (MyMapView.MaximumExtent == null || GeometryEngine.Within(MyMapView.Extent, MyMapView.MaximumExtent) || (lastExtent?.IsEqual(MyMapView.Extent) ?? false))
return;
lastExtent = MyMapView.Extent;
MyMapView.SetViewAsync(new Viewpoint(GeometryEngine.Intersection(MyMapView.Extent, MyMapView.MaximumExtent)));
};
... View more
12-13-2017
12:45 PM
|
0
|
1
|
1528
|
|
POST
|
In v100.x, you no longer set a Token property. You may set Credential or implement ChallengeHandler. AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
{
// Option A: Use ChallengeHandler to prompt for login
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, "username", "password");
});
var layer = new ArcGISMapImageLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire_secure/MapServer"));
// Option B: Set Credential property
layer.Credential = await AuthenticationManager.Current.GenerateCredentialAsync(layer.Source, "user1", "user1");
MyMapView.Map = new Map(new Basemap(layer));
... View more
12-13-2017
11:55 AM
|
0
|
0
|
803
|
|
POST
|
In the sample you referenced, the features were displayed initially as an image from server through dynamic layer and retrieved/downloaded to the table only once you identify/select it for editing. It is the query call that downloads a local copy of the feature and allows you to edit its attributes, geometry, and/or attachments. This workflow sounds like it should also work for your use case. The local cache is a geodatabase with service metadata and requested features. It's content depends on the selected query mode, query and other filters like Where, OutFields, etc. You can access this using the table instance through query, create, add, update, delete methods. Is there a specific database operation or metadata you're not finding available in the API? The local geodatabase is just a temporary file that allows clients to choose which features to download from or edits to upload to server. `QueryAsync(featureID)` is necessary because `UpdateFeature` requires a feature parameter and query will find the feature by id and load it for editing so you can do operations like update its geometry and attributes. It is not the only query available though, you may query by where clause or geometry.
... View more
12-13-2017
11:42 AM
|
0
|
0
|
995
|
|
POST
|
We also have this migration topic that might be useful in finding the correct namespace and class names Migrate from 10.2.x to 100.x—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers If you already know the new class name, you can also just hit "CTRL" + "." keys on Visual Studio to resolve the namespace.
... View more
12-13-2017
11:08 AM
|
0
|
0
|
1482
|
|
POST
|
No problem at all. It wasn't a waste of time. You actively checked other ways to create geodatabase and query related features and those were very good feedback. I'm glad it's working for you too.
... View more
09-26-2017
02:21 PM
|
0
|
1
|
2093
|
|
POST
|
Thanks, Chad for the geodatabase. I'm unable to repro with v100.1. It seems like the first relationship reports no related features and the rest of the tables have at least one related feature. Is this what you'd expect with your data? I used the following code.. similar code for Xamarin Android, slight differences would be namespace how you retrieve file path and display alert messages. public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.LayerViewStateChanged += OnLayerViewStateChanged;
MyMapView.GeoViewTapped += OnGeoViewTapped;
}
private async void OnGeoViewTapped(object sender, GeoViewInputEventArgs e)
{
try
{
var results = await MyMapView.IdentifyLayersAsync(e.Position, 2, false);
var layerResult = results?.FirstOrDefault(f =>
f.LayerContent is FeatureLayer &&
((FeatureLayer)f.LayerContent).FeatureTable is ArcGISFeatureTable &&
f.GeoElements.Any());
if (layerResult == null)
return;
var layer = (FeatureLayer)layerResult.LayerContent;
var table = (ArcGISFeatureTable)layer.FeatureTable;
var feature = (ArcGISFeature)layerResult.GeoElements.FirstOrDefault();
var queryResults = await table.QueryRelatedFeaturesAsync(feature);
foreach (var r in queryResults.ToArray())
{
MessageBox.Show($"Feature with ID `{feature.Attributes[table.ObjectIdField]}` has `{r.Count()}` related features from `{r.RelatedTable.TableName}`.");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
}
private void OnLayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
{
var error = e.LayerViewState.Error ?? e.Layer.LoadError;
if (error != null)
MessageBox.Show(error.Message, error.GetType().Name);
}
private async void OnLoad(object sender, RoutedEventArgs e)
{
try
{
var geodatabase = await Geodatabase.OpenAsync(@"E:\dev\palmbeach.geodatabase");
var extent = geodatabase.GenerateGeodatabaseExtent as Envelope;
foreach(var table in geodatabase.GeodatabaseFeatureTables)
{
await table.LoadAsync();
if (table.HasGeometry)
{
if (extent == null || extent.IsEmpty)
extent = table.Extent;
else
extent = GeometryEngine.CombineExtents(extent, table.Extent);
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(table));
}
else
MyMapView.Map.Tables.Add(table);
if (extent != null && !extent.IsEmpty)
await MyMapView.SetViewpointAsync(new Viewpoint(extent));
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
}
... View more
09-26-2017
12:57 PM
|
2
|
4
|
2093
|
| 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 |
11-03-2025
08:39 PM
|