Rectangle#

Example#

from ipyleaflet import Map, basemaps, basemap_to_tiles, Rectangle

watercolor = basemap_to_tiles(basemaps.Stadia.StamenTerrain)

m = Map(layers=(watercolor, ), center=(53, 354), zoom=5)

rectangle = Rectangle(bounds=((52, 354), (53, 360)))

m.add(rectangle)

m

Attributes#

class ipyleaflet.leaflet.Rectangle(**kwargs: Any)[source]#

Rectangle class, with Polygon as parent class.

Rectangle layer.

bounds#

List of SW and NE location tuples. e.g. [(50, 75), (75, 120)].

Type:

list, default []

bounds#

list of SW and NE location tuples