Leaflet.draw icon indicating copy to clipboard operation
Leaflet.draw copied to clipboard

allow multiple shapes of the same type

Open escaped opened this issue 12 years ago • 7 comments

escaped avatar Mar 27 '13 14:03 escaped

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.

ColinWaddell avatar May 14 '13 12:05 ColinWaddell

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.

mikepost avatar Jan 10 '14 18:01 mikepost

+1

alexandre-melard avatar Feb 05 '14 05:02 alexandre-melard

I'd like to revisit this, @escaped @mikepost

ddproxy avatar Mar 07 '16 02:03 ddproxy

Alas, I'm no longer using leaflet.draw in projects. My current needs are less interactive.

ZebraFlesh avatar Mar 07 '16 14:03 ZebraFlesh

Thanks, uh, @ZebraFlesh ... I'll look at the original code and see if it fits into our near-future.

ddproxy avatar Mar 07 '16 18:03 ddproxy

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.

sjo178 avatar Nov 23 '20 13:11 sjo178