Preheat oven to 350° F and spray a casserole dish with cooking spray.
Arrange the sweet potato slices in the casserole dish.
To a medium saucepan add the maple syrup, butter, brown sugar, water, vanilla extract, cinnamon, nutmeg and salt.
Cook over medium heat, stirring frequently until butter is melted. Without stirring, bring mixture to a boil and cook for 1 minute. Turn off the heat.
Pour the maple sauce over the potato slices in the casserole dish.
Bake at 350° F for 50-60 minutes, giving the potatoes a stir 2-3 times during baking. Halfway through baking, cover with aluminum foil to help the potatoes bake more evenly.
If adding the optional marshmallows, remove the foil and carefully add the marshmallows in a layer and continue baking until they are golden and a little puffed.
When done, remove from the oven, garnish with rosemary and chopped candied pecans, give it a final gentle stir and cool on a wire rack for 10 minutes before serving.