Why adding an extra `if` here ? The original `{% set mapWidth = parameters.width|default( defaultWidth ) %}` was sufficient.