from pathlib import Path

import anywidget
import traitlets


class LeafletMap(anywidget.AnyWidget):
    _esm = Path(__file__).with_name("anywidget.js")
    _css = Path(__file__).with_name("anywidget.css")

    center = traitlets.List(traitlets.Float(), default_value=[20.0, 0.0]).tag(sync=True)
    zoom = traitlets.Int(default_value=2).tag(sync=True)
    height = traitlets.Unicode(default_value="600px").tag(sync=True)

    bounds = traitlets.List(default_value=[]).tag(sync=True)
    clicked = traitlets.Dict(default_value={}).tag(sync=True)

    zoom_control = traitlets.Bool(default_value=True).tag(sync=True)
    attribution_control = traitlets.Bool(default_value=True).tag(sync=True)

__all__ = ["LeafletMap"]
