I am looking for a method to vary the map scale of a QGIS layout according to the visibility of a layer.
The output should show the minimum scale at which the layer can be seen in the layout from a range of predefined scales (e.g. 1:1000, 1:2500 etc.).
I would like the method to work with the QGIS Atlas so that the output can be exported efficiently.
As an example, the images below show the layout at 1:1000 (site boundary only), 1:2500 (site boundary and surface water) and 1:5000 (site boundary and surface water). I would like the layout scale to automatically adjust depending on the minimum scale at which surface water can be seen from a range of predefined scales. So in this case, produce a layout at 1:2500 and not 1:1000 or 1:5000.