GoMap
GoMap copied to clipboard
Add a Opening Hours editor
If you press the > button next to hours, a opening hours screen should pop up. I propose that it should look something like MAPS.ME’s Opening Hours editor, not like YoHours.
In order to be able to do that, we need a parser for the opening_hours
tag.
Maybe we could utilize existing code, e. g. opening-hours/opening_hours.js.
@bryceco, is this something one could go ahead with, or do you have a different idea?
Editor from maps.me
Here is a screenshot of the maps.me editor for opening hours, in case someone does not have the app installed:
Editor from StreetComplete
Here's a screenshot from the editor in StreetComplete:
@wtimme it seems like a 3rd party parser is the way to go, even though I’m not excited about embedding JS in the app. If you’d like to work on this that would be great. It’s definitely a nice feature to have, but looks like a lot of effort required.
I did some research, and it looks as if opening_hours.js is meant to be used to check whether a place is open at any given date/date range. What we would probably need, however, is a way of converting the tag value (e. g. "Mo-Fr 10:00-12:00") into a set of rules, for which we would then build the UI.
Progress?
Sorry in advance for being a newbie, and thanks for this great work y’all have been doing!!
I just installed on iOS. What’s the status on this? I’m confused because while my edit via GoMap remains in place there, it didn’t get added to my OSM Edit History (nor anywhere else).
I went ahead and edited it via a different interface ( not GoMap — I think I used OrganicMaps), and it then showed up on my OSM profile.
The below screenshot is of GoMap.
EDIT: Wait, now there’s an Upload button which I don’t think was there before.
Could this be due to previously limited EditPermissions (given I’m a new editor on OSM), and someone just granted me more access ?
Goodness. Maybe adding a “Tutorial” link to the README etc for brand-new wet-behind-the-ears folks would help what to expect etc <3
@jwmh The upload button appears only when you have made edits. People will typically make multiple related edits before performing a single upload.
Could this be due to previously limited EditPermissions (given I’m a new editor on OSM)
As a sidenote, not related to this issue: There are no limited permissions for new editors in OSM. Everyone can edit everything from the get-go.
Alternatively, add a parser for the hours format so you can warn users when they add a bad one.
If I type in a value for opening hours that is not in the correct format https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification the parser would color the text red. It would be even better if it had good error messages like "unknown day name "Ma". Did you mean "Mo"?" or whatever
I started work on a parser and editor at https://github.com/bryceco/OpeningHours/ It isn't complete enough as an editor (I used SwiftUI and ran into too many issues I couldn't fix), but it would work fine for verifying syntax.