Skip to content

Draw control can't stop drawing after draw more than one shape #1119

@J-Bindel

Description

@J-Bindel

Hey,

I am using ipyleaflet for my work. I would like to draw rectangles on my map with DrawControl.

from ipyleaflet import Map, DrawControl

map = Map(center=(49.115469, -1.082814), zoom=10)
dc = DrawControl(
    marker={"shapeOptions": {"color": "#0000FF"}},
    rectangle={"shapeOptions": {"color": "#0000FF"}},
    circle={"shapeOptions": {"color": "#0000FF"}},
    circlemarker={},
)
map.add(dc)
display(map)

The first drawing works but when I click again on the rectangle for example, DrawControl won't stop drawing rectangles until I clear them all.

The above code reproduces the bug.

Here is what I get.
Screencast from 19-06-2023 18:39:08.webm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions