Thanks; once again added to the user guide:-
http://docs.codehaus.org/display/GEOTDOC/MapPane
I actually think we could set up a tool to respect mousewheel events; but
have not looked at it.
On Thu, Feb 5, 2009 at 10:48 AM, Michael Bedward
<[email protected]>wrote:
> Perhaps the easiest way of doing it, without sub-classing JMapPane, is
> something like this...
>
> // somewhere in your code...
> double clickToZoom = 0.1; // 1 wheel click is 10% zoom
>
> // wheel event handler
> public void handleMouseWheelEvent(MouseWheelEvent ev) {
> int clicks = ev.getWheelRotation();
> // -ve means wheel moved up, +ve means down
> int sign = (clicks < 0 ? -1 : 1);
>
> Envelope env = mapPane.getMapArea();
> double width = env.getWidth();
> double delta = width * clickToZoom * sign;
>
> env.expandBy(delta);
> mapPane.setMapArea(env);
> mapPane.repaint();
> }
>
>
> Warning: I can't test this because I don't have a mouse wheel :-)
>
> Michael
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with
> Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code
> to
> build responsive, highly engaging applications that combine the power of
> local
> resources and data with the reach of the web. Download the Adobe AIR SDK
> and
> Ajax docs to start building applications today-
> http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users