Magnifying Glass#

Example#

from ipyleaflet import Map, MagnifyingGlass, basemaps, basemap_to_tiles
m = Map(center=(0, 0), zoom=2)

topo_layer = basemap_to_tiles(basemaps.OpenTopoMap)
magnifying_glass = MagnifyingGlass(layers=[topo_layer])

m.add(magnifying_glass)

m

Attributes#

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

MagnifyingGlass class.

radius#

The radius of the magnifying glass, in pixels.

Type:

int, default 100

zoom_offset#

The zoom level offset between the main map zoom and the magnifying glass.

Type:

int, default 3

fixed_zoom#

If different than -1, defines a fixed zoom level to always use in the magnifying glass, ignoring the main map zoom and the zoomOffet value.

Type:

int, default -1

fixed_position#

If True, the magnifying glass will stay at the same position on the map, not following the mouse cursor.

Type:

boolean, default False

lat_lng#

The initial position of the magnifying glass, both on the main map and as the center of the magnified view. If fixed_position is True, it will always keep this position.

Type:

list, default [0, 0]

layers#

Set of layers to display in the magnified view. These layers shouldn’t be already added to a map instance.

Type:

list, default []