traffic/plugins/leaflet.py
def flightplan_leaflet(
    flightplan: "FlightPlan", **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.
    """

    shape = flightplan.shape
    if shape is None:
        return None

    coords: Iterable = list()
    if isinstance(shape, LineString):
        coords = list((lat, lon) for (lon, lat, *_) in shape.coords)
    else:
        # In case a FlightPlan could not resolve all parts
        coords = list(
            list((lat, lon) for (lon, lat, *_) in s.coords) for s in shape
        )

    kwargs = {**dict(fill_opacity=0, weight=3), **kwargs}
    return Polyline(locations=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.
    
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.
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 .
def flightplan_leaflet(
    flightplan: "FlightPlan", **kwargs
) -> Optional[Polyline]:
    shape = flightplan.shape
    if shape is None:
        return None
    coords: Iterable = list()
    if isinstance(shape, LineString):
        coords = list((lat, lon) for (lon, lat, *_) in shape.coords)
    else:
        coords = list(
            list((lat, lon) for (lon, lat, *_) in s.coords) for s in shape
        )
    kwargs = {**dict(fill_opacity=0, weight=3), **kwargs}
    return Polyline(locations=coords, **kwargs)
def flightplan_leaflet ( flightplan : "FlightPlan" , ** kwargs ) -> Optional [ Polyline ] : shape = flightplan . shape if shape is None : return None coords : Iterable = list ( ) if isinstance ( shape , LineString ) : coords = list ( ( lat , lon ) for ( lon , lat , * _ ) in shape . coords ) else : coords = list ( list ( ( lat , lon ) for ( lon , lat , * _ ) in s . coords ) for s in shape ) kwargs = { ** dict ( fill_opacity = 0 , weight = 3 ) , ** kwargs } return Polyline ( locations = 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.
    """ # In case a FlightPlan could not resolve all parts
flightplan
"FlightPlan"