I'm trying to add touch manipulation to a WpfMap to be able to Pan/Zoom, however performance seems to be significantly worse than panning with a mouse. I am basically calling WpfMap.Pan() followed by a WpfMap.Refresh() - the refresh seems to be required for the pan to actually show on the screen. Is there a more lightweight refresh option? If I can match the performance of the built in mouse panning I would be pleased.
Programmatic Pan + Refresh performance
Chris,
If call WpfMap.Pan() method once, it will have same result with pan by mouse, but if you continuous call it multi time, the performance will be lower than using mouse, the reason is that it will re-draw for each time, however mouse pan are more complicated so that it probably won’t re-draw for each time, it will check if the tiles are existing in queue, it will ignore the drawing request. If we make Pan API has same result with mouse pan, it will delay to show map because mouse pan won’t refresh map immediately, it will wait a while, if the user pan mouse again, it will cancel the first request and draw the second, if the user won’t pan again, it will show map then.
And maybe I couldn’t be wrong to understand your requirement, if you can provide a simple sample to let us reproduce your problem will be very helpful.
Thanks,
James
Hi Chris,
I think you called Refresh() method right after the Pan method, this is the key to affect the performance. First of all, calling Pan method has the see effect to Refresh, the difference from Pan method is that calling Refresh() will make all the existing tiles dirty and redraw all the tiles; while the pan only translates the existing tiles by offset in some specific mode. I’m not sure which Overlay you are using; if you are using TileOverlay such as (LayerOverlay, WmsOverlay etc), it doesn’t refresh all the tiles if call Pan() method. So please get rid of calling the Refresh() and see how the performance a like.
On the other hand, we are not sure what you scenario is, please let us know your real scenario and maybe there is a better solution for you.
Thanks,
Howard
Howard,
Our WpfMap has multiple LayerOverlays which are not updating when calling the Pan() method alone. It sounds like this is expected? Any recommendations on how to refresh the overlays without doing a call to Refresh()?
Thanks,
-Chris
Hi Chris,
Unfortunately, I cannot tell much until seeing your code. General speaking, we just need call Pan() without calling Refresh() method. And it doesn't cost too much performance to reset the map center. Here is a sample that represents what I'm talking about. Please go on running this sample, and continuously clicking the button on the upper right corner; it pans the map to the left and the performance is pretty good. If I misunderstand something, please let us know.
Thanks,
Howard
Post9573.zip (9.52 KB)
I’ll see if I can duplicate the issue I’m seeing in a small demo app.
I took a look at your sample and realized that we are just using the DesktopEdition.WpfMap, not the WpfDesktopEdition.WpfMap, in case that effects anything.
Hi Chris,
Sorry for the confusion; in MapSuite, we have two WPF versions. One is integrated in Desktop edition; this one is a wrapper of the winform edition. While another one is an enhanced version which uses more good features in WPF; you can check the sample I sent you. This section is for the second one. I will let the professional desktop support know and I think they can give you more guide for this issue.
Thanks,
Howard
Thanks for Howard’s help, and Chris, have you figure out the problem?
James