It will work, but there is a caveat..
One of those little solar panels will work, but if your switch box has a light built into the switch(as mine does)that light will draw as much, or more, as it seemed in my case, than the solar panel will provide. It actually drained my battery over a 2 week period that I was too busy to come by and attend to "my baby". When I figured out the problem I disabled the light for that switch and After the first season, I ran the wires to the direct line in that I had for my power inverter. It's only a little boat, and the power needs are very few in most cases, so I charge the battery in the normal manner at the start of the season and then at the end for winter storage and leave the solar panel up after a hop that we used an appreciable amount of battery power.