Hi. I have a great interest in / is impressed by the interactive unfolding map library with processing lately, especially the movement / animation of map markers. I was wondering, is there a way to set up the initial configuration of the markers on the unfolding map by drag and drop markers at certain screen positions, using mouse? Any comments are greatly appreciated.
To do that in a Processing sketch you would need to write it yourself. So, you would need to create a configuration mode:
boolean configuration;
void setup(){
configuration == true;
}
void draw() {
if (configuration) {
// do drag and drop here
} else {
// do normal mode here
}
}
// toggle configuration mode with keyboard
void keyReleased() {
if(key==' ') {
configuration = !configuration;
}
}
Now you would need to program the configuration mode – decide where the markers are initially, make the mouse detect the topmost marker where it clicks, and update the position of that marker while dragging. This would require collision detection for the marker (e.g. point-rect) and code for mousePressed, mouseDragged, and mouseReleased (in the reference).