addMouseWheelListener not recognized in MapThing example

I installed the MapThing library. When i try to run the example i get the error “addMouseWheelListener dindn’t exist”. This occurs both using processing 3 or 4 and on different PC. What’s wrong ?

Hi @mikLomba,

I think you can simply remove the lines for adding the listener as it should be already registered to use this…

Cheers
— mnse

deleting the “addMouseWheelListener” i was able to run the example, but the zoom-unzoom functionality is not working…
(also it was necessary to move out from “setup” the call to “size” function …putting it in the “settings”). I’m not new with processing having developed some graphic applications…and I’m surprised by the number of errors encountered in this library example

Any other suggestions ?
thanks
mikLomba

Hi @mikLomba,

Can’t test it currently as I’m not at my box, but I had a quick look at the GitHub example

Map thing example

The code is a bit outdated, so variabel size can nowadays only be set on settings as for size in setup w,h needs to be constants.

For zooming you need to change the code a bit at line

void mouseWheel(int delta)
to the signature from the reference link in my earlier post. The delta is then most probably

event.getCount()

Cheers
— mnse

The example in the library works fine with the Processing 2.x. So i guess it is not fully compatible with later processing release.

Hi

Yes true and there is no update for this library

Hello @mikLomba,

I got this working with Processing 3.5.4 !

There were other errors with Processing 4.2; they may be related to the higher versions of JAVA that come with Processing 4.2.

Go to the GitHub repository here:
https://github.com/jreades/MapThing

Take a look at the Pull requests (there are 2) and this will give some insight into changes necessary.

This will address the “addMouseWheelListener” issue:
https://github.com/kfrajer/MapThing/blob/patch-2/distribution/MapThing-1.5/examples/MapThing/MapThing.pde

This will address the “size() in setup issue”
https://github.com/kfrajer/MapThing/tree/patch-1/distribution/MapThing-1.5

You will have to combine the changes above into one sketch!
I suggest you start with the first one and then just make the changes to the size() in the next one. :)

Output:

Have fun navigating GitHub!

I used MapThing version 1.4 and installed it with the Processing Contribution Manager.

Note:
The MapThing version on GitHub is 1.4.1 and when I manually added this library it asked me to update to 1.4!
This sometimes happens with older libraries that are not maintained to work with the Processing Contribution Manager.
I did not explore further on the version numbers.

Reference to Map Thing version number on GitHub:
https://github.com/jreades/MapThing/blob/master/distribution/MapThing-1.5/download/MapThing.txt#L49

Map Thing is over 10 years old and Processing has made big leaps over time to new versions.
This is to be expected with a library that has not been updated.
Fortunately it is shared on GitHub and can be updated by those taking an interest.

:)

2 Likes