# Path: folium/map.py
# class Marker(MacroElement):
#     """
#     Create a simple stock Leaflet marker on the map, with optional
#     popup text or Vincent visualization.
# 
#     Parameters
#     ----------
#     location: tuple or list
#         Latitude and Longitude of Marker (Northing, Easting)
#     popup: string or folium.Popup, default None
#         Label for the Marker; either an escaped HTML string to initialize
#         folium.Popup or a folium.Popup instance.
#     tooltip: str or folium.Tooltip, default None
#         Display a text when hovering over the object.
#     icon: Icon plugin
#         the Icon plugin to use to render the marker.
#     draggable: bool, default False
#         Set to True to be able to drag the marker around the map.
# 
#     Returns
#     -------
#     Marker names and HTML in obj.template_vars
# 
#     Examples
#     --------
#     >>> Marker(location=[45.5, -122.3], popup='Portland, OR')
#     >>> Marker(location=[45.5, -122.3], popup=Popup('Portland, OR'))
#     # If the popup label has characters that need to be escaped in HTML
#     >>> Marker(location=[45.5, -122.3],
#     ...        popup=Popup('Mom & Pop Arrow Shop >>', parse_html=True))
#     """
#     _template = Template(u"""
#         {% macro script(this, kwargs) %}
#             var {{ this.get_name() }} = L.marker(
#                 {{ this.location|tojson }},
#                 {{ this.options|tojson }}
#             ).addTo({{ this._parent.get_name() }});
#         {% endmacro %}
#         """)
# 
#     def __init__(self, location=None, popup=None, tooltip=None, icon=None,
#                  draggable=False, **kwargs):
#         super(Marker, self).__init__()
#         self._name = 'Marker'
#         self.location = validate_location(location) if location else None
#         self.options = parse_options(
#             draggable=draggable or None,
#             autoPan=draggable or None,
#             **kwargs
#         )
#         if icon is not None:
#             self.add_child(icon)
#             self.icon = icon
#         if popup is not None:
#             self.add_child(popup if isinstance(popup, Popup)
#                            else Popup(str(popup)))
#         if tooltip is not None:
#             self.add_child(tooltip if isinstance(tooltip, Tooltip)
#                            else Tooltip(str(tooltip)))
# 
#     def _get_self_bounds(self):
#         """Computes the bounds of the object itself.
# 
#         Because a marker has only single coordinates, we repeat them.
#         """
#         return [self.location, self.location]
# 
#     def render(self):
#         if self.location is None:
#             raise ValueError("{} location must be assigned when added directly to map.".format(self._name))
#         super(Marker, self).render()


from folium.elements import JSCSSMixin
from folium.map import Marker
from folium.utilities import parse_options
from jinja2 import Template

class BoatMarker(JSCSSMixin, Marker):
    """Add a Marker in the shape of a boat.

    Parameters
    ----------
    location: tuple of length 2, default None
        The latitude and longitude of the marker.
        If None, then the middle of the map is used.
    heading: int, default 0
        Heading of the boat to an angle value between 0 and 360 degrees
    wind_heading: int, default None
        Heading of the wind to an angle value between 0 and 360 degrees
        If None, then no wind is represented.
    wind_speed: int, default 0
        Speed of the wind in knots.

    https://github.com/thomasbrueggemann/leaflet.boatmarker

    """
    _template = Template(u"""
        {% macro script(this, kwargs) %}
            var {{ this.get_name() }} = L.boatMarker(
                {{ this.location|tojson }},
                {{ this.options|tojson }}
            ).addTo({{ this._parent.get_name() }});
            {% if this.wind_heading is not none -%}
            {{ this.get_name() }}.setHeadingWind(
                {{ this.heading }},
                {{ this.wind_speed }},

# Path: folium/map.py
# class Marker(MacroElement):
#     """
#     Create a simple stock Leaflet marker on the map, with optional
#     popup text or Vincent visualization.
# 
#     Parameters
#     ----------
#     location: tuple or list
#         Latitude and Longitude of Marker (Northing, Easting)
#     popup: string or folium.Popup, default None
#         Label for the Marker; either an escaped HTML string to initialize
#         folium.Popup or a folium.Popup instance.
#     tooltip: str or folium.Tooltip, default None
#         Display a text when hovering over the object.
#     icon: Icon plugin
#         the Icon plugin to use to render the marker.
#     draggable: bool, default False
#         Set to True to be able to drag the marker around the map.
# 
#     Returns
#     -------
#     Marker names and HTML in obj.template_vars
# 
#     Examples
#     --------
#     >>> Marker(location=[45.5, -122.3], popup='Portland, OR')
#     >>> Marker(location=[45.5, -122.3], popup=Popup('Portland, OR'))
#     # If the popup label has characters that need to be escaped in HTML
#     >>> Marker(location=[45.5, -122.3],
#     ...        popup=Popup('Mom & Pop Arrow Shop >>', parse_html=True))
#     """
#     _template = Template(u"""
#         {% macro script(this, kwargs) %}
#             var {{ this.get_name() }} = L.marker(
#                 {{ this.location|tojson }},
#                 {{ this.options|tojson }}
#             ).addTo({{ this._parent.get_name() }});
#         {% endmacro %}
#         """)
# 
#     def __init__(self, location=None, popup=None, tooltip=None, icon=None,
#                  draggable=False, **kwargs):
#         super(Marker, self).__init__()
#         self._name = 'Marker'
#         self.location = validate_location(location) if location else None
#         self.options = parse_options(
#             draggable=draggable or None,
#             autoPan=draggable or None,
#             **kwargs
#         )
#         if icon is not None:
#             self.add_child(icon)
#             self.icon = icon
#         if popup is not None:
#             self.add_child(popup if isinstance(popup, Popup)
#                            else Popup(str(popup)))
#         if tooltip is not None:
#             self.add_child(tooltip if isinstance(tooltip, Tooltip)
#                            else Tooltip(str(tooltip)))
# 
#     def _get_self_bounds(self):
#         """Computes the bounds of the object itself.
# 
#         Because a marker has only single coordinates, we repeat them.
#         """
#         return [self.location, self.location]
# 
#     def render(self):
#         if self.location is None:
#             raise ValueError("{} location must be assigned when added directly to map.".format(self._name))
#         super(Marker, self).render()


# Path: folium/plugins/boat_marker.py
from folium.elements import JSCSSMixin
from folium.map import Marker
from folium.utilities import parse_options
from jinja2 import Template


class BoatMarker(JSCSSMixin, Marker):
    """Add a Marker in the shape of a boat.

    Parameters
    ----------
    location: tuple of length 2, default None
        The latitude and longitude of the marker.
        If None, then the middle of the map is used.
    heading: int, default 0
        Heading of the boat to an angle value between 0 and 360 degrees
    wind_heading: int, default None
        Heading of the wind to an angle value between 0 and 360 degrees
        If None, then no wind is represented.
    wind_speed: int, default 0
        Speed of the wind in knots.

    https://github.com/thomasbrueggemann/leaflet.boatmarker

    """
    _template = Template(u"""
        {% macro script(this, kwargs) %}
            var {{ this.get_name() }} = L.boatMarker(
                {{ this.location|tojson }},
                {{ this.options|tojson }}
            ).addTo({{ this._parent.get_name() }});
            {% if this.wind_heading is not none -%}
            {{ this.get_name() }}.setHeadingWind(
                {{ this.heading }},
                {{ this.wind_speed }},

                {{ this.wind_heading }}