|
POST
|
Thanks for your feedback. We don't assign a name to this GraphicsOverlay but some other characteristics of it is it will always have just one selected graphic which gets added after a successful identify on tapped event. You can use Linq query to get it once then clear Graphics or toggle visibility when MeasureToolbar is no longer active. var overlay = mapView.GraphicsOverlays.FirstOrDefault(o => string.IsNullOrEmpty(o.Id) && o.Graphics.Count == 1 && o.Graphics[0].IsSelected);
overlay?.Graphics?.Clear(); I hope this works for you too. Another way would be to get it once from GraphicsOverlays.CollectionChanged event after GeoViewTapped but perhaps it's better to just use code above. private Task<GraphicsOverlay> GetMeasureResultOverlayAsync()
{
var tcs = new TaskCompletionSource<GraphicsOverlay>();
GraphicsOverlay overlay = null;
EventHandler<GeoViewInputEventArgs> tappedHandler = null;
NotifyCollectionChangedEventHandler collectionChangedHandler = null;
tappedHandler = (s, e) =>
{
if (collectionChangedHandler == null)
{
collectionChangedHandler = (a, b) =>
{
if (overlay == null && b.NewItems?.Count == 1)
{
overlay = b.NewItems[0] as GraphicsOverlay;
if(string.IsNullOrEmpty(overlay.Id) && overlay.Graphics.Count == 1 && overlay.Graphics[0].IsSelected)
{
mapView.GeoViewTapped -= tappedHandler;
mapView.GraphicsOverlays.CollectionChanged -= collectionChangedHandler;
tcs.TrySetResult(overlay);
}
}
};
mapView.GraphicsOverlays.CollectionChanged += collectionChangedHandler;
}
};
mapView.GeoViewTapped += tappedHandler;
return tcs.Task;
}
... View more
07-24-2018
03:50 PM
|
0
|
0
|
1098
|
|
POST
|
Hi Paul and Matthew, Thank you for your feedback. I'm able to reproduce the bug and we'll look into getting it fixed in future releases of the API. It appears that GetDataAsync on secured portal item only work in UWP if DefaultChallengeHandler is used (setting OAuth is skipped). The underlying HttpClient is different and EnsureSuccessStatusCode in UWP may throw `Response status code does not indicate success: 400 (Bad Request)`. Apparently it's the Authorization header it doesn't like. You can use the following workaround, meanwhile. Only for UWP, remove authorization header for the GetDataAsync request. #if NETFX_CORE
EventHandler<HttpRequestMessage> handler = (s, e) =>
{
if ((e.Headers?.Authorization?.Scheme == "Bearer") && e.RequestUri.OriginalString.Contains("/data"))
e.Headers.Authorization = null;
};
ArcGISHttpClientHandler.HttpRequestBegin += handler;
#endif
var data = await item.GetDataAsync();
#if NETFX_CORE
ArcGISHttpClientHandler.HttpRequestBegin -= handler;
#endif
... View more
07-11-2018
04:45 PM
|
3
|
4
|
11759
|
|
POST
|
You can update the TableOfContents LayerItemTemplate property and add an event say MouseUp on Layer name, update its Binding to retrieve LayerContent, this should match the layer on your map. From the original source code, I only modified this bit - line 60-61 (see Text and DataContext). <Grid.Resources>
<HierarchicalDataTemplate x:Key="MyLayerTemplate" ItemsSource="{Binding Sublayers}">
<Grid Margin="0,2" >
<Grid.Resources>
<Style TargetType="MenuItem" x:Key="HideMenuItemWhenDisabled">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</Grid.Resources>
<Grid.Style>
<Style TargetType="Grid">
<Style.Triggers>
<DataTrigger Binding="{Binding IsInScaleRange, Mode=OneWay}" Value="false">
<Setter Property="Opacity" Value=".5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid.ContextMenu>
<ContextMenu>
<MenuItem IsCheckable="True" IsChecked="{Binding LayerContent.IsVisible, Mode=TwoWay}" Header="Enabled" IsEnabled="{Binding LayerContent.CanChangeVisibility}" Style="{StaticResource HideMenuItemWhenDisabled}" />
<MenuItem Command="{Binding ZoomToCommand}" Header="Zoom to" Style="{StaticResource HideMenuItemWhenDisabled}" />
<MenuItem Command="{Binding ReloadCommand}" Header="Reload" Style="{StaticResource HideMenuItemWhenDisabled}" />
</ContextMenu>
</Grid.ContextMenu>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<esri:SymbolDisplay Symbol="{Binding Symbol, Mode=OneTime}" Margin="0,0,5,0" MaxHeight="40" MaxWidth="40">
<esri:SymbolDisplay.Style>
<Style TargetType="esri:SymbolDisplay">
<Style.Triggers>
<DataTrigger Binding="{Binding Symbol, Mode=OneTime}" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</esri:SymbolDisplay.Style>
</esri:SymbolDisplay>
<CheckBox Grid.Column="1" IsChecked="{Binding LayerContent.IsVisible, Mode=TwoWay}">
<CheckBox.Style>
<Style TargetType="CheckBox">
<Style.Triggers>
<DataTrigger Binding="{Binding LayerContent.CanChangeVisibility, Mode=OneTime}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</CheckBox.Style>
</CheckBox>
<TextBlock Text="{Binding Name}" MouseUp="OnMouseUp"
DataContext="{Binding LayerContent, Mode=OneWay}" Grid.Column="2" VerticalAlignment="Center">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding HasError}" Value="True">
<Setter Property="Foreground" Value="Red" />
</DataTrigger>
<DataTrigger Binding="{Binding IsActive}" Value="False">
<Setter Property="Opacity" Value=".5" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</HierarchicalDataTemplate>
</Grid.Resources> <esri:TableOfContents Grid.Row="0" x:Name="toc"
LayerItemTemplate="{StaticResource MyLayerTemplate}"
GeoView="{Binding ElementName=mapView}" ShowLegend="False" > private void OnMouseUp(object sender, MouseButtonEventArgs e)
{
var datacontext = (sender as FrameworkElement)?.DataContext as ILayerContent;
}
... View more
07-10-2018
04:26 PM
|
1
|
1
|
1640
|
|
POST
|
There currently is no SketchEditor for SceneView but you should be able to use PolylineBuilder and GeoViewTapped events. Something like this. PolylineBuilder builder = new PolylineBuilder(SpatialReferences.Wgs84);
private void MySceneView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
{
builder.AddPoint(e.Location);
var overlay = MySceneView.GraphicsOverlays.FirstOrDefault();
var graphic = overlay.Graphics.FirstOrDefault();
if (graphic == null)
overlay.Graphics.Add(new Graphic(builder.ToGeometry(), new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Red, 3)));
else
graphic.Geometry = builder.ToGeometry();
} In sample code above, we use tapped location but if you have 3D objects you want considered (i.e. buildings in ArcGISSceneLayer), you might want to use this location instead. var location = await MySceneView.ScreenToLocationAsync(e.Position); Meanwhile, you can try looking into one of our demo apps originally written against ArcGIS Runtime for .NET 10.x. I updated it slightly to use 100.x in this branch. I hope it will help you get started.
... View more
07-10-2018
03:43 PM
|
0
|
0
|
1053
|
|
POST
|
You might want to check out this guide doc for editing to help get you started. For shapefile, you're limited to updating feature geometry and attributes, no feature attachments so you can ignore that part of the guide doc. There are other samples here which you might be interested in.
... View more
07-02-2018
11:57 AM
|
1
|
0
|
2368
|
|
POST
|
For ServiceFeatureTable, you can use ManualCache mode to specify the OutFields. If renderer used by service requires for a specific field name and you did not request for it. For example in this case, 'symbolid' then nothing will render. var table = new ServiceFeatureTable(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2")) { FeatureRequestMode = FeatureRequestMode.ManualCache };
await table.PopulateFromServiceAsync(new QueryParameters() { WhereClause = "1=1" }, true, new string[] { "objectid", "symbolid" });
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(table));
... View more
07-02-2018
11:41 AM
|
0
|
0
|
3642
|
|
POST
|
If you are using v100.2.+, you can use ShapefileFeatureTable to create/update/delete features. This inherits from FeatureTable so methods include CreateFeature, Add/Update/DeleteFeature(s)Async. You can create a FeatureLayer with this table. Is this what you are looking for?
... View more
06-28-2018
03:53 PM
|
0
|
2
|
2368
|
|
POST
|
Kindly see `Create a raster from a mosaic dataset` from this guide doc.
... View more
06-28-2018
03:48 PM
|
2
|
1
|
1808
|
|
POST
|
Thank you for providing us a repro sample. I was able to reproduce with v100.2.1, quickly switching tabs would sometimes not redraw the map. However this appears fixed with latest dev build for v100.3.
... View more
06-27-2018
04:14 PM
|
1
|
1
|
4797
|
|
POST
|
Thank you for sharing your data and code. I'm able to reproduce the issue. SpatialReference.Equals should have been true regardless of z-value and GeometryEngine.RemoveZAndM should have been enough to clear feature geometry of z to allow GeometryEngine.Contains to work. However, SpatialReference.Equals still fail, although the wkt string matched. I have logged an issue for this. Meanwhile, you can use the following workaround before calling GeometryEngine.Contains or SpatialReference.Equals. geomFeat = GeometryEngine.RemoveZAndM(geomFeat);
geomFeat = Geometry.FromJson(geomFeat.ToJson());
... View more
06-27-2018
12:47 PM
|
0
|
2
|
2261
|
|
POST
|
Have you seen this SDK sample using `Xamarin.Auth.OAuth2Authenticator`? Android, iOS and UWP have their own page renderer that deals with presenting UI when challenge for credential occurs.
... View more
06-27-2018
10:27 AM
|
0
|
0
|
2429
|
|
POST
|
Thank you for your feedback. We ignore multi-touch gestures for sketch editor. Which version of the api are you using? To better assist, can you share which platform and code? You may also try to disable sketch editor in code this way... var pinchGestureRecognizer = new PinchGestureRecognizer();
pinchGestureRecognizer.PinchUpdated += (s, e) =>
{
if (MyMapView.SketchEditor.IsEnabled)
MyMapView.SketchEditor.IsEnabled = e.Status == GestureStatus.Canceled || e.Status == GestureStatus.Completed;
};
MyMapView.GestureRecognizers.Add(pinchGestureRecognizer); To cancel or complete sketch in v100.x, use Cancel/CompleteCommand. if (MyMapView.SketchEditor.CancelCommand.CanExecute(null))
MyMapView.SketchEditor.CancelCommand.Execute(null); You may check SketchEditor.Geometry property and MyMapView.GeometryChanged events. For Freehand, you should get this event on mouse/touch up.
... View more
06-14-2018
10:57 AM
|
0
|
0
|
2398
|
|
POST
|
Hi Richard, I'm able to reproduce the issue. Calling `MyMapView.CancelSetViewpointOperations();` before SetViewpoint also does not seem to cancel animation. I have logged an issue. Meanwhile, this worked for me but I am not sure if it's an option for your app... workaround is to disable flick. MyMapView.InteractionOptions = new MapViewInteractionOptions() { IsFlickEnabled = false }; Thank you for your feedback. Jennifer
... View more
06-05-2018
10:53 AM
|
1
|
2
|
3955
|
|
POST
|
While the overload with `QueryFeatureFields` is only on `ServiceFeatureTable`. As Antti noted, features must be loaded. `LoadAsync` on `ArcGISFeature` will do this as well, load all of feature attributes. This is available on features belonging to an `ArcGISFeatureTable` (i.e. ServiceFeatureTable, GeodatabaseFeatureTable).
... View more
05-21-2018
09:49 AM
|
0
|
0
|
3034
|
|
POST
|
Yes, this is possible with latest released version of the SDK. You can update the symbol properties of SketchEditor.Style. The only difference from v10.2.x is we had these symbol properties under EditorConfiguration. In v100.x, anything related to changing the look and feel of SketchEditor is under Style and properties that enables/disables certain edit functionality is under SketchEditConfiguration.
... View more
05-14-2018
01:12 PM
|
2
|
0
|
1434
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|