|
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
|
6892
|
|
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
|
6892
|
|
POST
|
Ah I see, since feature now exists on server after ApplyEditsAsync call, you can call feature.RefreshObjectId() before DeleteFeaturesAsync. DeleteFeatures failed for the same reason that it triggered a query on server with incomplete query. Note that Add/Update/DeleteFeaturesAsync or Add/Update/DeleteAttachmentsAsync are local changes until you call ApplyEditsAsync, at which time edits are sync'd to server. In the snippet above then feature is added to service but is not deleted until you call ApplyEditsAsync again.
... View more
02-21-2017
11:54 AM
|
0
|
6
|
6892
|
|
POST
|
Hi Chad, Did you call AddFeatureAsync? "Unable to complete operation" sounds like a server error. I was only able to reproduce this error on DeleteFeaturesAsync if I delete a feature that is not already on the table. It looks like delete operation can trigger an incomplete query in this case, since objectId attribute is not set - which is likely the bug - but would not have happened if feature was added to the table. Also a negative objectId when you have not called ApplyEditsAsync yet to submit your edits to the service. So in the code below if you comment out AddFeatureAsync, you'll get "Unable to complete operation". try
{
var location = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Point, false) as MapPoint;
var layer = (FeatureLayer)MyMapView.Map.OperationalLayers[0];
var table = (ArcGISFeatureTable)layer.FeatureTable;
var template = table.LayerInfo.FeatureTemplates.FirstOrDefault();
var feature = table.CreateFeature(template);
feature.Geometry = location;
await table.AddFeatureAsync(feature);
await layer.FeatureTable.DeleteFeatureAsync(feature);
}
catch (TaskCanceledException)
{
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
} I don't think this is platform-specific but how are you storing the new feature? You can use one of the following - GetAddedFeaturesAsync var features = await ((ArcGISFeatureTable)layer.FeatureTable).GetAddedFeaturesAsync();
or through interaction from a GeoViewTapped event var results = await MyMapView.IdentifyLayerAsync(layer, screenPoint, 1, false);
if (results.GeoElements != null)
{
foreach (var element in results.GeoElements)
{
await layer.FeatureTable.DeleteFeatureAsync((Feature)element);
}
}
... View more
02-17-2017
05:34 PM
|
1
|
8
|
6892
|
|
POST
|
Hi Alberto, How was this service created? Is this from archived history table? The reason I ask is because it's using a reserved word as its field name 'gdb_archive_oid' so we're unable to create the table. If this field were renamed to something else, it should work. I logged an issue on our end to check if there's something we can do about it. Any additional info you can share would help us track how we can prevent this. Thank you. Jennifer
... View more
02-15-2017
02:37 PM
|
1
|
1
|
2308
|
|
POST
|
Thanks, Kevin for clarifying this. I'm also able to reproduce the issue of clicking within the geometry may intermittently return empty. We'll work on getting this fixed in future releases of the API. For the meantime, if you use the other IdentifyGraphicsOverlay override with maximumResults other than 1. var results = await MyMapView.IdentifyGraphicsOverlaysAsync(e.Position, 0, false, 2); or foreach(var overlay in MyMapView.GraphicsOverlays)
{
var overlayResult = await MyMapView.IdentifyGraphicsOverlayAsync(overlay, e.Position, 0, false, 2);
} Either one of these return the expected graphic consistently. The other overload where there is no maximumResults seem to work more consistently when GraphicsOverlay.RenderingMode is Static. By default, if you had not set this - it's Dynamic. The issue seems to be with Dynamic mode and when result is expected to return just one. Thanks, we'll look into this.
... View more
02-13-2017
04:44 PM
|
0
|
0
|
5348
|
|
POST
|
We currently only support Web Mercator tiled layers. You can try using this for basemap layer instead: World_Imagery (MapServer) In XAML <esri:SceneView x:Name="MySceneView">
<esri:Scene>
<esri:ArcGISTiledLayer Source="http://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer" />
</esri:Scene>
</esri:SceneView> Or in code-behind. MySceneView.Scene = new Scene(Basemap.CreateImagery());
... View more
02-10-2017
02:53 PM
|
0
|
2
|
1914
|
|
POST
|
Thank you both for your feedback. I'll forward this feature enhancement request to our team for consideration in future release.
... View more
02-07-2017
09:47 AM
|
0
|
0
|
2450
|
|
POST
|
Are you using a touch or mouse device? Identify with zero tolerance from a tapped event seem difficult to do. It may appear you hit the border of geometry but it may not be the case too. You can use GeometryEngine.Intersects(graphic.Geometry, mapPoint) to troubleshoot. If this returns true and graphic is not selected, then maybe Identify has an issue with zero tolerance. However, I just tried to test zero tolerance identify and it consistently selected the graphic. I am using one of the points in the polygon. public MainWindow()
{
InitializeComponent();
var geometry = Esri.ArcGISRuntime.Geometry.Geometry.FromJson("{\"rings\":[[[-13631102.181532314,4549468.2923788792],[-13630332.658191375,4548355.2318321653],[-13631871.704873253,4548355.2318321653],[-13631102.181532314,4549468.2923788792]]],\"spatialReference\":{\"wkid\":102100,\"latestWkid\":3857}}");
MyMapView.Map = new Map(Basemap.CreateImagery()) { InitialViewpoint = new Viewpoint(geometry) };
var symbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Colors.Red, null);
var overlay = new GraphicsOverlay();
overlay.Graphics.Add(new Graphic(geometry, symbol));
MyMapView.GraphicsOverlays.Add(overlay);
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
var overlay = MyMapView.GraphicsOverlays[0];
var graphic = overlay.Graphics[0];
graphic.IsSelected = false;
var mapPoint = (graphic.Geometry as Polygon)?.Parts?.FirstOrDefault()?.StartPoint;
if (mapPoint != null)
{
var screenPoint = MyMapView.LocationToScreen(mapPoint);
var result = await MyMapView.IdentifyGraphicsOverlayAsync(overlay, screenPoint, 0, false);
graphic = result?.Graphics?.FirstOrDefault();
if (graphic != null)
graphic.IsSelected = true;
}
}
... View more
02-03-2017
04:43 PM
|
0
|
1
|
5348
|
|
POST
|
Thanks for your feedback. The old service you provided had an empty direction style names in the network layer metadata. This may have been optional. We are still investigating whether this should just be ignored if empty. It's good to know publishing as 10.5 works for you though.
... View more
01-31-2017
01:31 PM
|
0
|
0
|
1770
|
|
POST
|
Thanks for your feedback. We will try to include sample/guide doc. Meanwhile, here's a quick sample of ExportTileCacheTask using the portal item you provided. Note: You will need to use the same username/password credential you use when you login to arcgis.com. Providing challenge method for AuthenticationManager will allow you to supply the credential. If you have other secured services, you might want to do a check on CredentialRequestInfo.ServiceUri. For simplicity of this sample, I just used a specific area of interest (one that I know will not exceed the tile count) but you can also use your current viewpoint geometry. This sample uses default parameters as defined by the service but you should also be able to provide a different min/max scale, etc. This sample also use temp directory with some random guid name for tpk, the full file path just needs to be accessible to the app and if you need to reference tpk later might be best to give it a meaningful name. Basically it will create a job whose result is a tile cache. The tile cache or full file path to tpk can be used to create an ArcGISTiledLayer. AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(OnChallenge);
MyMapView.Map = new Map(Basemap.CreateTopographic());
}
private async Task<Credential> OnChallenge(CredentialRequestInfo info)
{
var credential = await AuthenticationManager.Current.GenerateCredentialAsync(
new Uri("http://www.arcgis.com/sharing/rest"),
"<your username>",
"<your password>");
return credential;
}
private async void ExportTile_Click(object sender, RoutedEventArgs e)
{
var portalItem = await PortalItem.CreateAsync(new Uri("http://www.arcgis.com/home/item.html?id=226d23f076da478bba4589e7eae95952"));
var task = await ExportTileCacheTask.CreateAsync(portalItem.ServiceUrl);
//var areaOfInterest = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry)?.TargetGeometry;
var areaOfInterest = Geometry.FromJson("{\"xmin\":-11807293.832783949,\"ymin\":4358614.8414058322,\"xmax\":-11806682.336557668,\"ymax\":4358915.865882393,\"spatialReference\":{\"wkid\":102100,\"latestWkid\":3857}}");
var minScale = task.ServiceInfo.MinScale;
var maxScale = task.ServiceInfo.MaxScale;
var parameters = await task.CreateDefaultExportTileCacheParametersAsync(areaOfInterest, minScale, maxScale);
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.tpk");
var job = task.ExportTileCache(parameters, path);
var tileCache = await job.GetResultAsync();
MyMapView.Map.OperationalLayers.Add(new ArcGISTiledLayer(tileCache));
MyMapView.SetViewpoint(new Viewpoint(areaOfInterest));
}
... View more
01-27-2017
04:40 PM
|
0
|
0
|
1821
|
|
POST
|
MapView.SpatialReference should get it's value from it's Map.SpatialReference. SpatialReference can either be set from Map constructor or based on the layer's SpatialReference. Can you check if the SpatialReferencedChanged event fires for the MapView? How are you creating the map? I tried these and MapView eventually gets SpatialReference that when MouseLeftButtonDown is raised, ScreenToLocation has a valid value. public MainWindow()
{
InitializeComponent();
MyMapView.SpatialReferenceChanged += MyMapView_SpatialReferenceChanged;
// Map.SR will be set, View.SR will not be set.
MyMapView.Map = new Map(SpatialReferences.Wgs84);
// Map and View SR will later be set once layer is loaded.
// MyMapView.Map = new Map(Basemap.CreateTopographic());
}
private void MyMapView_SpatialReferenceChanged(object sender, EventArgs e)
{
// View.SR must have a value
}
... View more
01-27-2017
12:28 PM
|
0
|
0
|
1538
|
|
POST
|
MyMapView.LayerViewStateChanged += MyMapView_LayerViewStateChanged;
MyMapView.Map = new Map(SpatialReferences.Wgs84);
MyMapView.Map.Basemap.BaseLayers.Add(new ArcGISTiledLayer(new Uri(@"C:\layer.tpk")));
}
private void MyMapView_LayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
{
// You can check this value and compare with e.Layer.FullExtent
// MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry)
if (e.LayerViewState.Status == LayerViewStatus.Active)
MyMapView.SetViewpoint(new Viewpoint(e.Layer.FullExtent));
} When Map SpatialReference is set upfront, the MapView's viewpoint becomes the entire world's extent. This is why your layer did not appear visible. You can use LayerViewStateChanged to check for the layer's status/error and also update Viewpoint using Layer's full extent.
... View more
01-26-2017
04:50 PM
|
2
|
1
|
2162
|
|
POST
|
What version of the API are you using, v100 or v10.2? What is your map's SpatialReference? The only time I'm able to return null from a ScreenToLocation call is when my MapView has no SpatialReference set yet.
... View more
01-26-2017
03:52 PM
|
0
|
2
|
1538
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-10-2026 12:13 PM | |
| 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 |
a month ago
|