[ka-Map-users] Scroll wheel zoom
dbadke at uvic.ca
Tue Apr 18 13:51:54 EDT 2006
I started looking at how to do this, and ended up actually doing it. All
changes are in kaTool.js. It seems to work...
The modified kaTool is available at: http://web.uvic.ca/~dbadke/kaTool.zip.
The change is in three places: kaTool constructor (set up the default);
new function kaTool.setMouseWheel (set the action to perform); function
kaTool.onmousewheel (perform the action). The changes are all marked "D
The action to be performed is saved in the tool object, so each tool can
have different actions. The default is the same action as before (zoom),
so it won't break existing code. See the comments for the setMouseWheel
function for usage details.
Let me know what you think.
Paul Spencer wrote:
> this sounds like a reasonable request ... can you file a bug
> (bugzilla.maptools.org) describing how you would like it to work (i.e.
> how you would expect it to work if you wanted to call your own action
> on scroll)
> On 13-Apr-06, at 6:47 PM, David Badke wrote:
>> It would be nice if there was a way to disable the default scroll
>> wheel action (zoom in/out), or better yet, define one's own action,
>> without having to modify kaMap.js or kaTool,js. My test users
>> objected to the zooming - they kept doing it by accident - so I had
>> to disable it, meaning I changed kaMap.js, which I don't like to do.
>> My code is a bit crude: :-[
>> This works, but is not ideal. Anyway, any interest in making the
>> scroll wheel action optional and/or configurable?
Humanities Computing and Media Center
University of Victoria, BC, Canada
More information about the ka-Map-users