<p></p>
<p>Currently, the share tab on the OpenStreetMap website provides a geo URI. The website could become the receiving end as well.</p>
<p>a) The search currently supports of the form lat,lon, e.g. 52.6907,4.8059. If it internally stript the geo: prefix of the URI and optionally could make use of the zoom parameter z as in geo:52.6907,4.8059?z=15, the page could handle geo URIs in the search.</p>
<p>b) It then could use the ability to register a protocol handler via a Navigator API in JavaScript <a href="https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers" rel="nofollow">(WHATWG ยง 8.9.1.3)</a>:<br>
<code>navigator.registerProtocolHandler("geo", "https://www.openstreetmap.org/search?query=%s", "open on OpenStreetMap.org");</code>. At least for Firefox and Opera according to the mdn/browser-compat-data <a href="https://github.com/mdn/browser-compat-data/blob/fee6670cd7c0cce7b87b7cb67a0cc1f4a6b5566d/api/Navigator.json#L1815">[2]</a>, as for Edge and Chrome the geo scheme is not listed. I was able to add this handler though on Chromium 86.0.4240.75 on Ubuntu.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/2925">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLAR2QGAIBKQ46KR7TSNMIVTANCNFSM4TFLJAEA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLND2YCB4DAIJPJ3GITSNMIVTA5CNFSM4TFLJAEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4K5XZS6A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/2925",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/2925",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>