ThinkGeo.com    |     Documentation    |     Premium Support

Zoom using Mouse Wheel or TrackZoomIn not working anymore

Hi,

our complex application as well as a very small demo app are not able to zoom using the mouse wheel or track zoom in anymore when I upgrade from beta111 to anything newer.

When I use the mouse wheel in beta112 the Scale Bar changes but the map remains unchanged.
With beta127 not even the Scale Bar reacts anymore.

What happened?

Regards,
Peter

Hi Peter,

We’ve just tested the latest beta127 with HowDoI samples and Mouse Wheel/TrackZoomIn works fine. Can you send the small demo to us?

Here is the latest HowDoI using the latest beta in case you want to have a quick try on your side.
samples/wpf · develop · ThinkGeo / Public / Desktop Maps · GitLab

And just FYI, we’ve recently finished adding new features and now are actively doing bug fixes in the beta branches preparing for the next major release.

Thanks,
Ben

Hi Ben,

thank you for your quick answer.
I’ve attached a small sample app. It is currently using beta111 and working fine. But when I update to anything newer the mouse wheel as well as TrackZoomIn (after selecting it in the “toolbar”) do not work anymore.

I tried to take a (admittedly quick) look at your samples but did not find one using TrackZoomIn. Could you please point me in the right direction. Thank you.

Regards,
Peter

TrackZoomSampleWithMap.zip (1.9 MB)

Hi Peter,

I opened the demo you sent over, update to the latest beta128, and the TrackZoomIn and MouseWheel all works fine. I also tried beta111 and beta126, everything looks good. Did I miss anything? Do you see the same issue if just double clicking the compiled exe? If you do see the issue, can you send the executables as well as its dependencies to us (support@thinkgeo.com)?

TrackZoomIn is on by default when holding the Shift key. We don’t have a sample changing the default TrackZoomInKey/TrackZoomInMouseButton like what you did in the sample though.

Thanks,
Ben

Hi Ben,

thank you.
I did some more digging and now it becomes really strange.

First I noticed that with beta128 on my dev machine (with the ThinkGeo license) not only does the mouse wheel and TrackZoomIn not work but also has the click on the button “Zoom Out” (with a call to MapView.ZoomOutAsync()) no effect. While the version with beta111 works nicely. I’ve tried this in Debug mode of VS as well as stand alone just opening the executables.

But when I copy the executables to another Windows 11 machine (without any ThinkGeo license) both versions work just fine.

The behaviour remains the same even when I simplify the code by removing any changes to TrackZoomInKey/TrackZoomInMouseButton.

That’s the point where I’m completely lost. What changed when you switched from beta111 to beta112 that could cause such behaviour?

I’ve sent archives with the versions on the given mail address.

Thank you for your help.

Regards,
Peter

Hi Peter,

This is weird! We did make some changes between beta111 and 112 but none should lead to this. I got your email and the 2 executables you sent over both work fine on my machine.

Can you:

  1. let me know the config (windows version, .net versions, etc) of your dev machine, I’ll see if we can recreate it on our side.
  2. Add the following code to your project, and check if you see any ThinkGeo exceptions in the Output Window.
    ThinkGeoDebugger.LogType = ThinkGeoLogType.All;
    ThinkGeoDebugger.LogLevel = ThinkGeoLogLevel.Warning;
  1. Check if the MapView.CancellationTokenSource.IsCancellationRequested is true (This property MapView.CancellationTokenSource is available in 128, not 111)

Let me know what you find out.

Thanks,
Ben

Hi Ben,

thank you for looking into this.

First I’ve added the line you gave me and the check of the CancellationTokenSource.

  1. You can see the output of dotnet --info in the attachment. Interestingly does my project run using SDK 8 while this output makes it look like that there is no version 8.0 SDK installed. I guess it came with VS2022. It makes no difference if I change the project to version 9.0 of the SDK.
    dotnet-info.txt (6.9 KB)

  2. When I pan the map over the left or right boundary of the layer with either the left or right mouse button the following exceptions occur when the mouse button is released:

    Exception thrown: 'System.ArgumentOutOfRangeException' in ThinkGeo.Core.dll
    Exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll
    Exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll
    Exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll
    Exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll
    

    This does not happen when I move over the upper or lower boundary of the map.
    On the other nothing works with the exception of the center map button on the navigation control in the center of the circle on the left side. The map does not pan using the arrows in the circle, only with the mouse. The map does not zoom in any way. Not with the mouse wheel, not with the toolbar button calls to ZoomInAsync or ZoomOutAsync, not with “+”/"-" bottons on the scale bar nor with the slider on the scale bar. I can move the slider but without any effect.

    Otherwise there is no further output.

  3. The IsCancellationRequested property is not set to True when I check it in the constructor of the windows or when I check when trying to zoom in using the toolbar button.

Regards,
Peter

Hi Ben,

to illustrate everything a bit better I made a short video: https://youtu.be/F83idUqY-Hk

Regards,
Peter

Hi Peter,

I think I got it - this bug only shows up when viewing the map over Remote Desktop. Since hardware acceleration is disabled in RDP sessions, we previously turned off animations and used an alternate rendering path, in which a bug was introduced recently.

Because animations are becoming a key feature in the upcoming release, we’ve removed that special RDP logic and now always enable animations, even over Remote Desktop. Please pull the latest wpf beta130—it should resolve the problem.

Thanks,
Ben

Hi Ben,

beta130 works fine.
RDP is so “wonderful”…

Thank you very much.

Regards,
Peter

Sure it is :smile: Let us know if you see more issues.