Redraw Async Very Slow

750
15
Jump to solution
01-28-2020 02:53 PM
MKa
by
Occasional Contributor III

I am working with ArcGIS Pro and have built a configuration AddIn on the application.  My configuration helps in creating drawing and attribute rules for the new features created via a feature service.  After a feature is created, it is necessary for me to Redraw the map to insure that I have the latest values from our ArcGIS Server and Database.  This keeps our mapping system upto date with values that might have changed via database updates.

Anyway I use await MapView.Active.RedrawAsync(true); which works fine for a while.  Then after some time, the process becomes very slow and takes almost a minute to complete.  My ArcGIS Pro toolbars go Gray until it is complete.  I can also use the OOB Redraw and it does the same thing and takes upwards of a minute to complete

Is there a way for me to do this in a more efficient manner (to update my features, map, cache?).  Or am a missing a setting somewhere that would improve my map.  I have 17 maplayers that all get redrawn, where only 2 of them probably need the redraw.  But the only way I can think to redraw is on the the MapView.Active map.  This slowness kills my ArcGIS Pro session.

Any Ideas?

0 Kudos
1 Solution

Accepted Solutions
SeanJones
Esri Regular Contributor

row.store isnt needed if the additional edits occur in the workspace of the row returned by the events. In row events the edit operation is still executing which is also why you cant see the results of additional edits in this event until the execute completes. In 2.4 you can access the running editoperation through RowChangedEventArgs.Operation where you can add additional edits that are queued but again any changes here wont be seen during the event.

Creating a new editoperation or calling Inspector.Apply isn't supported in rowevents. How are you calling .ApplyAsync in the rowevent? 

View solution in original post

15 Replies
RichRuh
Esri Regular Contributor

How are you updating the features?  Database triggers?

Editing using the Pro SDK (if done within an EditOperation) or using attribute rules should both cause the map to be redrawn as needed automatically.

--Rich

0 Kudos
MKa
by
Occasional Contributor III

Other systems and processes update our database directly, but in order to see those changes you must refresh the map/redraw.  This process of either redrawing in code or using the oob refresh just seems to take longer and longer each time.  Is there a way to refresh just one of my feature layers instead of the entire map?

0 Kudos
RichRuh
Esri Regular Contributor

I'm not aware of any way to refresh a single layer, but I'm not an expert in that area.

0 Kudos
CharlesMacleod
Esri Regular Contributor

At 2.5, a new Invalidate method has been added to the MapView. The first call would invalidate the entire layer. Pass in an extent to limit invalidation to just a particular area. The second call will invalidate the extent of the features whose oids are in the lists for the two layers.

Invalidate(Layer,Envelope)
Invalidate(IReadOnlyDictionary<Layer,List<long>>)

MapView.Active.Invalidate(someLayer, null);‍‍‍‍‍

var dict = ...
dict[layer1] = new List<long> { 20,21,31, ...};
dict[layer2] = new List<long> { 20,21,31, ...};

MapView.Active.Invalidate(dict);‍‍‍‍‍
0 Kudos
MKa
by
Occasional Contributor III

This seems to be happening after i create a bunch of rows.  I have a tool that allows you to create a number of polygons on a selected a polygon automatically.  This is used to speed up some mapping.  In this process I create a number of rows using table.createrowbuffer.

I think i am cleaning everything up correctly but not sure.  But it seems after a while that these creations cause my redraw to slow down considerably.

0 Kudos
MKa
by
Occasional Contributor III

I am starting to look at the resource monitor.  And after I update a number of items using an inspector.  My redraw starts to crawl?

0 Kudos
MKa
by
Occasional Contributor III

I have two layers that get edited quite frequently either through direct updates or updates based on related items withing the same layer or another related layer.  Basically items within the same layer cannot intersect and must be confine to items in another layer.  So if one item is moved or has its vertex change, and that change affects another item in that same layer or another, that other item must update itself.  That being said, I realized that the RedrawAsync will work much faster if I remove and add back in the layers that are causing the problem.  How can i do this programatically, or what can i do that will have the same affect?  Is this what Invalidate will do?  If so when will 2.5 be released?  I am migrating all the code now to 2.4.3.  Is there a workaround on this for 2.4.3?

0 Kudos
MKa
by
Occasional Contributor III

The workaround is to remove the layer and programmatically add them back in whenever the map gets slow or isbusy?  I cant figure out why it gets so busy when adding features but i need a way to break the spinning?  The only way I could find to do this is by actually removing and readding the FeatureLayer.  In doing this I have to add the Definition Query back on and everything.  Can anyone think of a way to accomplish what I want here in 2.4.3 without having to remove and readd the layer?  Any Feature Layer function that would accomplish this that I am missing?

0 Kudos
SeanJones
Esri Regular Contributor

Hi M,

Like the other thread, I'd like to reproduce the issue as the performance is a concern.

Do you have some code that can show the redraw issue or is it just a matter of creating some feature with createrowbuffer then calling redraw etc?

If removing the layer fixes the issue then it sounds like something isn't getting cleared in the layer cache. Can you see if ArcGIS.Desktop.Mapping.Layer.ClearDisplayCache() has any effect?

ArcGIS Pro 2.5 was released this morning.

0 Kudos