Relation Analyzer/Bookmarklet

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Relation Analyzer/Bookmarklet
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް

An unofficial bookmarklet (see this page's history for authors) tested only with Firefox (edit this if you tested in another browser).

Run this on a page (/history page works too) of a relationexample page. The bookmarklet opens the RA in a new tab.

javascript:var urlParts=document.location.href.split('/'); if(urlParts[2]==='www.openstreetmap.org') { if (urlParts[3]==="relation") { var idMatch = urlParts[4].match(/\d+/); var objId = idMatch[0]; window.open('http://ra.osmsurround.org/analyzeRelation?relationId=' + objId); } else { alert('Only relations can be analysed.'); } } else { alert('This is not a supported www.openstreetmap.org page.'); } void(0);

Version without spaces:

javascript:var%20urlParts=document.location.href.split('/');if(urlParts[2]==='www.openstreetmap.org'){if(urlParts[3]==="relation"){var%20idMatch=urlParts[4].match(/\d+/);var%20objId=idMatch[0];window.open('http://ra.osmsurround.org/analyzeRelation?relationId='+objId);}else{alert('Only%20relations%20can%20be%20analysed.');}}else{alert('This%20is%20not%20a%20supported%20www.openstreetmap.org%20page.');}void(0);