AnsweredAssumed Answered

Map ignores Graphics layers

Question asked by sosed on Jul 5, 2015
Latest reply on Jul 15, 2015 by mnielsen-esristaff



We are experiencing a problem with the ArcGIS Runtime (desktop) MapView WPF control. Unfortunately our code is extremely large and we are unable to post it here.


Basically, the problem is as follows: we have a WinForm that has a WPF User Control containing a MapView. This form is opened and closed repeatedly throughout the program life cycle. After opening & closing the form several times, the Graphics from all GraphicsLayers disappear. Logically, they are still there, with valid information (visibility, renderers, symbols, spatial references, correct geometries).


Also, after the graphics disappear, the program crashes upon calling HitTestAsync on map control. It's a NUllReferenceException, and here is its Stack Trace: 


at Esri.ArcGISRuntime.Layers.GraphicsLayer.d__1e.MoveNext()

--- End of stack trace from previous location where exception was thrown --- 

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 

at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 

at GISRuntime.Map.Components.MapManager.d__b.MoveNext() in...


Additional notes:

* Typically, it takes around 4-5 times of closing/reopening for the graphics to disappear. However this number may vary from 2 to 20+.

* We have not seen any difference, property-wise, in the Map View control once the graphics disappear.

* We have another (overview) Map View control whose Graphics continue to be shown after the main map's graphics disappear. We have compared their properties and they are identical.


Please, advise.




Alexander Gleyzer