[tarent-useful-scripts SCM] {mirkarte} branch master updated. 4192c56414826e73a019c31a93450887e7626c68

mirabilos at evolvis.org mirabilos at evolvis.org
Sun May 13 17:12:16 CEST 2018 • <20180513151216.CDCB04A01A0@evolvis.org>


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MirKarte source code repository".

The branch, master has been updated
       via  4192c56414826e73a019c31a93450887e7626c68 (commit)
      from  3672d261de49aa99c042f9ca7432e1840729ea3a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4192c56414826e73a019c31a93450887e7626c68
Author: mirabilos <m at mirbsd.org>
Date:   Sun May 13 17:12:11 2018 +0200

    also parse OSM #map=zoom/lat/lon

-----------------------------------------------------------------------

Summary of changes:
 mirkarte.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/mirkarte.js b/mirkarte.js
index fc981ae..5816f38 100644
--- a/mirkarte.js
+++ b/mirkarte.js
@@ -21,6 +21,7 @@
 var isNum = /^-?[0-9]*(\.[0-9]*)?$/;
 var isTwoNum = /^-?[0-9]*(\.[0-9]*)?,-?[0-9]*(\.[0-9]*)?$/;
 var isTwoNumSlashd = /^-?[0-9]*(\.[0-9]*)?\/-?[0-9]*(\.[0-9]*)?$/;
+var isThreeNumSlashd = /^[1-9][0-9]*\/-?[0-9]*(\.[0-9]*)?\/-?[0-9]*(\.[0-9]*)?$/;
 var map_initialised = false, myzoomcontrol_text;
 var map, maplayers, marker = false, params, params_saved = "";
 
@@ -387,6 +388,12 @@ var fn_hashchange = function (event) {
 			case "m":
 				params[pair.key] = pair.value;
 				break;
+			case "map":
+				if (isThreeNumSlashd.test(pair.value)) {
+					var t = pair.value.split("/");
+					params["m"] = t[1] + "," + t[2];
+				}
+				break;
 			}
 		    });
 	}


hooks/post-receive
-- 
MirKarte source code repository
(Evolvis project useful-scripts repository mirkarte)


More information about the useful-scripts-commits mailing list