We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm working on this project with a fullscreen map but on top of that I have a series of buttons and sliders (controlP5) that are used to filter out a series of variables and render different batch of pins.
The problem is that when I click a toggle button or drag a slider I'm also interacting with the map behind so I was wondering if there's a way in UnfoldingMap library to limit the area of interaction or, even better, toggle the interaction so I can disable it when the mouse is over a controlP5 element and viceversa (using cp5.isMouseOver() ).
Thank you!!
Answers
Anyone can help on this? I could not find anything on unfolding maps and I'm quite a noob in understanding the JavaDoc Reference, can't always wrap my head around it.
Any help is appreciated :)
Sorry, missed this question. Hope this is still helpful.
If you have some UI in combination with a map, and still want to have an interactive map, you need to either
a) simply separate them. e.g. make the map smaller and the UI below. See the following pseudo-code:
b) for more complex stuff, or if your UI is atop the map you need to delete the DefaultEventDispatcher, and forward the interactions to the map yourself. See https://github.com/tillnagel/unfolding/commit/b5729dbe08cfcd719b3201fac8d2dd9ebea03cf5 for an example
Thaks tnagel, I'm gonna look into your example on github right now! Since I have lots of buttons I don't want to sacrifice too much space for the UI only. I thought overlapping the two was the best solution.
can't you just draw the word "Menu" in the corner and when you click on it, you get into the state menu and the map is off and you draw your series of buttons and sliders?
I guess I could do that for sure but there's a plus in having the possibility to see what is changing on the map in realtime while you interact with the interface. Being a visualization tool I think it's important to be able to always have a visual reference of "how it looked like before changing that variable on the menu".
understood.
you can't click on a state to switch it on/off?
I'm not sure I understand your question, you mean creating a button that sets ON or OFF the rest of the interface?
(here's a pic of a part of the interface, just to be clear :D )
sorry double post...sometime pForum freezes on me when I use imgs :-/
I'm on the wrong track
just stick with tnagel