Refactored map activity event handling code to its own class.