Kamakura, a coastal city in Kanagawa Prefecture south of Tokyo, is calling on tourists to refrain from eating while walking in crowded places in the city.
More than 20 million tourists visit Kamakura every year.
The ordinance for better etiquette took effect on Monday in response to frequent complaints from residents about ill-mannered sightseers.
On Wednesday, many tourists with soft ice creams, sweets and other foods in their hands were seen walking along Komachi Street, where many souvenir shops, restaurants and food stalls are located.
Visitors showed mix reactions when asked what they thought about the new ordinance.
A high school boy said he will try not to eat while walking, now that he learned of the ordinance. But he also said eating is a pleasure and should not be chided about by other people.
A woman in her 70s expressed her support for the ordinance. She said eating while walking looks bad and it would be a nuisance if anyone who ate while walking stained somebody else's clothing.
The owner of a roughly 100-year-old traditional Japanese sweets store said one aspect of sightseeing in Kamakura is eating and tasting local items, and suggested that visitors would probably enjoy them in a leisurely manner if there was no ordinance.
Norikazu Takahashi, the head of the Komachi merchants' association, cited the nuisance of some people littering, and said he wants tourists to enjoy at ease by having good manners.
The new ordinance urges tourists to refrain from entering railway tracks to pose for photos, which has been a common scene in recent years in Kamakura, where nostalgic trains of Enoshima Electric Railway, also known as Enoden, run.
On Wednesday, some foreign tourists were seen taking pictures on streets and tracks at a railroad crossing near Kamakura Koko Mae Station, which is known as the stage of a popular Japanese comic, Slam Dunk. Somebody even flew a drone there.
Tadashi Hirokawa, the chief of Kamakura City's tourism section, said the ordinance is not meant to ban or regulate, but he said he hopes it will help everyone adopt appropriate manners and have a good time.