(layer, all_layers)
* Recursivly applies all properties except 'paint' from the layer specified by 'ref'.
     * Layers can reference each other with the 'ref' property, in which case the properties are located on the
       referenced layer.
    :param layer:
    :param all_layers:
    :return:
* Recursivly applies all properties except 'paint' from the layer specified by 'ref'.
     * Layers can reference each other with the 'ref' property, in which case the properties are located on the
       referenced layer.
    :param layer:
    :param all_layers:
    :return:
* Recursivly applies all properties except paint from the layer specified by ref . * Layers can reference each other with the ref property in which case the properties are located on the referenced layer . : param layer : : param all_layers : : return :
def _apply_source_layer(layer, all_layers):
    """
     * Recursivly applies all properties except 'paint' from the layer specified by 'ref'.
     * Layers can reference each other with the 'ref' property, in which case the properties are located on the
       referenced layer.
    :param layer:
    :param all_layers:
    :return:
    """

    ref = _get_value_safe(layer, "ref")
    if ref:
        matching_layers = list(filter(lambda l: _get_value_safe(l, "id") == ref, all_layers))
        if matching_layers:
            target_layer = matching_layers[0]
            for prop in target_layer:
                if prop != "paint":
                    layer[prop] = target_layer[prop]
            _apply_source_layer(target_layer, all_layers)
def _apply_source_layer ( layer , all_layers ) : ref = _get_value_safe ( layer , "ref" ) if ref : matching_layers = list ( filter ( lambda l : _get_value_safe ( l , "id" ) == ref , all_layers ) ) if matching_layers : target_layer = matching_layers [ 0 ] for prop in target_layer : if prop != "paint" : layer [ prop ] = target_layer [ prop ] _apply_source_layer ( target_layer , all_layers )