Closed carrbrpoa closed 8 years ago
No idea. Can you publish full code listing?
Found something!
It seems to be associated with Leaflet's version: your polygon geoJSON example is using Leaflet 0.7.3, while I was trying at least with 1.0.0.beta.1.
The problem is that with 1.0.0.beta.1 and above (at least), the following code of your EditToolbar.js is being executed when I click a polygon after the first time:
map.once('click', function () { // Line 65 of EditToolbar.js
map.removeLayer(that);
});
plunkr with 1.0.0.beta.1 and your sample data. See how it works when you change to 0.7.3.
It's an expected behaviour.
So, the following modification in EditToolbar.js keeps the popup working as expected:
map.once('click', function (e) {
map.removeLayer(that);
});
shape.once('click', function (e) {
map.removeLayer(that);
L.DomEvent.stopPropagation(e);
});
I'm handling WFST's click event with the following code, like I saw in examples:
The problem is that the EditPopupToolbar only appears in the first click, even debugging and seeing that the event is being fired.
Any ideas?
Thanks in advance