Reactivating measurement widget

Discussion created by nonpoint1989 on Jun 6, 2013
Recently I have been working on a web page that adds a location with a mouse driven event. However they also want to add the measurement widget. I have figured out how to stop the one click event However I am not sure what the best ways to stop and reactivate the measurement widget are. Below I have figured out how to do most of the switching with buttons. However the destroy method for measurement seems to cause issues when I want to start it up again.

I think this is all that should be necessary for an example of what I am trying to accomplish. but if more is necessary please let me know

<button id="measure"  style=" margin-left:20px " onClick="handle.pause(); measurement.startup();; console.log('measure');">Measure</button>
   <button id="stopmeasure" style=" margin-left:10px " onClick="handle.resume(); measurement.destroy(); measurement.hide(); console.log('stop measuring');">Stop Measuring</button>