Split MapEvent into functions for GUIs