Polyline#
Example Polyline#
from ipyleaflet import Map, Polyline
line = Polyline(
locations=[
[45.51, -122.68],
[37.77, -122.43],
[34.04, -118.22]
],
color="green" ,
fill=False
)
m = Map(center = (42.5, -41), zoom =2)
m.add_layer(line)
m
Example MultiPolyline#
from ipyleaflet import Map, Polyline
lines = Polyline(
locations=[
[[45.51, -122.68],
[37.77, -122.43],
[34.04, -118.2]],
[[40.78, -73.91],
[41.83, -87.62],
[32.76, -96.72]]
],
color="green" ,
fill=False
)
m = Map(center = (42.5, -41), zoom =2)
m.add_layer(lines)
m
Attributes#
- class ipyleaflet.leaflet.Polyline(**kwargs)[source]#
Polyline abstract class, with Path as parent class.
- locations#
Locations defining the shape.
- Type
list, default []
- scaling#
Whether you can edit the scale of the shape or not.
- Type
boolean, default True
- rotation#
Whether you can rotate the shape or not.
- Type
boolean, default True
- uniform_scaling#
Whether to keep the size ratio when changing the shape scale.
- Type
boolean, default False
- smooth_factor#
Smoothing intensity.
- Type
float, default 1.
- transform#
Whether the shape is editable or not.
- Type
boolean, default False
- draggable#
Whether you can drag the shape on the map or not.
- Type
boolean, default False