DrawControl: edit layers button not working (again)
See original GitHub issueThis is very similar to #218, and happened after leaflet
got updated to version 1.5.1
few days back. The error is in the leaflet-draw
library, it’s passing undefined
to setStyle
function in leaflet
and this breaks inside leaflet
library.
Downgrading leaflet
to 1.4.0
fixes this problem. Fixing it in leaflet-draw
is probably not too hard, but there seems to be a backlog of 55 PRs in leaflet-draw
library and no sign of activity for about 8 months, so not too sure on how quickly this will be addressed.
There is a different drawing plugin for leaflet https://github.com/codeofsumit/leaflet.pm it seems to provide same functionality, more in fact, and is more actively maintained, at least right now.
I’m willing to prototype a DrawControl
based off leaflet.pm
backend, I see three possible approaches:
- Replace
leaflet-draw
withpm.leaflet
- Add new control
DrawControlPM
to this extension - Separate extension designed to work with this one and a compatible interface on python side.
Error Log
[Error] TypeError: undefined is not an object (evaluating 'style.hasOwnProperty')
setStyle (vendors~main.c7481366bd1204a26e11.js:27357)
addHooks (vendors~main.c7481366bd1204a26e11.js:87593:25906)
(anonymous function) (vendors~main.c7481366bd1204a26e11.js:87593:24345)
_eachVertexHandler (vendors~main.c7481366bd1204a26e11.js:87593:24229)
addHooks (vendors~main.c7481366bd1204a26e11.js:87593:24322)
enable (vendors~main.c7481366bd1204a26e11.js:25238)
_enableLayerEdit (vendors~main.c7481366bd1204a26e11.js:87594:31731)
eachLayer (vendors~main.c7481366bd1204a26e11.js:26386)
addHooks (vendors~main.c7481366bd1204a26e11.js:87594:28799)
enable (vendors~main.c7481366bd1204a26e11.js:25238)
enable (vendors~main.c7481366bd1204a26e11.js:87594:28305)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
@martinRenou I have started a
leaflet.pm
version here: https://github.com/Kirill888/ipyleaflet/commit/b4078cb295bd3fe02db5dd1c63087b02c11db2a0But there are few things that are different between
leaflet-draw
andleaflet-pm
leaflet-pm
topleft
(for now at least)On a plus side:
pm:cut
Test notebook
Thanks for looking at it @Kirill888 !
I suppose we can just make a backward incompatible release of ipyleaflet with your changes, and open feature requests upstream?
This is a known issue for most some of the controls https://github.com/jupyter-widgets/ipyleaflet/issues/367. We should also open feature requests upstream, or maybe even fix it ourselves opening PRs upstream.
Thanks again for looking into it. Don’t hesitate to open a PR when you are happy with what you have 😃