create controller to handle map events.