Skip to content

openlayers module

Map

Bases: AnyWidget

Map widget

Parameters:

Name Type Description Default
anywidget _type_

description

required
Source code in mapwidget/openlayers.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Map(anywidget.AnyWidget):
    """Map widget

    Args:
        anywidget (_type_): _description_
    """

    _cwd = os.path.dirname(os.path.abspath(__file__))
    _esm = pathlib.Path(os.path.join(_cwd, "js", "openlayers.js"))
    _css = pathlib.Path(os.path.join(_cwd, "css", "openlayers.css"))
    center = traitlets.List([0, 20]).tag(sync=True, o=True)
    zoom = traitlets.Float(2).tag(sync=True, o=True)
    bounds = traitlets.List([0, 0, 0, 0]).tag(sync=True, o=True)
    width = traitlets.Unicode("100%").tag(sync=True, o=True)
    height = traitlets.Unicode("600px").tag(sync=True, o=True)
    clicked_latlng = traitlets.List([None, None]).tag(sync=True, o=True)