setup() {
...
MapUtils.createDefaultEventDispatcher(this, map);
...
}
draw() {
map.draw();
}
Add two buttons to control the background color:
Step1: Draw Buttons (using processing)
fill() rect() etc.
* Need to put into draw method because setup only execute once.
Step2: Add functionality for buttons
mousePressed(); mouseClicked(); mouseReleased();
need to check the coordinate where the mouse is released.
Listener Hierarchy:

We have introduced the class CommonMarker as the parent class of both EarthquakeMarker and CityMarker. Now CommonMarker is the class that overrides the draw() method, and it calls drawMarker() which each subclass will implement. We introduced CommonMarker because in this assignment there will be some drawing functionality that is common to all markers on our map, so we didn’t want to have to duplicate code between EarthquakeMarker and CityMarker. This process of restructuring our code is known as refactoring and it is very common in software engineering.
Implement the selectMarkerIfHover helper method in EarthquakeCityMap. This method is called in mouseMoved() method in EarthquakeCityMap, and mouseMoved() is called by the event handler when the user moves the mouse. selectMarkerIfHover should set the instance variable selected for the first Marker it finds that mouseX and mouseY is inside of.