MapSuite Team,
My experience is that the change of ZoomLevel/Scale is much slower than simply changing from one extent to another.
Why is a change of scale slow?
Thanks,
Dennis
Change of ZoomLevel/Sacle is Slow
Hi Dennis,
I can confirm your issue and when I looked into the issue I found somethings: As we can guess in each map control MouseWheel event, the map will be redrawn, but when I took a watch on the mouseWheel event and then do a quick/long mouse wheel, this event will be triggered multi times. So, the map will be redrawn multi times and result to a bad performance.
I then did a regular test without Map Suite Control by simply adding a MouseWheel event on the main form and I can see the same output that the event will be triggered multi times.
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.MouseWheel += MainWindow_MouseWheel;
}
void MainWindow_MouseWheel(object sender, MouseWheelEventArgs e)
{
Console.Out.WriteLine(e.Delta);
}
}
Then, I got the below results after a quick mouse wheel:
-120
-120
-120
-240
-120
-240
-120
-240
So, unless we know when the mouse wheel is in a real end, it would be hard for us to decide when to redraw the map. Anyway, We will keep doing the research on it. If you have any ideas, it would be appreciated.
Thanks,
Troy
Troy,
I can see how using the mouse wheel would have adverse effects on zoom in/out. However, my users don’t use the mouse-wheel to zoom.
I’m just asking why a zoom in and/or out appears to be take longer than changing extent. Just a simple invoke of ZoomIn() or ZoomOut().
Thanks,
Dennis
Hi Dennis,
I compared the ZoomIn,ZoomToScale and set current extent for the map directly, but the performance looks are the same. I added 20 jp2 files layer into map to test and each jp2 file is about 1g size. The below are my test cases:
1. wpfMap1.ZoomIn();
2. wpfMap1.ZoomToScale(wpfMap1.ZoomLevelSet.ZoomLevel09.Scale);
3.
wpfMap1.CurrentExtent = new RectangleShape(-29.71640625, 21.5375, 23.36953125, -20.5796875);
wpfMap1.Refresh();
Besides, after look into those methods, all of the three methods are calling the Draw(RectangleShape targetExtent) method in the end.
Would you please attach some codes to show how you test? A test video is better. Here is a smart tool to record video: techsmith.com/jing.html
Thanks,
Troy