Hello.
Added DirectLineMeasurement3D widget in to sceneview.
I have a toggle widget button. And button code below
mySceneview.ui.remove(measureWidget);
This is removing widget from sceneview but drawings stays on screen. I can't clear all graphics because of sceneview has another graphics.
How can i remove graphics which created by a widget when widget being closed?
Thanks inadvance
Solved! Go to Solution.
Tuba,
Then you need to destroy the widget as well:
measureWidget.clearMeasurement();
view.ui.remove(measureWidget);
measureWidget.destroy();
For your second question look here:
Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.
If u use graphicslayer. is graphicslayer.clear();
if u use map.graphics is map.graphics.clear();
if u use layers, map.removeAllLayers() for all of them or removeLayer(urLayer) to remove the desired layers that u added in the map.
I hope this helps.
Tuba,
It has not been documented but there is a clearMeasurement method.
measureWidget.clearMeasurement();
Thanks for the answer.
yes widget.clearMeasurement is solved problem.
But
Mouse cursor still displaying as "plus" figure (as if widget is opened) and still continuing drawing measure graphic even after close and clear widget.
And another question,
Can we get a list for added widgets?
Thanks inadvance
Tuba,
Then you need to destroy the widget as well:
measureWidget.clearMeasurement();
view.ui.remove(measureWidget);
measureWidget.destroy();
For your second question look here:
Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.
Thanks Robert, your answer has been really helpful.