# Path: folium/map.py
# class Layer(MacroElement):
#     """An abstract class for everything that is a Layer on the map.
#     It will be used to define whether an object will be included in
#     LayerControls.
# 
#     Parameters
#     ----------
#     name : string, default None
#         The name of the Layer, as it will appear in LayerControls
#     overlay : bool, default False
#         Adds the layer as an optional overlay (True) or the base layer (False).
#     control : bool, default True
#         Whether the Layer will be included in LayerControls.
#     show: bool, default True
#         Whether the layer will be shown on opening (only for overlays).
#     """
#     def __init__(self, name=None, overlay=False, control=True, show=True):
#         super(Layer, self).__init__()
#         self.layer_name = name if name is not None else self.get_name()
#         self.overlay = overlay
#         self.control = control
#         self.show = show


from branca.element import Element, Figure
from folium.map import Layer
from folium.utilities import image_to_url, mercator_transform, parse_options
from jinja2 import Environment, PackageLoader, Template
                'You can still use these providers by passing a URL to the `tiles` '
                'argument. See the documentation of the `TileLayer` class.'
            )
        templates = list(self._env.list_templates(
            filter_func=lambda x: x.startswith('tiles/')))
        tile_template = 'tiles/' + tiles_flat + '/tiles.txt'
        attr_template = 'tiles/' + tiles_flat + '/attr.txt'

        if tile_template in templates and attr_template in templates:
            self.tiles = self._env.get_template(tile_template).render()
            attr = self._env.get_template(attr_template).render()
        else:
            self.tiles = tiles
            if not attr:
                raise ValueError('Custom tiles must have an attribution.')

        self.options = parse_options(
            min_zoom=min_zoom,
            max_zoom=max_zoom,
            max_native_zoom=max_native_zoom or max_zoom,
            no_wrap=no_wrap,
            attribution=attr,
            subdomains=subdomains,
            detect_retina=detect_retina,
            tms=tms,
            opacity=opacity,
            **kwargs
        )



# Path: folium/map.py
# class Layer(MacroElement):
#     """An abstract class for everything that is a Layer on the map.
#     It will be used to define whether an object will be included in
#     LayerControls.
# 
#     Parameters
#     ----------
#     name : string, default None
#         The name of the Layer, as it will appear in LayerControls
#     overlay : bool, default False
#         Adds the layer as an optional overlay (True) or the base layer (False).
#     control : bool, default True
#         Whether the Layer will be included in LayerControls.
#     show: bool, default True
#         Whether the layer will be shown on opening (only for overlays).
#     """
#     def __init__(self, name=None, overlay=False, control=True, show=True):
#         super(Layer, self).__init__()
#         self.layer_name = name if name is not None else self.get_name()
#         self.overlay = overlay
#         self.control = control
#         self.show = show


# Path: folium/raster_layers.py
from branca.element import Element, Figure
from folium.map import Layer
from folium.utilities import image_to_url, mercator_transform, parse_options
from jinja2 import Environment, PackageLoader, Template

                'You can still use these providers by passing a URL to the `tiles` '
                'argument. See the documentation of the `TileLayer` class.'
            )
        templates = list(self._env.list_templates(
            filter_func=lambda x: x.startswith('tiles/')))
        tile_template = 'tiles/' + tiles_flat + '/tiles.txt'
        attr_template = 'tiles/' + tiles_flat + '/attr.txt'

        if tile_template in templates and attr_template in templates:
            self.tiles = self._env.get_template(tile_template).render()
            attr = self._env.get_template(attr_template).render()
        else:
            self.tiles = tiles
            if not attr:
                raise ValueError('Custom tiles must have an attribution.')

        self.options = parse_options(
            min_zoom=min_zoom,
            max_zoom=max_zoom,
            max_native_zoom=max_native_zoom or max_zoom,
            no_wrap=no_wrap,
            attribution=attr,
            subdomains=subdomains,
            detect_retina=detect_retina,
            tms=tms,
            opacity=opacity,
            **kwargs
        )



class WmsTileLayer(Layer):