{"action":"created","issue":{"url":"https://api.github.com/repos/yohanboniface/Leaflet.Editable/issues/13","labels_url":"https://api.github.com/repos/yohanboniface/Leaflet.Editable/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/yohanboniface/Leaflet.Editable/issues/13/comments","events_url":"https://api.github.com/repos/yohanboniface/Leaflet.Editable/issues/13/events","html_url":"https://github.com/yohanboniface/Leaflet.Editable/issues/13","id":56957509,"number":13,"title":"Simple line support","user":{"login":"joaoponceleao","id":6002614,"avatar_url":"https://avatars.githubusercontent.com/u/6002614?v=3","gravatar_id":"","url":"https://api.github.com/users/joaoponceleao","html_url":"https://github.com/joaoponceleao","followers_url":"https://api.github.com/users/joaoponceleao/followers","following_url":"https://api.github.com/users/joaoponceleao/following{/other_user}","gists_url":"https://api.github.com/users/joaoponceleao/gists{/gist_id}","starred_url":"https://api.github.com/users/joaoponceleao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaoponceleao/subscriptions","organizations_url":"https://api.github.com/users/joaoponceleao/orgs","repos_url":"https://api.github.com/users/joaoponceleao/repos","events_url":"https://api.github.com/users/joaoponceleao/events{/privacy}","received_events_url":"https://api.github.com/users/joaoponceleao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-08T16:35:45Z","updated_at":"2015-02-10T13:40:14Z","closed_at":null,"body":"Hi,\r\nI'm trying to use L.Editable (Leaflet 1.0 branch) to create lines (i.e. a geojson polyline with exactly 2 vertices - I'm surprised that geojson does not support lines...). I need this for network analysis, where lines have to be straight and contain only two vertices, but I'm sure others might have other uses for this as well.\r\n\r\nI have adapted the tooltips example to achieve this by calling `map.editTools.stopDrawing()` when `e.layer.editor._drawnLatLngs.length` gives me the desired max number of vertices. But I've encountered two problems:\r\n\r\n1. If I call `stopDrawing` when the `_drawnLatLngs.length == 1` (i.e. 2 vertices), the line does not get created (the last vertex seems to get removed). If I call it when the length == 2, the line gets created but the user is forced to click twice. Once for the last vertex, and then again to commit. After drawing the last vertex and before committing the line, the usual temporary dashed line is visible, which makes it look like you are continuing the line and is misleading. I would like to reduce the line creation to just 2 clicks, or remove the dashed line after the second click.\r\n\r\n2. A more serious problem is what happens after a line is created. The user should have the option to edit the line by moving its vertices. This works well. However, a midpoint vertex is always displayed. If the user drags it, they will add a new vertex, turning it into a polyline. Is there a way to disable this?\r\n\r\nThanks for the library! Any help is appreciated.\r\n\r\nJoao"},"comment":{"url":"https://api.github.com/repos/yohanboniface/Leaflet.Editable/issues/comments/73700081","html_url":"https://github.com/yohanboniface/Leaflet.Editable/issues/13#issuecomment-73700081","issue_url":"https://api.github.com/repos/yohanboniface/Leaflet.Editable/issues/13","id":73700081,"user":{"login":"joaoponceleao","id":6002614,"avatar_url":"https://avatars.githubusercontent.com/u/6002614?v=3","gravatar_id":"","url":"https://api.github.com/users/joaoponceleao","html_url":"https://github.com/joaoponceleao","followers_url":"https://api.github.com/users/joaoponceleao/followers","following_url":"https://api.github.com/users/joaoponceleao/following{/other_user}","gists_url":"https://api.github.com/users/joaoponceleao/gists{/gist_id}","starred_url":"https://api.github.com/users/joaoponceleao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaoponceleao/subscriptions","organizations_url":"https://api.github.com/users/joaoponceleao/orgs","repos_url":"https://api.github.com/users/joaoponceleao/repos","events_url":"https://api.github.com/users/joaoponceleao/events{/privacy}","received_events_url":"https://api.github.com/users/joaoponceleao/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T13:40:14Z","updated_at":"2015-02-10T13:40:14Z","body":"For 1. Yes, I was using the `click` event. That was the problem. Oops.\r\nFor 2. Thanks, thats exactly what I was looking for! Don't understand how I missed it in the docs!\r\n\r\nMinor issue (hopefully its not my fault again). Whilst `skipMiddleMarkers` works perfectly, hiding and disabling the marker, the cursor still changes when hovering over the midpoint, as if a marker existed."}}