# Path: folium/raster_layers.py
# class TileLayer(Layer):
#     """
#     Create a tile layer to append on a Map.
# 
#     Parameters
#     ----------
#     tiles: str, default 'OpenStreetMap'
#         Map tileset to use. Can choose from this list of built-in tiles:
#             - "OpenStreetMap"
#             - "Stamen Terrain", "Stamen Toner", "Stamen Watercolor"
#             - "CartoDB positron", "CartoDB dark_matter"
# 
#         You can pass a custom tileset to Folium by passing a Leaflet-style
#         URL to the tiles parameter: ``http://{s}.yourtiles.com/{z}/{x}/{y}.png``.
# 
#         You can find a list of free tile providers here:
#         ``http://leaflet-extras.github.io/leaflet-providers/preview/``.
#         Be sure to check their terms and conditions and to provide attribution
#         with the `attr` keyword.
#     min_zoom: int, default 0
#         Minimum allowed zoom level for this tile layer.
#     max_zoom: int, default 18
#         Maximum allowed zoom level for this tile layer.
#     max_native_zoom: int, default None
#         The highest zoom level at which the tile server can provide tiles.
#         If provided you can zoom in past this level. Else tiles will turn grey.
#     attr: string, default None
#         Map tile attribution; only required if passing custom tile URL.
#     detect_retina: bool, default False
#         If true and user is on a retina display, it will request four
#         tiles of half the specified size and a bigger zoom level in place
#         of one to utilize the high resolution.
#     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).
#     subdomains: list of strings, default ['abc']
#         Subdomains of the tile service.
#     tms: bool, default False
#         If true, inverses Y axis numbering for tiles (turn this on for TMS
#         services).
#     opacity: float, default 1
#         Sets the opacity for the layer.
#     **kwargs : additional keyword arguments
#         Other keyword arguments are passed as options to the Leaflet tileLayer
#         object.
#     """
#     _template = Template(u"""
#         {% macro script(this, kwargs) %}
#             var {{ this.get_name() }} = L.tileLayer(
#                 {{ this.tiles|tojson }},
#                 {{ this.options|tojson }}
#             ).addTo({{ this._parent.get_name() }});
#         {% endmacro %}
#         """)
# 
#     def __init__(self, tiles='OpenStreetMap', min_zoom=0, max_zoom=18,
#                  max_native_zoom=None, attr=None,
#                  detect_retina=False, name=None, overlay=False,
#                  control=True, show=True, no_wrap=False, subdomains='abc',
#                  tms=False, opacity=1, **kwargs):
# 
#         self.tile_name = (name if name is not None else
#                           ''.join(tiles.lower().strip().split()))
#         super(TileLayer, self).__init__(name=self.tile_name, overlay=overlay,
#                                         control=control, show=show)
#         self._name = 'TileLayer'
#         self._env = ENV
# 
#         tiles_flat = ''.join(tiles.lower().strip().split())
#         if tiles_flat in {'cloudmade', 'mapbox', 'mapboxbright', 'mapboxcontrolroom'}:
#             # added in May 2020 after v0.11.0, remove in a future release
#             raise ValueError(
#                 'Built-in templates for Mapbox and Cloudmade have been removed. '
#                 '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
#         )


from branca.element import MacroElement
from folium.elements import JSCSSMixin
from folium.raster_layers import TileLayer
from folium.utilities import parse_options
from jinja2 import Template
    zoom_level_fixed : int, default None
        Overrides the offset to apply a fixed zoom level to the minimap
        regardless of the main map zoom.
        Set it to any valid zoom level, if unset zoom_level_offset is used
        instead.
    center_fixed : bool, default False
        Applies a fixed position to the minimap regardless of the main map's
        view / position. Prevents panning the minimap, but does allow zooming
        (both in the minimap and the main map).
        If the minimap is zoomed, it will always zoom around the centerFixed
        point. You can pass in a LatLng-equivalent object.
    zoom_animation : bool, default False
        Sets whether the minimap should have an animated zoom.
        (Will cause it to lag a bit after the movement of the main map.)
    toggle_display : bool, default False
        Sets whether the minimap should have a button to minimise it.
    auto_toggle_display : bool, default False
        Sets whether the minimap should hide automatically
        if the parent map bounds does not fit within the minimap bounds.
        Especially useful when 'zoomLevelFixed' is set.
    minimized : bool, default False
        Sets whether the minimap should start in a minimized position.

    Examples
    --------
    >>> MiniMap(tile_layer='Stamen WaterColor', position='bottomleft')
    """

    _template = Template("""
        {% macro script(this, kwargs) %}

# Path: folium/raster_layers.py
# class TileLayer(Layer):
#     """
#     Create a tile layer to append on a Map.
# 
#     Parameters
#     ----------
#     tiles: str, default 'OpenStreetMap'
#         Map tileset to use. Can choose from this list of built-in tiles:
#             - "OpenStreetMap"
#             - "Stamen Terrain", "Stamen Toner", "Stamen Watercolor"
#             - "CartoDB positron", "CartoDB dark_matter"
# 
#         You can pass a custom tileset to Folium by passing a Leaflet-style
#         URL to the tiles parameter: ``http://{s}.yourtiles.com/{z}/{x}/{y}.png``.
# 
#         You can find a list of free tile providers here:
#         ``http://leaflet-extras.github.io/leaflet-providers/preview/``.
#         Be sure to check their terms and conditions and to provide attribution
#         with the `attr` keyword.
#     min_zoom: int, default 0
#         Minimum allowed zoom level for this tile layer.
#     max_zoom: int, default 18
#         Maximum allowed zoom level for this tile layer.
#     max_native_zoom: int, default None
#         The highest zoom level at which the tile server can provide tiles.
#         If provided you can zoom in past this level. Else tiles will turn grey.
#     attr: string, default None
#         Map tile attribution; only required if passing custom tile URL.
#     detect_retina: bool, default False
#         If true and user is on a retina display, it will request four
#         tiles of half the specified size and a bigger zoom level in place
#         of one to utilize the high resolution.
#     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).
#     subdomains: list of strings, default ['abc']
#         Subdomains of the tile service.
#     tms: bool, default False
#         If true, inverses Y axis numbering for tiles (turn this on for TMS
#         services).
#     opacity: float, default 1
#         Sets the opacity for the layer.
#     **kwargs : additional keyword arguments
#         Other keyword arguments are passed as options to the Leaflet tileLayer
#         object.
#     """
#     _template = Template(u"""
#         {% macro script(this, kwargs) %}
#             var {{ this.get_name() }} = L.tileLayer(
#                 {{ this.tiles|tojson }},
#                 {{ this.options|tojson }}
#             ).addTo({{ this._parent.get_name() }});
#         {% endmacro %}
#         """)
# 
#     def __init__(self, tiles='OpenStreetMap', min_zoom=0, max_zoom=18,
#                  max_native_zoom=None, attr=None,
#                  detect_retina=False, name=None, overlay=False,
#                  control=True, show=True, no_wrap=False, subdomains='abc',
#                  tms=False, opacity=1, **kwargs):
# 
#         self.tile_name = (name if name is not None else
#                           ''.join(tiles.lower().strip().split()))
#         super(TileLayer, self).__init__(name=self.tile_name, overlay=overlay,
#                                         control=control, show=show)
#         self._name = 'TileLayer'
#         self._env = ENV
# 
#         tiles_flat = ''.join(tiles.lower().strip().split())
#         if tiles_flat in {'cloudmade', 'mapbox', 'mapboxbright', 'mapboxcontrolroom'}:
#             # added in May 2020 after v0.11.0, remove in a future release
#             raise ValueError(
#                 'Built-in templates for Mapbox and Cloudmade have been removed. '
#                 '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/plugins/minimap.py
from branca.element import MacroElement
from folium.elements import JSCSSMixin
from folium.raster_layers import TileLayer
from folium.utilities import parse_options
from jinja2 import Template

    zoom_level_fixed : int, default None
        Overrides the offset to apply a fixed zoom level to the minimap
        regardless of the main map zoom.
        Set it to any valid zoom level, if unset zoom_level_offset is used
        instead.
    center_fixed : bool, default False
        Applies a fixed position to the minimap regardless of the main map's
        view / position. Prevents panning the minimap, but does allow zooming
        (both in the minimap and the main map).
        If the minimap is zoomed, it will always zoom around the centerFixed
        point. You can pass in a LatLng-equivalent object.
    zoom_animation : bool, default False
        Sets whether the minimap should have an animated zoom.
        (Will cause it to lag a bit after the movement of the main map.)
    toggle_display : bool, default False
        Sets whether the minimap should have a button to minimise it.
    auto_toggle_display : bool, default False
        Sets whether the minimap should hide automatically
        if the parent map bounds does not fit within the minimap bounds.
        Especially useful when 'zoomLevelFixed' is set.
    minimized : bool, default False
        Sets whether the minimap should start in a minimized position.

    Examples
    --------
    >>> MiniMap(tile_layer='Stamen WaterColor', position='bottomleft')
    """

    _template = Template("""
        {% macro script(this, kwargs) %}

            var {{ this.tile_layer.get_name() }} = L.tileLayer(