Every municipality shall have power to regulate the use of sidewalks, streets, alleys, wharves, parks, and public grounds, to provide for cleaning the same, to prevent and remove obstructions and encroachments upon the same, to prevent injury to the same, to regulate or prevent any practice having a tendency to annoy persons frequenting the same, and to regulate or prohibit structures under sidewalks and riding and driving thereon.
SDCL 9-30-2