Hi, I'm having a problem with the DistanceMeasurement2D widget.
when I switch my map from 2d to 3d my previous measurement graphics disappear and I still have the widget popup
without the option to draw a new measurement.
how to I keep my graphics and represent them when switching back to 2d map?
thank you.
Hi @EliyahoLevi
Have you looked into this sample which shows how to use Measurement widget and switch between 2D and 3D?
But note that DistanceMeasurement2D (for 2D) and DirectLineMeasurement3D (for 3D) are separate widgets and work slightly differently, e.g. the latter only allows measuring between 2 points whereas with the former you can measure a polyline with multiple vertices. Therefore it is not really possible to keep the graphcis after switching.
But it does look weird on your screenshot that the popup stays (in the sample it doesn't happen). Do you have a sample app/codepen you could share?
thank you for the replay,
after research i put the graphics from the measurement2D widget into my own graphic layer and disabled the widget, and it worked out fine.
i did look at the sample, and realize that this is the proper way to do it , so i did it as the sample show, and saved the graphics from the measurement widget for future use.