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

mirabilos at evolvis.org mirabilos at evolvis.org
Wed May 20 14:33:36 CEST 2015 • <20150520123337.0D2324A247D@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  e0feb37209230b3e73fd0e3e7bab3347123c882e (commit)
       via  343a67414896528beee51590f2c7fff21de65dc9 (commit)
      from  c91a60cf3cf262e1c9fa2d5592324be7fcc5d007 (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 e0feb37209230b3e73fd0e3e7bab3347123c882e
Author: Thorsten Glaser <tg at mirbsd.org>
Date:   Wed May 20 14:33:20 2015 +0200

    also parse GC and OC as waypoints; to be extended later, quick fix

commit 343a67414896528beee51590f2c7fff21de65dc9
Author: Thorsten Glaser <tg at mirbsd.org>
Date:   Wed May 20 14:15:11 2015 +0200

    we can zoom in more here

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

Summary of changes:
 mirkarte.js |   23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/mirkarte.js b/mirkarte.js
index f4ab12e..58d4329 100644
--- a/mirkarte.js
+++ b/mirkarte.js
@@ -120,6 +120,12 @@ function jumptonextpos() {
 		map.fitBounds(nextpos[0], nextpos[1]);
 }
 
+mirkarte_gpx_links = [
+	[ /^GC/, 'Geocache', 'http://coord.info/$&' ],
+	[ /^TC/, 'TerraCache', 'http://www.terracaching.com/Cache/$&' ],
+	[ /^OC/, 'Geocache', 'http://www.opencaching.de/viewcache.php?wp=$&' ],
+];
+
 function add_gpx_to_map(gpx_string, layer_name) {
 	if (!/<gpx/.test(gpx_string))
 		return false;
@@ -159,12 +165,18 @@ function add_gpx_to_map(gpx_string, layer_name) {
 			s = (x ? (x + " ") : "") + f;
 
 			x = feature.properties["desc"];
-			if (/TC/.test(feature.properties["name"]) &&
-			    feature.properties["sym"] == "TerraCache")
-				x = '<a href="http://www.terracaching.com/Cache/' +
-				    feature.properties.name + '">' +
+			var n = mirkarte_gpx_links.length;
+			for (var i = 0; i < n; ++i) {
+				if (!mirkarte_gpx_links[i][0].test(feature.properties["name"]) ||
+				    (mirkarte_gpx_links[i][1] && mirkarte_gpx_links[i][1] != feature.properties["sym"]))
+					continue;
+				x = '<a href="' +
+				    feature.properties.name.replace(mirkarte_gpx_links[i][0],
+				    mirkarte_gpx_links[i][2]) + '">' +
 				    (x ? x : "(no description)") +
 				    '</a>';
+				break;
+			}
 			if (x)
 				s = s + "<br />" + x;
 			layer.bindPopup(s);
@@ -692,9 +704,10 @@ too much */
 			"attribution": attributions["Google"]
 		},
 		{
-			"_name": "Google Satellite (0..18)",
+			"_name": "Google Satellite (0..20)",
 			"_url": "http://khm{s}.googleapis.com/kh?v=142&x={x}&y={y}&z={z}",
 			"subdomains": "0123",
+			"maxZoom": 20,
 			"attribution": attributions["Google"]
 		},
 		{


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


More information about the useful-scripts-commits mailing list