def get_map_name(location):
    """
    Gets the "map name" of a SQLLocation, defaulting to the location's name if not available.
    """
    if not location:
        return

    if 'map_location_name' in location.metadata and location.metadata['map_location_name']:
        return location.metadata['map_location_name']
    else:
        return location.name