You can control the areas to be visible by changing to false under the configs/measurement
Can I kindly ask to you elaborate? This is what the config.json file looks like for my Measure widget.
Is it a custom widget? What version of WAB are you using?
The measurement widget in WAB has this config.json
{
"measurement": {
"defaultAreaUnit": "esriAcres",
"defaultLengthUnit": "esriMiles"
},
"showArea": true,
"showDistance": true,
"showLocation": true,
"defaultAreaUnit": "esriSquareMiles",
"defaultLengthUnit": "esriMiles",
"isOperationalLayer": false
}
By adding the in the config file with no action in js, it wont do anything. You will need to add the action under the postCreate function to read the setting in the config like:
initialstate= this.config.showDistance
Then, disable or enable the visibility of the "show distance measurement" div depending on the initial state value. However, if the toggle button is in the same div as the "show distance measurement" , and the div is not enabled, you will not be able to click on it and enable it on later. The button needs to be outside. Hope it makes sense.