開放街圖標誌 OpenStreetMap 開放街圖

JavaScript Bookmarklets for viewing mappers contributions

於 2012年三月28日 由 jaakkohEnglish發表。 上一次更新在 2012年五月10日。

I’m no developer, coder or even a proper geek. My experience in even HTML is quite limited or at least from about 10 years ago.

Anyways, I got a itch to try out if I could create (based on someone else’s work) bookmarklets that would make it possible to jump from a mapper’s user page to his/her “Your OSM Heat Map” and “How Did You Contribute to OSM” pages.

So, inspired by the fantastic OSM History Viewer and its bookmarklet I rolled up my sleeves. With a few copy-replace-by-pastes I got the bookmarklets. I’m pasting them here below as plain text (as I don’t know how this system handles embedding(?) JavaScript links (and I don’t have time to test that now):

(1) Your OSM Heat Map Bookmarklet: javascript:a=document.location.href.split('/');if(a[2]+a[3]=='www.openstreetmap.orguser'){document.location.href=' http://yosmhm.neis-one.org/?'+a[4]}else{alert('This is not a valid OSM user page.') }

(2) How Did You Contribute to OSM Bookmarklet: javascript:a=document.location.href.split('/');if(a[2]+a[3]=='www.openstreetmap.orguser'){document.location.href=' http://hdyc.neis-one.org/?'+a[4]}else{alert('This is not a valid OSM user page.') }

Once you’ve saved these bookmarklets you can get to the respective service pages (YOSMHM or HDYC) by going to a given mapper’s user page and then clicking on the bookmarklet.

Cheers, -Jaakko

EDIT: Instructions on how to add code to the OSM User Diary check out http://daringfireball.net/projects/markdown/syntax#code . In essence you need to "wrap it with (double) backtick quotes (`)", as ToeBee kindly advice me on #OSM IRC.

位置: 7e Bellevue Chardonnières, Petyonvil, Port-au-Prince Arrondissement, West, Haiti
電子郵件圖示 藍天圖示 Facebook 圖示 LinkedIn 圖示 乳齒象圖示 Telegram 圖示 X 圖示

討論

登入 來留下評論