def choose_layer_style(n_clicks):
    """
    This function takes as input the number of clicks on the button defined above and returns:

    - the appropriate message for the button (changed at each click);
    - the background layer style to use (URL and attribution).
    """

    # Because we start with the topographic view, if the number of clicks is even, this means
    # that we are still using the topographic view and we may want to activate the satellite one.
    if n_clicks % 2 == 0:
        button_content = 'Satellite'
        layer_url = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
        layer_attribution = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'

    # If the number of clicks is odd, this means we are using the satellite view
    # and may want to come back to the topographic one.
    else:
        button_content = 'Plan'
        layer_url = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'
        layer_attribution = ('Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, '
                             'Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community')

    return button_content, layer_url, layer_attribution