Select to view content in your preferred language

MouseWheelEvent

531
2
Jump to solution
02-04-2013 07:04 AM
TroyProctor
Regular Contributor
Hi,
I'm trying to get the MouseWheel Event to fire for a map and it's not working. I'm not sure what I might be missing. I'm trying to disable the application from zooming to a scale less than 1:500, but I still want the service to be able to zoom closer for another application.

Thanks for the help,
Troy

XAML:
<esri:Map x:Name="Map" MouseClick="QueryPoint_MouseClick" IsLogoVisible="False" SnapToLevels="True" MouseWheel="MouseWheel_MaxZoom">

C#:
private void MouseWheel_MaxZoom(object sender, MouseWheelEventArgs e)
        {

            if (e.Delta > 1)
            {
                MessageBox.Show("You are using the Mouse Wheel");
            }
           
        }
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
What is not working exactly?

Most generally for limiting the zoom in or zoom out scale you have to set the MinimumResolution and or the MaximumResolution of the map.
Though not sure if this can help in your use case.

Also take care that setting SnapToLevels to true limits as well the map resolution to the resolutions of the tiled layer. This might also explain your issue.

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
What is not working exactly?

Most generally for limiting the zoom in or zoom out scale you have to set the MinimumResolution and or the MaximumResolution of the map.
Though not sure if this can help in your use case.

Also take care that setting SnapToLevels to true limits as well the map resolution to the resolutions of the tiled layer. This might also explain your issue.
0 Kudos
TroyProctor
Regular Contributor
I had expected the following message to appear when using the mouse wheel on the map, "You are using the Mouse Wheel", but it never does.

I was able to set the MinimumResolution(.4) on my map and that resolved my issue.

Thanks for your help!

Troy
0 Kudos