Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finishing with meta / ctrl leaves editor in non-functional state in continue-line.html #56

Closed
hyperknot opened this issue Jan 25, 2016 · 2 comments

Comments

@hyperknot
Copy link
Contributor

Steps to reproduce:

  1. Open continue-line.html
  2. Extend any line by meta / ctrl clicking on an end vertex.
  3. Finish the line, by meta / crtrl clicking on the last vertex.

Editor goes into a weird state:

  • drawing mode active
  • clicking anywhere throws an
Uncaught TypeError: Cannot read property 'unshift' of undefined

from this line:

addLatLng: function (latlng) {
            if (this._drawing === L.Editable.FORWARD) this._drawnLatLngs.push(latlng);
            else this._drawnLatLngs.unshift(latlng);     <-----
            this.feature._bounds.extend(latlng);
            this.addVertexMarker(latlng, this._drawnLatLngs);
            this.refresh();
        },

Event log:

editable:vertex:mousedown
editable:vertex:click
editable:vertex:metakeyclick
editable:drawing:cancel
editable:drawing:end
editable:drawing:start
editable:vertex:clicked
editable:drawing:move
editable:drawing:mousedown
editable:drawing:click
Leaflet.Editable.js:917 Uncaught TypeError: Cannot read property 'unshift' of undefinedL.Editable.PathEditor.L.Editable.BaseEditor.extend.addLatLng @ Leaflet.Editable.js:917L.Editable.PathEditor.L.Editable.BaseEditor.extend.newPointBackward @ Leaflet.Editable.js:932L.Editable.PathEditor.L.Editable.BaseEditor.extend.processDrawingClick @ Leaflet.Editable.js:961L.Editable.BaseEditor.L.Class.extend.onDrawingClick @ Leaflet.Editable.js:690L.Editable.L.Evented.extend.onMouseup @ Leaflet.Editable.js:171o.Evented.o.Class.extend.fire @ leaflet.js:5o.Map.o.Evented.extend._fireDOMEvent @ leaflet.js:5o.Map.o.Evented.extend._handleDOMEvent @ leaflet.js:5h @ leaflet.js:7
editable:drawing:move
@yohanboniface
Copy link
Member

Sorry @hyperknot missed this issue :(
Github notifications is a mess :/

@hyperknot
Copy link
Contributor Author

@yohanboniface thanks, works perfectly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants