Rapid display of Map overlay graphics

917
3
10-04-2021 02:23 PM
MartinTyberg
New Contributor II

Hi,

I'm looking for a way to more rapidly show dynamic graphics overlaid on a MapView. In ArcObjects, I achieved this using the caching ability of the IScreenDisplay interface and was able to smoothly move a piece of text across the screen as the user moved his mouse. In Pro SDK, I'm using the MapView.Active.AddOverlay() extension method to add an overlay at a location, dispose it, and then it add again at a new location. This works but the refresh rate is very slow, in comparison to what I see in ArcMap on the same machine. Is there a way to do more efficiently so that the refresh rate is improved?

Thanks,

Martin

Tags (2)
0 Kudos
3 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I the past i used UpdateOverlay ArcGIS Pro 2.8 API Reference Guide - ArcGIS Pro 2.8 API Reference Guide instead.  Cache the symbol in your add-in and pass it together with an updated geometry.

0 Kudos
MartinTyberg
New Contributor II

Thanks for the suggestion. I tried using UpdateOverlay() in my MapTool by passing my cached text graphic (IDisposable), new point location, and cached symbolreference but the method is returning false each time and it results in the map view showing just a black dot representing the lower left of the text moving around the screen instead of the text. What could explain this behavior?

Thanks,

Martin

0 Kudos
John_Jones
New Contributor III

Martin,

I agree with Wolf's suggestion to use UpdateOverlay to improve performance. Although not currently exposed, we do have simple facilities for displaying UI text (as opposed to graphical text) that performantly tracks the mouse cursor as demonstrated here with the snapping tolerance tool (also measure tools and others)

John_Jones_0-1633396660739.png

If this is generally helpful it can be exposed easily (at a future release), but of course isn't the same feature set as putting a text overlay on the map.  I suppose we could also similarly track any WPF content adjacent to the mouse.

In certain cases (you aren't already sketching) you could start a text sketch instead of using the graphic overlay to get something like the annotation placement feedback (with the Horizontal Annotation construction tool).

 

0 Kudos