Measurement in 2D sample - Disable the Info window and configure utilized units in code ?

09-05-2023 11:22 PM
New Contributor

Using the DistanceMeasurement2D and AreaMeasurement2D widgets, as represented in the "Measurement in 2D" sample (at, is it possible to configure the widgets to disable the display of the info window, and hard code the unit of measurement used by the respective widgets?
Version 3.x of the ArcGIS JavaScript API allowed this, as discussed here :
... However the available properties and methods for the DistanceMeasurement2D and AreaMeasurement2D widgets, at Javascript 4.x, apparently do not. Please let me know if you are aware of how this may be done.

Thanks for any advice on this ...

0 Kudos
2 Replies
Occasional Contributor II

@AllisonRobertson Did you try popupEnabled: false with the MapView to disable the popup? MeasurementViewModel has view property that can give you MapView instance.

0 Kudos
New Contributor

Hi @BhavinSanghani 
Thank-you very much for your reply.
I tried adding popupEnabled: false to the MapView constructor, but that did not cause a change in behaviour ie. the popup still shows at runtime when using the measurement2D tool, when the view has the following constructor code

       const view = new MapView({
              container: "viewDiv",
              map: map,
              center: [144.95, -37.8],
              zoom: 10,
              popupEnabled: false
I also (optimistically) tried adding it to the function that runs once the view is loaded (included below), however this also appears to have no affect at runtime.
       view.when(function() {
          view.popupEnabled = false;    
Any further advice on this topic greatly appreciated, as I would have thought the subject functionality should be possible 🙂
Thanks again,
0 Kudos