laptop and a wrench

Bug

If the MapView.SetViewpointCenterAsync() method is called before MapView.ExportImageAsync(), the exported image is an incomplete display.

Last Published: June 14, 2018 ArcGIS Runtime SDK
Bug ID Number BUG-000113123
SubmittedApril 11, 2018
Last ModifiedJune 5, 2024
Applies toArcGIS Runtime SDK
Version found100.2.1
Operating SystemWindows OS
Operating System Version10.0 64 Bit
StatusWill Not Be Addressed

Additional Information

The current behavior is by-design. ExportImageAsync exports the view as-is and does not wait for the rendering to complete. Additional code should be added to wait for draw status to report that rendering is complete before calling ExportImageAsync. e.g. ``` private static Task WaitForRenderCompleteAsync(MapView mapview) { TaskCompletionSource tcs = new TaskCompletionSource(); if (mapview.DrawStatus == DrawStatus.Completed) tcs.SetResult(null); else { EventHandler h = null; h = (s, e) => { if (e.Status == DrawStatus.Completed) { mapview.DrawStatusChanged -= h; tcs.SetResult(null); } }; mapview.DrawStatusChanged += h; } return tcs.Task; } ```

Workaround

Adding Task.Delay() with 1000 milliseconds works:await MyMapView.SetViewpointCenterAsync(_londonCoords, 1000);// Adding Task.Delay() works as belowawait Task.Delay(1000);imageView.Source = await RuntimeImageExtensions.ToImageSourceAsync(await MyMapView.ExportImageAsync());

Steps to Reproduce

Bug ID: BUG-000113123

Software:

  • ArcGIS Runtime SDK

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options