Leaflet / Leaflet.Editable

Make geometries editable in Leaflet.
http://leaflet.github.io/Leaflet.Editable/doc/api.html
553 stars 198 forks source link

TypeError: null is not an object (evaluating 'e._leaflet_pos') #179

Open tjmcewan opened 5 years ago

tjmcewan commented 5 years ago

Since upgrading to version 1.2.0, I've been seeing the occasional error like this:

TypeError: null is not an object (evaluating 'e._leaflet_pos') 1 File "webpack:///./node_modules/leaflet/dist/leaflet-src.js" line 2445 col 1 in le return el._leaflet_pos || new Point(0, 0); 2 File "webpack:///./node_modules/leaflet-editable/src/Leaflet.Editable.js" line 720 col 1 in onMouseDown var iconPos = L.DomUtil.getPosition(this._icon), 3 File "webpack:///./node_modules/logrocket/dist/build.umd.js" line 1679 col 1 in r return func.apply(this, args); 4 File "[native code]" line (unknown) in dispatchEvent 5 File "webpack:///./node_modules/leaflet/dist/leaflet-src.js" line 13638 col 1 in _simulateEvent e.target.dispatchEvent(simulatedEvent); 6 File "webpack:///./node_modules/leaflet/dist/leaflet-src.js" line 13582 col 1 in _onDown this._simulateEvent('mousedown', first); 7 File "webpack:///./node_modules/logrocket/dist/build.umd.js" line 1679 col 1 in r return func.apply(this, args);

Which indicates that this._icon is null for a middle marker. I wonder if it could have anything to do with this change to the createVertexIcon function?

Aarbel commented 4 years ago

@tjmcewan same issue here, have you found a way to fix it ?

tjmcewan commented 4 years ago

no, sorry.

On Fri, 28 Feb 2020 at 08:49, Clement Fradet Normand < notifications@github.com> wrote:

@tjmcewan https://github.com/tjmcewan same issue here, have you found a way to fix it ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Leaflet/Leaflet.Editable/issues/179?email_source=notifications&email_token=AAA2GLAWKGXRK6QK7GDN4YLRFAYOPA5CNFSM4GD7QYFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENGCUMY#issuecomment-592194099, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2GLHENH5CMT7AWO4ZN73RFAYOPANCNFSM4GD7QYFA .

Aarbel commented 4 years ago

I fixed it.

I was removing elements of leaflet fullscreen options with css. So i removed all options related to fullscreen also in javascript and all worked great.

I think when you set a display: none on some elements, leaflet has some trouble finding them.