Added the on window method to check that the showMap variable is defined