def METHOD_NAME(
    self,
    render_map: Map,
) -> List[Tuple[Layer, BaseMapServerLayerFactory]]:
    layers_plus_factories = []
    type_to_layer_factory = {}
    for layer in render_map.layers:
        layer_type = type(layer)
        if layer_type in type_to_layer_factory:
            factory = type_to_layer_factory[layer_type]
        else:
            factory = self._get_layer_factory(layer_type)
            type_to_layer_factory[layer_type] = factory
        layers_plus_factories.append((layer, factory()))
    return layers_plus_factories