Skip to content

L.Circle Click event repeats after every removing and adding the layer to the map #1006

@Lukas-bw

Description

@Lukas-bw

Hi there,

I have L.Circles in a LayerGroup, while I create these circles, I'm binding an on.Click function to them (to show the popup). This works fine for the first time, but if I remove and add that Layer again to the map the click function gets called two times. This happens n times. So if I add and Remove the Layer 20 times, the click function gets called 20 times if I click on a Circle. Of course the circles are just created once so there are not 20 overlaying circles at the same place.

I have prepared a jsFiddle to demonstrate that bug: http://jsfiddle.net/dP9aG/1/

This bug does NOT happen with L.Marker !

same jsFiddle with L.Marker: http://jsfiddle.net/dP9aG/2/

Regards

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions