|
POST
|
Sure that will be helpful, thanks! We will investigate, it sounds like a different issue then.
... View more
09-25-2017
09:16 AM
|
0
|
6
|
2684
|
|
POST
|
Hi Chad, The workflow you mentioned, consuming runtime content from ArcMap, should have also worked. I just checked that the issue Nagma referenced had something to do with related tables not participating in the same map which is why no related features were returned. This is a requirement per https://developers.arcgis.com/net/latest/wpf/api-reference//html/M_Esri_ArcGISRuntime_Data_ArcGISFeatureTable_QueryRelatedFeaturesAsync.htm. Are your related tables all part of the same map? Thanks.
... View more
09-22-2017
02:55 PM
|
0
|
8
|
2684
|
|
POST
|
Hi, I'm sorry for the delay in reply. The IReadOnlyList<RelatedFeatureQueryResult>, result object from awaiting QueryRelatedFeaturesAsync, is a collection of iterator of features. In any platform, you can do something like this to access the related features and their attributes. In the original sample Result is a TreeView and individual template binds to table name and feature attributes. var queryResults = await table.QueryRelatedFeaturesAsync(feature);
var resultCollection = queryResults.ToArray();
foreach (var queryResult in resultCollection)
{
foreach(var f in queryResult)
{
var sft = (ServiceFeatureTable)f.FeatureTable;
var id = (long)f.Attributes[sft.ObjectIdField];
}
}
... View more
09-20-2017
11:02 AM
|
0
|
15
|
5005
|
|
POST
|
I think you can use GeometryEngine methods then to see if your selection rectangle intersects with the graphic geometries. private async void OnSelect(object sender, RoutedEventArgs e)
{
try
{
var rectangle = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false);
foreach (var overlay in MyMapView.GraphicsOverlays)
{
foreach (var graphic in overlay.Graphics)
graphic.IsSelected = GeometryEngine.Intersects(graphic.Geometry, rectangle);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
}
... View more
09-08-2017
12:14 PM
|
0
|
2
|
2257
|
|
POST
|
As Joe already mentioned, FeatureLayer popup can be configured on the web map. But you can also configure it in the client. For example, try the following code (see current value of popup): MyMapView.Map = new Map(new Uri("https://www.arcgis.com/home/webmap/viewer.html?webmap=ff0e158ffb184e41b8cea71ebda3eb67"));
MyMapView.LayerViewStateChanged += (s, e) =>
{
if (e.Layer is FeatureLayer && e.LayerViewState.Status == LayerViewStatus.Active)
{
var popup = ((FeatureLayer)e.Layer).PopupDefinition;
}
};
}
private void OnLoad(object sender, RoutedEventArgs e)
{
var layer = new FeatureLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0"));
layer.PopupDefinition = new PopupDefinition() { Title = "My Title" };
layer.PopupDefinition.Fields.Add(new PopupField() { Label = "description", FieldName = "description ", IsEditable = true, IsVisible = true, StringFieldOption = PopupStringFieldOption.SingleLine });
MyMapView.Map.OperationalLayers.Add(layer);
}
... View more
09-08-2017
12:01 PM
|
1
|
1
|
2348
|
|
POST
|
The v100.x equivalent for this method is IdentifyGraphicsOverlayAsync providing a tolerance parameter will create the rectangle with this height and width, you can also provide the number of maximum results you want returned. There's also an overload for identifying all graphics overlays versus this one where hit test (or identify) will be done on specified graphics overlay only.
... View more
09-08-2017
11:42 AM
|
0
|
4
|
2257
|
|
POST
|
Oh I see, sorry I misunderstood. Rotate with scale cannot keep the rectangle shape but you can probably add your logic in SketchEditor.GeometryChanged event handler, perhaps? You have access to e.NewGeometry then and can do a check whether it's still rectangle shape and maybe call SketchEditor.ReplaceGeometry with the closest rectangle shape. I am not sure if there are any GeometryEngine methods (if any) that can help with those calculations, but I hope that helps. MyMapView.SketchEditor.GeometryChanged += SketchEditor_GeometryChanged;
}
private void SketchEditor_GeometryChanged(object sender, GeometryChangedEventArgs e)
{
var geometry = e.NewGeometry;
if(!IsRectangle(geometry))
MyMapView.SketchEditor.ReplaceGeometry(ToRectangle(geometry));
}
... View more
09-08-2017
11:28 AM
|
0
|
0
|
1504
|
|
POST
|
You can pass SketchEditConfiguration to SketchEditor.StartAsync. Without this optional parameter, sketch editor will enable/disable certain editing capabilities based on the SketchCreationMode or geometry. While you've created a rectangle shape, it's still treated according to its type (Polygon) so all vertex editing and rotate which you may not want for your rectangle shape will be enabled by default. xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:MapView x:Name="MyMapView" GeoViewTapped="MyMapView_GeoViewTapped" />
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Right">
<Button Content="Draw"
Click="OnDraw" />
<Button Content="Complete"
Command="{Binding ElementName=MyMapView, Path=SketchEditor.CompleteCommand}" />
</StackPanel>
</Grid> public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay() { Renderer = new SimpleRenderer(new SimpleFillSymbol(SimpleFillSymbolStyle.Cross, Colors.DarkGreen, null)) });
}
private async void OnDraw(object sender, RoutedEventArgs e)
{
try
{
var config = new SketchEditConfiguration()
{
AllowRotate = false,
AllowMove = false,
AllowVertexEditing = false,
ResizeMode = SketchResizeMode.Stretch
};
var geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, config);
MyMapView.GraphicsOverlays.FirstOrDefault()?.Graphics?.Add(new Graphic(geometry));
}
catch (TaskCanceledException) { }
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
}
private async void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs e)
{
Graphic graphic = null;
try
{
if (MyMapView.SketchEditor.CancelCommand.CanExecute(null))
return;
var result = await MyMapView.IdentifyGraphicsOverlaysAsync(e.Position, 2, false);
graphic = result.FirstOrDefault()?.Graphics?.FirstOrDefault();
if (graphic == null)
return;
graphic.IsVisible = false;
var config = new SketchEditConfiguration()
{
AllowRotate = false,
AllowMove = false,
AllowVertexEditing = false,
ResizeMode = SketchResizeMode.Stretch
};
var geometry = await MyMapView.SketchEditor.StartAsync(graphic.Geometry, SketchCreationMode.Rectangle, config);
graphic.Geometry = geometry;
}
catch (TaskCanceledException) { }
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
finally
{
if (graphic != null)
graphic.IsVisible = true;
}
}
... View more
09-08-2017
10:07 AM
|
1
|
0
|
1504
|
|
POST
|
It is an intentional change for v100+. Were there specific binding scenarios that you're unable to do now? If yes, please share so we can try and accommodate in the future. Meanwhile, you can try the following code. You should still be able to do binding to Layer properties. xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:MapView x:Name="MyMapView" />
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Right">
<ItemsControl ItemsSource="{Binding ElementName=MyMapView, Path=Map.AllLayers}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition MinWidth="50" />
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay}"
Content="{Binding Name}" />
<Slider Value="{Binding Opacity, Mode=TwoWay}"
Minimum="0"
Maximum="1"
Grid.Column="1"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid> public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.Map.OperationalLayers.Add(new ArcGISMapImageLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer")));
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0")) { Name = "Wildfire" });
}
... View more
09-08-2017
09:42 AM
|
0
|
1
|
2124
|
|
POST
|
The following code works for me, `T` here is just a png with BuildAction=Embedded Resource. `Forum` was my project namespace. I think the reason it didn't work for you is because you have a PictureFillSymbol for MapPoint geometry. Did you mean to use PictureMarkerSymbol then? MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay());
MyMapView.GeoViewTapped += async (s, e) =>
{
var overlay = MyMapView.GraphicsOverlays.FirstOrDefault();
var resourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Forum.T.png");
var runtimeimage = await RuntimeImage.FromStreamAsync(resourceStream);
overlay.Graphics.Add(new Graphic(GeometryEngine.Buffer(e.Location, 1000), new PictureFillSymbol(runtimeimage)));
MyMapView.SetViewpoint(new Viewpoint(overlay.Extent));
};
... View more
09-07-2017
05:19 PM
|
0
|
1
|
1333
|
|
POST
|
`GeoViewTapped` is the correct event. `CreateFeature`, `AddFeatureAsync`, and `ApplyEditsAsync` are all the right methods. Are you getting any error message from `ApplyEditsAsync`? I'm curious why you don't add the layer to your map before creating and adding the feature. You can try the following sample code. When layer is added to the map, the map will load the layer and the layer will load the table, so you won't need to explicitly call `LoadAsync`. public MainWindow()
{
InitializeComponent();
MyMapView.GeoViewTapped += MyMapView_GeoViewTapped;
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Notes/FeatureServer/0")));
}
private async void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs e)
{
try
{
var layer = MyMapView.Map.OperationalLayers.FirstOrDefault() as FeatureLayer;
var table = layer.FeatureTable as ServiceFeatureTable;
var template = table.FeatureTemplates.FirstOrDefault() ?? table.FeatureTypes.FirstOrDefault(t => t.Templates.Any()).Templates.FirstOrDefault();
var feature = table.CreateFeature(template);
feature.Geometry = e.Location;
await table.AddFeatureAsync(feature);
var edits = await table.ApplyEditsAsync();
var editResult = edits.FirstOrDefault(r => r is FeatureEditResult && r.CompletedWithErrors || r.Error != null);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
}
}
... View more
08-07-2017
10:11 AM
|
1
|
2
|
1869
|
|
POST
|
You can check for `CanEditAttachments` to know if you're able to add/update/delete attachments for the specified feature. You can also check the result of `ApplyEditsAsync` to know whether any of the edit operation failed. if (feature.CanEditAttachments)
await feature.AddAttachmentAsync("test.png", "image/png", bytes);
var table = layer.FeatureTable as ServiceFeatureTable;
var edits = await table.ApplyEditsAsync();
var editResult = edits.FirstOrDefault(r => r is FeatureEditResult && ((FeatureEditResult)r).AttachmentResults.FirstOrDefault(ar => ar.CompletedWithErrors || ar.Error != null) != null) as FeatureEditResult;
In your code, is ` App._file.Name` full file name including path? This should be file name with extension. And the `contentType` parameter should be one of the MIME types that your server support. (i.e. image/png, text/plain, etc.)
... View more
08-07-2017
09:52 AM
|
1
|
1
|
2145
|
|
POST
|
AddVertex and DeleteVertex commands can be activated using buttons just like Undo/Redo/Cancel/Complete commands. They are only enabled for Polyline/Polygon geometries though with provided CommandParameter. DeleteVertex will act on selected vertex (red highlight) and/or given index. <Button Content="Undo"
Command="{Binding ElementName=MyMapView, Path=Editor.Undo}" />
<Button Content="Redo"
Command="{Binding ElementName=MyMapView, Path=Editor.Redo}" />
<Button Content="Delete"
Command="{Binding ElementName=MyMapView, Path=Editor.DeleteVertex}" />
<Button Content="Add"
Command="{Binding ElementName=MyMapView, Path=Editor.AddVertex}" />
<Button Content="Cancel"
Command="{Binding ElementName=MyMapView, Path=Editor.Cancel}" />
<Button Content="Complete"
Command="{Binding ElementName=MyMapView, Path=Editor.Complete}" /> Programmatically, you can invoke them using the following code: // `mapPoint` will be added after selected vertex
if (MyMapView.Editor.AddVertex.CanExecute(mapPoint))
MyMapView.Editor.AddVertex.Execute(mapPoint);
// `index` to delete specific vertex or
// `null` to delete selected vertex
if (MyMapView.Editor.DeleteVertex.CanExecute(index))
MyMapView.Editor.DeleteVertex.Execute(index); You may also use Polyline/PolygonBuilder which also has methods for Add/RemovePoint.
... View more
08-07-2017
09:26 AM
|
0
|
1
|
2465
|
|
POST
|
Features from SelectFeaturesAsync and QueryFeaturesAsync are usually not loaded unless you pass QueryFeatureFields.LoadAll parameter in QueryFeaturesAsync so by default it would contain the minimal set of fields that are used for rendering the feature. You can use the following code to test using the service Nagma provided. try
{
var layer = MyMapView.Map.OperationalLayers.FirstOrDefault(l => l is FeatureLayer) as FeatureLayer;
var query = new QueryParameters() { WhereClause = "typdamage = 'Major'" };
var result = await ((ServiceFeatureTable)layer.FeatureTable).QueryFeaturesAsync(query, QueryFeatureFields.LoadAll);
foreach (ArcGISFeature f in result.ToArray())
{
if (f.LoadStatus != LoadStatus.Loaded)
await f.LoadAsync();
// Update attributes here.
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().Name);
} You can pass the result of this query to SelectFeatures to mark them selected.
... View more
08-02-2017
11:13 AM
|
2
|
0
|
2449
|
|
POST
|
With your code, you can still get to `LayerInfo.RelationshipInfos` but you cannot get to its related tables or features unless they both participate in the same map. You can explore `GetRelatedTables` when you modify sample here: https://community.esri.com/message/703802-re-retrieve-records-from-related-table-in-arcgis-runtime-sdk-for-net?commentID=703802&et=watches.email.thread#comment-703332
... View more
08-02-2017
10:36 AM
|
0
|
0
|
1013
|
| 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
|