Enriching OpenStreetMap.org website with Tempermonkey
โพสต์โดย DavidKarlas เมื่อ 9 พฤศจิกายน 2023 ในภาษา EnglishTampermonkey is web browser extension that allows adding JavaScript to any website in your browser and manipulate content of that website. It sounds scary and probably should, first you need to trust extension itself and then scripts that you install. Since extension itself has huge community and history, millions of installs across Chrome/Edge/Firefox extensions stores, 5 stars… Let’s assume we can trust it…
I wrote some time ago script that I want to share with everyone, it adds few buttons to OpenStreetMap.org website.
Here is example how it looks like:
On example of New York above buttons would take you to following websites:
- PeWu nice and simple history view of changes on nodes, ways or relations
- DeepHistory another history viewer, but in tabular view
- Relation Analyzer helpful website for validating/analyzing relations
- Overpass Opens Overpass at same viewport as currently seen on OSM website
It also adds different set of buttons linking to Achavi, OSMHV, OSMCha and OSM Lab websites when viewing changeset on website:
To install this extension in your browser go to https://www.tampermonkey.net/ and follow instructions…
Once you have it installed… You will want to install script that I wrote to do that:
- Click Tempermonkey icon at top right corner of your browser then Dashboard
- Inside Tempermonkey dashboard there is Utils tab, click that
- At bottom of that page there is Import from URL entry
- Stay vigilant when installing scripts, check the code…
- Copy-paste following URL there https://gist.githubusercontent.com/DavidKarlas/81b684dc6853f489b233715d157c145b/raw/EnrichOSMWebsite.js
Now go to OpenStreetMap.org or some changeset/node/way or relation and new buttons should show up.
You can give suggestions or report bugs either here or at https://gist.github.com/DavidKarlas/81b684dc6853f489b233715d157c145b
Happy mapping,
David
การอภิปราย
ความคิดเห็นจาก gileri เมื่อ 10 พฤศจิกายน 2023 เมื่อเวลา 20:41 น.
Hi, thank you for the script, it’s pretty useful !
ความคิดเห็นจาก JesseFTW เมื่อ 11 พฤศจิกายน 2023 เมื่อเวลา 23:27 น.
This looks delightful, I plan to install it soon. Thank you for writing it.
ความคิดเห็นจาก barefootstache เมื่อ 18 พฤศจิกายน 2023 เมื่อเวลา 04:54 น.
I would suggest sharing your code also with https://openuserjs.org/. This will ease the installing process for users and will make it extension independent meaning that users can choose between TamperMonkey and GreaseMonkey.
ความคิดเห็นจาก danilax86 เมื่อ 19 พฤศจิกายน 2023 เมื่อเวลา 12:50 น.
Thank you!
ความคิดเห็นจาก 快乐的老鼠宝宝 เมื่อ 20 พฤศจิกายน 2023 เมื่อเวลา 13:31 น.
Have you considered uploading your code to Greasyfork? Because for TamperMonkey users, the js script ecology of this website is more concentrated.
ความคิดเห็นจาก dadavid เมื่อ 20 พฤศจิกายน 2023 เมื่อเวลา 22:39 น.
started using it yesterday after reading about it on weeklyosm, already sure i cant use osm.org without it anymore! :D
i’d love the addition of an osmcha link on a users profile with the filter pre-applied, like you are doing for changesets already.
But yeah, amazing work, thank you very much
ความคิดเห็นจาก dadavid เมื่อ 21 พฤศจิกายน 2023 เมื่อเวลา 16:37 น.
thank you again for the script, i edited to add an osmcha-filter-link on a users page.
Just add this after line 85 (a little ugly because of url encoding):
addButton("OSMCha", "https://osmcha.org/?filters=%7B%22date__gte%22%3A%5B%7B%22label%22%3A%22%22%2C%22value%22%3A%22%22%7D%5D%2C%22users%22%3A%5B%7B%22label%22%3A%22" + regexResult[2] + "%22%2C%22value%22%3A%22" + regexResult[2] + "%22%7D%5D%7D");
ความคิดเห็นจาก DavidKarlas เมื่อ 24 พฤศจิกายน 2023 เมื่อเวลา 09:52 น.
Hi all, thank you for kind words… There was recent change on OSM website that shifted buttons a bit, hence I published new 0.3.1 version to address that. I also added @dadavid suggestion to add OSMCha for users…
I didn’t get around to checking out publishing on https://openuserjs.org/ or https://greasyfork.org/… Will get to that at some point :P
ความคิดเห็นจาก ayxis เมื่อ 22 สิงหาคม 2024 เมื่อเวลา 12:53 น.
Hi!
This script is amazing. I am not exaggerating when I say that I use it everyday. It saves me so much element-ID-copying-pain :)
May I request a Button for the level0-Editor when viewing a way/node/relation?
ความคิดเห็นจาก DavidKarlas เมื่อ 16 กุมภาพันธ์ 2025 เมื่อเวลา 12:57 น.
@ayxis, sorry it took this long, but today OSM website changed which broke a bit UI with this script, hence I updated and I also added level0 link.
Best regards, David
ความคิดเห็นจาก JesseFTW เมื่อ 16 กุมภาพันธ์ 2025 เมื่อเวลา 16:26 น.
Thanks for the update – looks great!
ความคิดเห็นจาก ayxis เมื่อ 21 กุมภาพันธ์ 2025 เมื่อเวลา 10:23 น.
@DavidKarlas Thank you so much!