Open hari0603 opened 5 years ago
I have looked into this, and have been able to reproduce it.
I will have to check whether the bug exists in leafletdraw
as well. Based on that, I can either update to the latest leafletdraw
, or post a bug report in that module, and update once we're fixed.
I created a simple web example. It doesn't seem to have the same bug. Now I will have to update the leaflet.draw version to the latest in pyqtlet, and see if the bug is still present.
I have updated the versions of leaflet
and leaflet.draw
. These changes have been pushed to release 0.3.3. This has fixed the bug.
I'm going to consider this issue solved.
The threshhold seems to have increased to 10 points. Needs further investigation.
Steps for further investigation:
PyQtWebEngineWidget
and see if the bug still persists. If it doesn't then the problem is with pyqtlet
, otherwise it is either in PyQt
or Qt
itself.Qt
to narrow down further. Report bug accordingly.Minimal complete verifiable web example:
<html>
<body>
<script src='https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet-src.js'></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.css"/>
<script src='https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.js'></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw-src.css"/>
<div>Map test</div>
<div id='map' style='height:600px'></div>
<script>
let map = L.map('map').setView([12, 77], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);
let drawnItems = new L.FeatureGroup();
map.addLayer(drawnItems);
let drawControl = new L.Control.Draw({
edit: {
featureGroup: drawnItems
}
});
map.addControl(drawControl);
map.on(L.Draw.Event.CREATED, function (e) {
var type = e.layerType,
layer = e.layer;
drawnItems.addLayer(layer);
});
</script>
</body>
</html>
Ran the example with just PyQtWebEngineView
, the bug does not appear. This means that the bug lies inside of pyqtlet
somewhere. I am not entirely certain how to go about finding it... =/
One idea is that I will print all the runJavaScript
calls, and create a web project that uses just that Js, and see if the bug persists.
When the user clicks on 6 or more points,