Update openstreetmap_geouri.user.js

This commit is contained in:
Tobias Schmidl 2020-01-28 12:38:02 +01:00 committed by GitHub
parent ada3490ea7
commit c34a675235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@
// @include https://www.openstreetmap.org/* // @include https://www.openstreetmap.org/*
// @description OpenStreetmap GeoURI Handler. This resolved "geo:<lat>,<lon>" URIs via openstreetmap, by registering to an unidentified URL on osm and then rewriting it on call. // @description OpenStreetmap GeoURI Handler. This resolved "geo:<lat>,<lon>" URIs via openstreetmap, by registering to an unidentified URL on osm and then rewriting it on call.
// @author Tobias Schmidl // @author Tobias Schmidl
// @version 0.1.9 // @version 0.1.10
// @grant GM_getValue // @grant GM_getValue
// @grant GM_listValues // @grant GM_listValues
// @downloadURL https://github.com/schtobia/greasemonkey/raw/master/openstreetmap_geouri.user.js // @downloadURL https://github.com/schtobia/greasemonkey/raw/master/openstreetmap_geouri.user.js
@ -15,4 +15,6 @@ window.navigator.registerProtocolHandler("geo", "https://www.openstreetmap.org/g
var regex = /geouri\/geo(%3A|:)([0-9\.-]+)(%2C|,)([0-9\.-]+)/; var regex = /geouri\/geo(%3A|:)([0-9\.-]+)(%2C|,)([0-9\.-]+)/;
if (location.href.match(regex)) if (location.href.match(regex))
{
location.href = location.href.replace(regex, "?mlat=$2&mlon=$4&zoom=12"); location.href = location.href.replace(regex, "?mlat=$2&mlon=$4&zoom=12");
}