Leaflet / Leaflet.Editable

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

Fix error if using shapeAt within line boundaries but outside of tolerance #174

Open ghost opened 6 years ago

ghost commented 6 years ago

The delete-shape example has been updated to show the error.

To recreate, remove the fix in Leaflet.Editable.js and then ctrl+click within the rectangular bounds of a line but outside of the click tolerance area.

Error would then be:

Leaflet.Editable.js:1825 Uncaught TypeError: Cannot read property 'length' of undefined
    at e.isInLatLngs (Leaflet.Editable.js:1825)
    at e.shapeAt (Leaflet.Editable.js:1811)
    at delete-shape.html:89

leaflet _projectLatlngs method expects that the latlngs supplied are only ever an array, not a LatLng object.