Better-osm-org: a script that adds useful little things to osm.org

tldr; it’s hard, but I think about it and gradually delve into the website code.

  1. The site is written in Ruby + JavaScript, I don’t know Ruby, and some features should be implemented on the server side.

  2. Slow development speed. I don’t fully understand the structure of openstreetmap-website, but in my current environment (macOS + Docker) I have to wait for the JavaSctipt bundle to be built and the container to restart. To change the userscript, I just need to reload the tab in the browser.

  3. A very long discussion about PR. I’m too lazy to convince current maintainers of the changes I would like to see. You will not get links to external sites add link to open view in OSMCha, from changesets history pge · Issue #2629 · openstreetmap/openstreetmap-website · GitHub, you will not get vector tiles until they are perfect Add OpenMapTiles vector map by zdila · Pull Request #4042 · openstreetmap/openstreetmap-website · GitHub but at the same time, map dimming was easily turned on, which affected all users of the site ¯\_(ツ)_/¯ . How long do you think we’ll be discussing expert toggle? (: What should the visualization of changesets look like? (It’s worth writing an article, this is an interesting and complex question)

  4. A way to show PoC. It’s one thing to start an issue and convince people that things will get better, and another to show a working prototype. osm.ng is already inspired Tags diff mode · Issue #16 · openstreetmap-ng/openstreetmap-ng · GitHub (osm.ng in general, one big prototype of what it could be osm.org)

  5. I have two Pull Requests into the website that I hope to complete and open up interesting opportunities. Let’s see if I can handle hours of code reading and debugging :melting_face:

16 Likes

I fully understand your disillusionment, I too have shied away from writing code to contribute. If it took me over a month and multiple reviews just to get 20 lines of code merged to remove the carelessly implemented map dimming, I don’t see any reasonable possibility to get this plugin in there.

But the great thing about OSM is that it’s already a conglomerate of different projects, and features can grow even if others aren’t interested.

4 Likes

:zap: Faster rendering

My first PR was merged to openstreetmap-website code, and now the Map Data layer loads instantly. Be sure to try it. Thanks to the maintainers for help!

For the script, this means a huge acceleration in rendering large relations and GPS tracks (yes, tracks, read more!):

better0.8-speed

icon :busts_in_silhouette: near relations is clickable :wink:

:camera_flash: Photos from Panoramax, StreetComplete, Wikipedia Commons

Now they are displayed directly on the website. In notes, in tag history, and in changesets.

:man_running: Rendering of GPS tracks

Finally, by opening the starting coordinate of the track, you will be able to see the entire GPX track on the map:

better0.8-track

Let me remind you that the Z key allows you to fit an object on the screen.

The track is also drawn when opening notes from StreetComplete

The rendering of tracks is still very simple, if you have any examples of successful visualizations, please share them.

:speech_balloon: Comments on changesets

Now you don’t have to open the changesets to understand if there is an interesting discussion or if this is another revert of vandalism.

by the way, long links like *.openstreetmap.org replaced by *.osm.org

:people_hugging: Edits of friends

Did you know that OSM has a friends feature? You can even follow their edits here: osm.org/history/friends

better-osm-org can now filter changesets on this page. The script also tries to show around the username that it’s your friend.

Let’s be friends :slight_smile: osm.org/user/TrickyFoxy/follow

:artificial_satellite: Satellite image Switch (Firefox only)

Satellite images could be switched using the S key, or using the button on the side of the note.
But what about Firefox for Android? And how do I find out about S? Now there is a button in the right panel for this.

better0.8-satellite-switch

Pressing the Shift key will show you the ESRI Beta images. But be patient, because they take longer to load.

:page_facing_up: Experimental viewer for geotagged photos, .gpx and .geojson files

If we can now quickly render data, then why not be able to open it from files? Just drag them onto the map:

better0.8-drag-and-drop

p.s. for now, it’s more of a PoC, feel free to suggest your ideas.

:keyboard: Hotkeys

Where without them? :slight_smile:

  • ` — hide the geometry of the changeset from the map
  • T — toggle between compact and full tags diff mode
  • F — filter changesets
  • Hotkeys on user profile Page (H — user changesets history, T — tracks, D — Diary, C — comments, N — notes)
  • U — open user profile from changeset, note, …
  • Shift + U — open your profile

By the way, do you know about the new feature of the site? osm.org/user/SomeoneElse/changeset_comments


update link

18 Likes

Thanks for the update. What is “http: // localhost:3000” used for?
grafik

localhost:3000 is the address of osm-website if you run it locally

2 Likes

This is the default port for the local instance of openstreetmap-website: openstreetmap-website/INSTALL.md at master · openstreetmap/openstreetmap-website · GitHub

It seems that this feature is only used by me, so I will disable it. Moreover, I can override @includes in Tampermonkey

upd: deleted it

2 Likes

A fun-fact that was written to me in the comments: recently, there are no more friends in OSM (: Now it’s Followings. Only the mention in the URL remains.

2 Likes

Hi,
dragging the red/green routing markers onto the map does not work for me since the update.
When I de-activate tampermonkey it’s working.
grafik

upd: fixed in 0.8.1

oops, I’ll try to fix it soon. For now, you can disable the option in the script settings: “Drag&Drop for .geojson, .jpg, .gpx”

p.s. Duplicate photos from Wikimedia Commons will also be fixed

Congratulations! And thanks so much. Data layer being slow was annoying for a long time.

2 Likes

@chris66 Never knew you could, yes the drag/drop of the pins does not work in me firefox either.

(always have right clicked on the departure/arrival spots and choose from the pop up menu… somehow feels like less mouse mileage)

image

edit: ones the pins are on the map you can drag them around to play/test different departure/arrival points.

edit2: Once the pins are on the map, the dragging from the left top routing frame to the map does work… most odd.

Even at 0.8.1? Or is the dragging not working without the script on?

Probably I was one of the first to pull in 0.8.1:O)… yes this is Thé release. I verified the BOO switch on TamperMonkey is green in the dashboard. Left bar has all the bells, the map tested both with geometry function on and off.

Thanks, in 0.8.1 it’s solved. :+1:

Wow, thanks for displaying the photos in StreetsComplete Notes, very usefull. :+1:

9 Likes

I think I’ve invented a new practice of versioning software: StarVer: the version number is proportional to the number of stars on GitHub (:

better-osm-org v.0.9 (90 :star:)

:artificial_satellite: Satellite images are now available in Chrome!

p.s. unfortunately, Leaflet will sometimes show you gray tiles when you zoom in too closely. There is no good solution yet, but you can enable the “Allow overzoom…” checkbox in the script settings at your own risk.

Preview for photos from Mapillary

In addition, when you hover over the photo, the location of the photo taken from Mapillary and Panoramax is shown.

:label: Tags highlighting

:mantelpiece_clock: Open a snapshot of Overpass map when you click on <time>

Click on the <time> HTML element with CTRL, or just click on the item to see the button :mantelpiece_clock:. Previously, this only worked for note pages.

:speech_balloon: Displays the number of comments to changesets on the map item page

p.s. In Firefox, in about:config, you can change ui.tooltip.delay_ms to reduce the delay before the tooltip appears.

New experiments :man_scientist:

View multiple changesets on a single page

Have you met newbies who draw one house per changeset? Now you can see all their edits on the same page (click :mag: on the user’s changesets page)

J key to open objects from changeset in JOSM

Have you ever encountered a situation where a newbie made a bunch of strange tags like name=House? You don’t want to revert it completely, but you need to delete the tags. Now you can press J and all the objects from the changeset will open in JOSM.

p.s. Or in Level0 if you press ALT + J.

:mag: Search with Overpass

Press SHIFT + / and enter the type of places you want to see on the map.

So far, this works as a string substitution, but it gives you the flexibility to search for objects on the map.

p.s. use alt + click for hide any object

:pencil2: And edit them!

By clicking on item, you can see buttons for editing the item’s tags.

p.s. By the way, now you can use Drag&Drop to open .osm files

Other

  • Displays the number of changesets made by the user iD:

  • When you create a note, you can now create an node at once, rather than a note.

So far, you can only insert a list of tags. If something goes wrong, you can delete the new node, or edit it using GitHub - Zverik/osmtags-editor: An extension that adds an "edit tags" button to every object on osm.org


NB: After the update, don’t forget to reload tabs with OSM, and in the case of Google Chrome, the entire browser is better (: If you see problems when opening changesets, the Send Bug Report button should appear at the bottom of the sidebar.

p.s. When will .mp4 support appear on the forum? :pray:

13 Likes
  • What do you use?
  • Firefox + Tampermonkey
  • Firefox + Violentmonkey
  • Chromium-based + Tampermonkey
  • Chromium-based + Violentmonkey
  • Firefox for Android + *monkey
  • View results
0 voters

Something went wrong with the poll, “View results” and “What do you use?” are poll options :0

2 Likes

Ha, I thought it was a poll title:) But unfortunately, I can only edit the poll for 5 minutes.

upd: the issue should be resolved in 0.9.1

For some reason, in my Chrome on macOS, the script sometimes does not show objects on the map. In Firefox, this occurs only after updating the script, and in this situation it is enough to reload the tab. And in Chrome, sometimes even restarting the browser doesn’t help.

Sometimes I notice that this happens when I’m logged out of OSM and logging in helps (what? yes). The map display also starts working if you just open the browser console.

Does anyone experience this? Or do I have a specific developer environment?


p.s. just in case, a link to the previous version 0.8.1, if something goes wrong