traffic/plugins/leaflet.py
def flight_leaflet(flight: "Flight", **kwargs) -> Optional[Polyline]:
    """Returns a Leaflet layer to be directly added to a Map.

    .. warning::
        This is only available if the Leaflet `plugin <plugins.html>`_ is
        activated. (true by default)

    The elements passed as kwargs as passed as is to the PolyLine constructor.

    Example usage:

    >>> from ipyleaflet import Map
    >>> # Center the map near the landing airport
    >>> m = Map(center=flight.at().latlon, zoom=7)
    >>> m.add_layer(flight)  # this works as well with default options
    >>> m.add_layer(flight.leaflet(color='red'))
    >>> m
    """
    shape = flight.shape
    if shape is None:
        return None

    kwargs = {**dict(fill_opacity=0, weight=3), **kwargs}
    return Polyline(
        locations=list((lat, lon) for (lon, lat, _) in shape.coords), **kwargs
    )
Returns a Leaflet layer to be directly added to a Map.

    .. warning::
        This is only available if the Leaflet `plugin <plugins.html>`_ is
        activated. (true by default)

    The elements passed as kwargs as passed as is to the PolyLine constructor.

    Example usage:

    >>> from ipyleaflet import Map
    >>> # Center the map near the landing airport
    >>> m = Map(center=flight.at().latlon, zoom=7)
    >>> m.add_layer(flight)  # this works as well with default options
    >>> m.add_layer(flight.leaflet(color='red'))
    >>> m
    
Returns a Leaflet layer to be directly added to a Map.
warning::
This is only available if the Leaflet `plugin `_ is
activated. (true by default)

The elements passed as kwargs as passed as is to the PolyLine constructor.

Example usage.


Returns a Leaflet layer to be directly added to a Map . warning :: This is only available if the Leaflet ` plugin ` _ is activated . ( true by default ) The elements passed as kwargs as passed as is to the PolyLine constructor . Example usage .
def flight_leaflet(flight: "Flight", **kwargs) -> Optional[Polyline]:
    shape = flight.shape
    if shape is None:
        return None
    kwargs = {**dict(fill_opacity=0, weight=3), **kwargs}
    return Polyline(
        locations=list((lat, lon) for (lon, lat, _) in shape.coords), **kwargs
    )
def flight_leaflet ( flight : "Flight" , ** kwargs ) -> Optional [ Polyline ] : shape = flight . shape if shape is None : return None kwargs = { ** dict ( fill_opacity = 0 , weight = 3 ) , ** kwargs } return Polyline ( locations = list ( ( lat , lon ) for ( lon , lat , _ ) in shape . coords ) , ** kwargs )
Returns a Leaflet layer to be directly added to a Map.
Returns a Leaflet layer to be directly added to a Map .
"""Returns a Leaflet layer to be directly added to a Map.

    .. warning::
        This is only available if the Leaflet `plugin <plugins.html>`_ is
        activated. (true by default)

    The elements passed as kwargs as passed as is to the PolyLine constructor.

    Example usage:

    >>> from ipyleaflet import Map
    >>> # Center the map near the landing airport
    >>> m = Map(center=flight.at().latlon, zoom=7)
    >>> m.add_layer(flight)  # this works as well with default options
    >>> m.add_layer(flight.leaflet(color='red'))
    >>> m
    """
flight
"Flight"