|
POST
|
Have you enabled the location in the app manifest? At what point are you checking for LocationDisplay? It seems to always have a value (non-null). You can try the following code: xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
x:Class="XamForms.MainPage">
<esriUI:MapView x:Name="MyMapView" /> public MainPage()
{
InitializeComponent();
MyMapView.SpatialReferenceChanged += MyMapView_SpatialReferenceChanged;
MyMapView.Map = new Map(Basemap.CreateTopographic());
}
private async void MyMapView_SpatialReferenceChanged(object sender, EventArgs e)
{
try
{
if(!MyMapView.LocationDisplay.DataSource.IsStarted)
await MyMapView.LocationDisplay.DataSource.StartAsync();
}
catch(Exception ex)
{
await DisplayAlert("Error", ex.Message, "OK");
}
}
... View more
03-21-2017
01:23 PM
|
0
|
2
|
1946
|
|
POST
|
Thanks for your feedback. This feature of converting MapPoint to/from formatted coordinate notation string is coming in the next release.
... View more
03-20-2017
10:02 AM
|
0
|
0
|
819
|
|
POST
|
I tried your code as-is for creating geometry and symbol, added this line to see the graphic. SimpleLineSolid.Style worked. Also tried in on Forms.Android. MyMapView.SetViewpoint(new Viewpoint(aGraphic.Geometry.Extent)); Since I couldn't repro, I tried the following to iterate through SimpleLineSymbol styles and use SketchEditor to draw freehand (gesture: touch down, drag and up). foreach (SimpleLineSymbolStyle lineStyle in Enum.GetValues(typeof(SimpleLineSymbolStyle)))
{
var symbol = new SimpleLineSymbol(lineStyle, Colors.Cyan, 5d);
try
{
var geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.FreehandLine, false);
overlay.Graphics.Add(new Graphic(geometry, symbol));
}
catch (TaskCanceledException)
{
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
} Every style worked and Null style is the only thing that did not render as expected. GraphicsRenderingMode.Dynamic(default) or Static did not seem to make a difference in this case. Am I missing something in your repro code?
... View more
03-17-2017
01:47 PM
|
0
|
1
|
1925
|
|
POST
|
Thank you for your feedback. I will log an issue to get our documentation updated. You no longer need to specify SpatialReference on layer or table, this should automatically be discovered from the map that contains the layer. You can try the following code, Map is in 54030 and FeatureLayer is in 3857. You can then replace FeatureLayer creation with your service or portal item. Zooming in/out should update Map.Extent and trigger request for features. You can also use LayerViewStateChanged to check for Error/Status. Right now, I'm only using it to get to the layer's full extent. public Forum()
{
InitializeComponent();
MyMapView.LayerViewStateChanged += MyMapView_LayerViewStateChanged;
MyMapView.Map = new Map(new SpatialReference(54030));
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/1")));
}
private void MyMapView_LayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
{
if(e.Layer is FeatureLayer && e.Layer.FullExtent != null)
MyMapView.SetViewpoint(new Viewpoint(e.Layer.FullExtent));
}
... View more
03-16-2017
05:21 PM
|
0
|
2
|
1218
|
|
POST
|
I can't seem to reproduce this though. I am using XAML Forms with the following code and in all instances, I'm able to catch the exception without the app getting terminated. iOS, Android, UWP seem to work. Is there a different Url, I should try? Thanks. private async void Button_Clicked(object sender, EventArgs e)
{
try
{
// does not support sync
//var task = await GeodatabaseSyncTask.CreateAsync(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Notes/FeatureServer"));
// folder not found
//var task = await GeodatabaseSyncTask.CreateAsync(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/doesnotexist"));
// error occured while sending request
var task = await GeodatabaseSyncTask.CreateAsync(new Uri("http://doesnotexist.arcgisonline.com/arcgis/rest/services/Notes/FeatureServer"));
}
catch (Exception ex)
{
await DisplayAlert("Error", ex.Message, "OK");
}
}
... View more
03-15-2017
03:51 PM
|
0
|
2
|
1112
|
|
POST
|
You're right Job.Error.Message should not have been null. I'm able to reproduce if where clause uses a field that does not exist in the service. Not the same error message as yours but still a server error that will prevent geodatabase from being generated. Exception caught is of type ArcGISWebException but Exception.Message is null. JsonResponse includes the server error but is inaccessible to user. var parameters = await task.CreateDefaultGenerateGeodatabaseParametersAsync(extent);
parameters.LayerOptions[0].WhereClause = "typeid = 5"; Thanks for reporting this bug, we'll try to get this fixed in future versions of the API. For the meantime, you can use Job.Message, I see the error is reported there but did not bubble up correctly to Job.Error.Message Error while handling generate geodatabase job status. Job error 500 Failed to create replica.
... View more
03-15-2017
03:16 PM
|
1
|
1
|
3163
|
|
POST
|
I'm also not sure what changes in the additional layers caused server error or if this discussion would be of any help. But maybe I can help with tracking the error message from your app... Exception message from the job can be retrieved using job.Error when JobChanged is raised or exception caught from awaiting job.GetResultAsync(). You can also inspect job.Messages in JobChanged for detailed server error. private void Job_JobChanged(object sender, EventArgs e)
{
var job = (GenerateGeodatabaseJob)sender;
if (job.Messages!= null && job.Messages.Count > 0)
{
var sb = new StringBuilder();
foreach (var m in job.Messages)
sb.AppendLine(m.Message);
System.Diagnostics.Debug.WriteLine(sb.ToString());
}
}
... View more
03-15-2017
02:31 PM
|
1
|
1
|
3163
|
|
POST
|
Thanks for sharing with us call stack. Can you explain what the app is doing when it crashes? What does map contain? If you can provide repro code that will be great. What platform and version of API?
... View more
03-10-2017
11:56 AM
|
0
|
0
|
1212
|
|
POST
|
Thanks for your feedback. We did have global setting for zoom and pan duration. In v100, you can also use SetViewpoint which will not have animation, or provide shorter TimeSpan in these methods: SetViewpointAsync with Timespan and SetViewpointAsync with Timespan and AnimationCurve if done in code. But I think you mean while interacting with the map no code-behind just flick and zoom, you have no control over the animation speed, is that correct?
... View more
03-10-2017
11:52 AM
|
0
|
16
|
4911
|
|
POST
|
What platform are you using? I am unable to reproduce the issue with token-secured sync-enabled feature server (repro app is also not using 'https'). Generate and sync geodatabase both worked for me. I only got "Token required" error when I did not wire up the AuthenticationManager.ChallengeHandler. AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
{
var credential = await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, "<username>", "<password>");
return credential;
}); I'm not sure what is causing the crash in your app but if you are accessing UI elements in JobChanged, you'll need to invoke dispatcher because this may be raised in a different thread. private void GenerateJob_JobChanged(object sender, EventArgs e)
{
var action = new Action(() =>
{
var job = (GenerateGeodatabaseJob)sender;
var sb = new StringBuilder();
if (job.Messages != null)
{
foreach (var m in job.Messages)
sb.AppendLine(m.Message);
}
JobMessageText.Text = sb.ToString();
});
Dispatcher.Invoke(action);
} I am using the following code to generate if (File.Exists(geodatabasePath))
{
geodatabase = await Geodatabase.OpenAsync(geodatabasePath);
}
else
{
var extent = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry.Extent;
var task = await GeodatabaseSyncTask.CreateAsync(new Uri(FeatureServer));
var parameters = await task.CreateDefaultGenerateGeodatabaseParametersAsync(extent);
var generateJob = task.GenerateGeodatabase(parameters, geodatabasePath);
geodatabase = await generateJob.GetResultAsync();
}
foreach (var table in geodatabase.GeodatabaseFeatureTables)
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(table)); Please feel free to share other info to help us reproduce the issue. Thanks.
... View more
03-08-2017
03:41 PM
|
0
|
0
|
1193
|
|
POST
|
The generic .tif lacks SpatialReference information. You can subscribe to LayerViewStateChanged event to find out errors related to loading/rendering of the layer. You can also see Supported Raster Formats. public MainWindow()
{
InitializeComponent();
MyMapView.LayerViewStateChanged += MyMapView_LayerViewStateChanged;
MyMapView.Map = new Map(Basemap.CreateImagery());
var path = @"C:\Temp\redickville.tif"; // fails on load, Layer.SpatialReference is not set
// var path = @"C:\Temp\redickville_GeoTiff.tif"; // renders fine
MyMapView.Map.OperationalLayers.Add(new RasterLayer(new Raster(path)));
}
private void MyMapView_LayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
{
Dispatcher.Invoke(() =>
{
if (e.Layer is RasterLayer)
{
if (e.Layer.FullExtent != null)
MyMapView.SetViewpoint(new Viewpoint(e.Layer.FullExtent));
if (e.LayerViewState.Error != null)
MessageBox.Show(e.LayerViewState.Error.Message);
}
});
}
... View more
03-07-2017
07:59 AM
|
0
|
2
|
2609
|
|
POST
|
You can use SketchEditor for this. Point geometry is updated either by tapping a new location or by dragging the graphic. StartAsync will return new geometry once you call Complete command. You can use Complete button or subscribe to GeometryChanged and let the handler execute CompleteCommand programmatically to get new geometry on mouse up. xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:MapView x:Name="MyMapView" />
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Right">
<Button Content="Edit"
Click="Button_Click" />
<Button Content="Complete"
Command="{Binding ElementName=MyMapView, Path=SketchEditor.CompleteCommand}" />
</StackPanel>
</Grid> In this sample code, I am using SketchEditor for two purposes: 1) to identify and select graphic for edit 2) to update graphic geometry Handle TaskCanceledException in case "Edit" button was clicked again, which will cancel previous StartAsync call. public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(Basemap.CreateTopographic());
var overlay = new GraphicsOverlay() { RenderingMode = GraphicsRenderingMode.Static };
overlay.Renderer = new SimpleRenderer(new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Colors.Blue, 12d));
overlay.Graphics.Add(new Graphic(new MapPoint(0, 0, MyMapView.SpatialReference)));
MyMapView.GraphicsOverlays.Add(overlay);
//MyMapView.SketchEditor.GeometryChanged += SketchEditor_GeometryChanged;
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
Graphic graphic = null;
try
{
foreach (var overlay in MyMapView.GraphicsOverlays)
overlay.ClearSelection();
var mapPoint = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Point, false) as MapPoint;
var screenPoint = MyMapView.LocationToScreen(mapPoint);
var results = await MyMapView.IdentifyGraphicsOverlaysAsync(screenPoint, 1, false, 1);
var result = results?.FirstOrDefault();
graphic = result?.Graphics?.FirstOrDefault();
if (graphic == null)
return;
graphic.IsSelected = true;
graphic.IsVisible = false;
var geometry = await MyMapView.SketchEditor.StartAsync(graphic.Geometry);
graphic.Geometry = geometry;
}
catch (TaskCanceledException)
{
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
if (graphic != null)
graphic.IsVisible = true;
}
}
private void SketchEditor_GeometryChanged(object sender, GeometryChangedEventArgs e)
{
if (MyMapView.SketchEditor.CompleteCommand.CanExecute(null))
MyMapView.SketchEditor.CompleteCommand.Execute(null);
}
... View more
02-28-2017
01:08 PM
|
2
|
2
|
2305
|
|
POST
|
Any sample data that came with your ArcMap install can be shared as runtime content. The following links might help: ArcMap - Creating ArcGIS Runtime content and ArcGIS Runtime SDK for .NET Guide - Local Server
... View more
02-28-2017
09:21 AM
|
0
|
0
|
801
|
|
POST
|
Hi Chad, RefreshObjectId() not updating attribute value is a bug which we'll have to fix. It remains to be the local cached values. To workaround this, you can query for the feature instead. However in my test, when RefreshObjectId is called after ApplyEdits, DeleteFeature does not fail. It deletes the correct feature, but attribute values does not reflect the same values from ApplyEdits result. Can you confirm? Based on your feedback we also have to fix the issue where an incomplete query can occur if feature being deleted is either not part of the table or had been saved but not refreshed. The GlobalId and ObjectId uniquely identifies the feature so they are both automatically generated as soon as feature is created and added to the table. When edits are submitted to the server, they are expected to change because say you have other clients pushing edits to the same server, each of those new features need to be given unique identifiers. ApplyEdits then would respond with the GlobalId and ObjectId assigned by the server.
... View more
02-22-2017
08:51 AM
|
0
|
2
|
6538
|
|
POST
|
I missed to address your other question about globalid and objectid. While a negative object id is expected for new features that only exists locally (before ApplyEdits), the global id and object id from server can be retrieved from ApplyEdits result. You can query for the updated feature using the following code as well. var results = await table.ApplyEditsAsync();
if (results != null)
{
var query = new QueryParameters();
foreach (var r in results)
query.ObjectIds.Add(r.ObjectId);
var features = await table.QueryFeaturesAsync(query);
} I think RefreshObjectId should have also updated the feature.Attributes - we'll try to get this fixed in future versions of the API. Adding RefreshObjectId before DeleteFeaturesAsync will delete the correct feature. But if you need the updated attributes, you can use QueryFeaturesAsync.
... View more
02-21-2017
12:17 PM
|
0
|
4
|
6538
|
| 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
|