Popup for the selection of the map, code cleaning for popup (somewhat)