2

I have an ArcGIS Silverlight app with a Map object. It containes an ArcGISTiledMapServiceLayer and a GraphicsLayer. We've written a custom measure tool for adding in a point at an offset on the graphic layer. I am trying to disable the mouse wheel zoom-in/zoom-out function when this tool is activated to prevent the user from being able to zooom while performing a measurement.

I've played around with various combinations of setting the map.IsHitTestVisible = false, graphicLayer.IsHitTestVisible = false, overriding OnMouseWheel(), all with no sucess. It either had no effect, or it disabled ALL mouse events, including the mouse down and mouse move event which I need for the measure tool.

I've read thru the documentation on the MouseWheel but I guess I'm not understanding it correctly. I just can't seem to get it to do what I want. And I can't find any specific examples that do what I want either.

Any suggestions or places I can look to figure this out?

I am using Silverlight 4 and ESRI Silverlight 2.4.

1 Answer 1

1

I haven't tried it, but you could try setting the Map's ZoomFactor property to zero 1 (storing the old value) while your measurement tool is active.

http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Map~ZoomFactor.html

2
  • 1
    Or maybe zoomfactor = 1. Feb 29, 2012 at 17:19
  • Thank you both!! I forgot to put in my original question that I had tried setting zoom factor to 0 but it didn't quite work the way I wanted. But setting it to 1 did. Problem solved!!
    – mfowler
    Feb 29, 2012 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.