Leaflet.draw
Leaflet.draw copied to clipboard
allow multiple shapes of the same type
I'd like to second this request.
I'm working on a project where we'd like users to sketch out their journey's using the Leaftlet.Draw package for each method of transport (walk, cycle, cat etc). For each journey type all that is required is the polyline tool, hence the requirement for multiple instances.
At the moment, as a total hack, created the files Draw.Bicycle.js, Draw.Walk.js (and so on), each of which is essentially identical to the polyline code, but with the "Type" altered.
This would be a really nice fix to have. Juggling options objects around every time I want to change the color is a complete pain. It looks like the root of the issue is that the options are stored in the object prototype instead of in the object instances. Stashing all of the configuration data inside each instance would certainly clear this up.
+1
I'd like to revisit this, @escaped @mikepost
Alas, I'm no longer using leaflet.draw in projects. My current needs are less interactive.
Thanks, uh, @ZebraFlesh ... I'll look at the original code and see if it fits into our near-future.
I have more or less the same needs. I am developing an app for search and rescue teams and need to draw in the map the search areas for each team. To mark the difference best would be to have different colors, all in one leaflet draw control. For instance, clicking on the symbol (e.g. polygone), then a submenu appears to select the color and then the polygone can be drawn as normal. Can someone help to realize this? Thank you very much in advance.