Select to view content in your preferred language

Hide Map Layer Transparency Buttons At 100% or 0% Transparency

102
0
3 weeks ago
Status: Open
JeffreyThompson2
MVP Regular Contributor

It's a small UX thing, but it's pretty annoying. The Increase/Decrease Transparency Buttons in the Map Layers Widget should hide or disable themselves if the layer is at 100% or 0% transparency. It is very easy for a user to get confused an click the wrong one and not know why the layer isn't changing. (Can you guess why I am posting this idea now?)

JeffreyThompson2_0-1720728232416.png

Also, I was looking through the code of the Map Layers Widget and there doesn't appear to be any validation to prevent negative values or values greater than 1. Is this validation handled in the definition of the Layer Class? If not, validation should be added to the code.

  execute = (layerItem): void => {
    if (this.isIncreaseOpacity) {
      if (layerItem.layer.opacity < 1) {
        layerItem.layer.opacity += 0.25
      }
    } else {
      if (layerItem.layer.opacity > 0) {
        layerItem.layer.opacity -= 0.25
      }
    }
  }