makinacorpus / Leaflet.MeasureControl

Leaflet control to mesure distances on the map
https://makinacorpus.github.io/Leaflet.MeasureControl
BSD 3-Clause "New" or "Revised" License
82 stars 48 forks source link

Using w/ Draw Toolbar, Measure Won't turn off #14

Open Nick-t-go opened 8 years ago

Nick-t-go commented 8 years ago

I am using the measure control on the same map with the draw controls. Once activated it won't turn off? How do I ensure the tool turns off after a line has been drawn?

fredericbonifas commented 8 years ago

Hello @Nick-t-go I do not understand what the problem is: what do you mean by "turning off the tool"?

Thanks

BetterOffDev commented 8 years ago

I've run into a similar issue and I think I know what he's referring to. Here's the scenario...

When you click the measure tool button, it puts you in "measure mode", essentially. But if you click one of the other drawing tools, you're still in "measure mode" and can see the "Click to start drawing new line" help text in the background of your drawing tool help text. You have to manually click the measure button again to turn off "measure mode".

I'm actually working on a fix for this now. I've already edited the plugin so it displays a "Done" popout button, similar to the drawing tools (Save/Cancel). I have that working now but ideally, the measure tool should be included within the drawing tools section so it can automatically toggle when the user clicks a different drawing tool. Otherwise a custom callback function needs to be added to the measure tool to toggle when clicking on a different draw tool and vice versa.

jekuno commented 7 years ago

Any news on this?