technologiestiftung/giessdenkiez-de

Link to special OSM editor to update pump status

tordans opened this issue · 9 comments

We build a special MapComplete Theme that allows to view and edit the OSM date of Berliner Straßenbrunnen in an easy/easier way.

It would be great if we could link this editor from the Straßenpumpen Infopanel:

image

I wanted to contribute a PR but now I see that the info panel is on hover, so it's not just adding a link in the panel.

Please let me know if this feature is a good fit for the project / would be accepted.
And your thoughts on how to add it.

My first take is, to add an info text inside the hover info panel saying "Double click the Straßenbrunnen-Circle to open a special OpenStreetMap editor and update the Pump status and check data."

What do you think?

Hey @tordans Thank you for your editor. We will discuss internally how to handle this.

Hi @tordans! Great editor! This will make it way easier for people to contribute to better pump information! Thx a lot!

I created a PR #461 based on your comment but with a slightly different UX. Instead of double clicking (Which is IMHO not very intuitive), the tooltip can be stuck by clicking once on a pump. This way the new link "Edit this OSM info" in the tooltip can be reached.

Let me know what you think! :)

Screen.Recording.2022-06-23.at.17.08.12.mov

@vogelino thanks, this looks great!

I have two comments:

Link

const OSM_PUMP_EDITOR_URL = https://mapcomplete.osm.be/theme?z=14&lat=52.51486&lon=13.44662&userlayout=https%3A%2F%2Ftordans.github.io%2FMapComplete-ThemeHelper%2FOSM-Berlin-Themes%2Fman_made-walter_well-status-checker%2Ftheme.json&language=de#node`;`

https://github.com/technologiestiftung/giessdenkiez-de/pull/461/files#diff-de388be53c7c138eee97b7cc7868b884d8b1cbe605ca474388d8f5d426caef81R33

The URL has the lat/lon/zoom hard coded which will make the map jump and reload data AFAIK.

Do you have access to the those map props inside the panel? We could then do something like…

const mapCompleteURL = ({lat, lon, zoom, nodeId}) => {
  const mapcompleteUrl ='https://mapcomplete.osm.be/theme'
  const params = new URLSearchParams()
  params.set('userlayout', 'https://tordans.github.io/MapComplete-ThemeHelper/OSM-Berlin-Themes/man_made-walter_well-status-checker/theme.json')
  params.set('lat', lat)
  params.set('lon', lon)
  params.set('z', zoom)
  params.set('language', 'de')
  const selectedPump = `#node/${nodeId}`
  return `${mapcompleteUrl}?${params.toString()}${selectedPump}
}

Wording

OpenStreetMap PumpenInfos bearbeiten

https://github.com/technologiestiftung/giessdenkiez-de/pull/461/files#diff-de388be53c7c138eee97b7cc7868b884d8b1cbe605ca474388d8f5d426caef81R736

I think we can focus this a bit more on the operational status of the pump, since this theme will only allow editing those fields to keep it simple.

How about

Status in OpenStreetMap aktualisieren

or

Status und check in OpenStreetMap aktualisieren


Ping @SupaplexOSM FYI

@tordans thx for your feedback. These are very good points.

I think we do have those coordinates at this point and we should be able to encode them into the url as suggested.

I also agree with your wording feedback and I root for the first suggestion. @Esshahn what do you think?

I will take care of it next week but feel free to do a PR against staging if you wish us to accelerate the process.

Have a nice weekend!

Hi @tordans. I changed the wording and ported your URL function to our code. However, wenn encoding the latitude and longitude into the URL, the OSM page doesn't load the pumps initially when opened via link but does when entered in the browser search bar. I cannot figure out why this happens. When omitting the lat/lng/zoom, the page loads correctly when opened by zoom. Any idea why this happens?

PS: This PR #466 includes the changes

I tested with https://mapcomplete.osm.be/theme.html?userlayout=https%3A%2F%2Ftordans.github.io%2FMapComplete-ThemeHelper%2FOSM-Berlin-Themes%2Fman_made-walter_well-status-checker%2Ftheme.json&language=de#node/5907103888 and it looks like, the lat/lng is not needed at all. I think MapComplete does a lookup of the node first (or early on during render) and then moves the map to this lat/lng right away.
So it look like this is all we need, right (AKA the PR is fine this way)? — I might be missing something …

PS: Is the staging URL public so I could test it there (later)?

Cool! I see it the same way. Yes the PR is fine. Here is the URL: https://deploy-preview-462--giessdenkiez.netlify.app/

FYI, I just twittered about this https://twitter.com/osmberlin/status/1546020018856534016.

And this OSMCha list shows all edits made with the editor. RSS