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

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Aug 19 00:30:15 CEST 2014 • <20140818223015.8F9184A24EA@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  6342026c93931602007c1a6b75ac6e643868e9cd (commit)
      from  a728f7aadd7b16f65de20174da22d2d669da3168 (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 6342026c93931602007c1a6b75ac6e643868e9cd
Author: Thorsten Glaser <tg at mirbsd.org>
Date:   Sat Aug 9 09:08:19 2014 +0000

    quick hack for TiFu to prepare FrogLabs outdoor part

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

Summary of changes:
 index.htm => marker.htm  |    2 +-
 mirkarte.js => marker.js |   84 +++++-----------------------------------------
 2 files changed, 9 insertions(+), 77 deletions(-)
 copy index.htm => marker.htm (96%)
 copy mirkarte.js => marker.js (91%)

diff --git a/index.htm b/marker.htm
similarity index 96%
copy from index.htm
copy to marker.htm
index f2a9a35..17205b5 100644
--- a/index.htm
+++ b/marker.htm
@@ -49,7 +49,7 @@
  <script type="text/javascript"><!--//--><![CDATA[//><!--
   zip.workerScriptsPath = "zip.js/WebContent/";
  //--><!]]></script>
- <script type="text/javascript" src="mirkarte.js"></script>
+ <script type="text/javascript" src="marker.js"></script>
 </head><body>
 <div id="map_wrapper">
  <div id="map">
diff --git a/mirkarte.js b/marker.js
similarity index 91%
copy from mirkarte.js
copy to marker.js
index 45a2788..bb8278e 100644
--- a/mirkarte.js
+++ b/marker.js
@@ -21,7 +21,7 @@
 var isNum = /^-?[0-9]*(\.[0-9]*)?$/;
 var isTwoNum = /^-?[0-9]*(\.[0-9]*)?,-?[0-9]*(\.[0-9]*)?$/;
 var map_initialised = false, myzoomcontrol_text;
-var map, maplayers, marker = false, params, params_saved = "";
+var map, maplayers, params, params_saved = "";
 
 var attributions = {
 	"OSM": '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
@@ -93,16 +93,6 @@ function marker_popup(marker, text) {
 	    });
 }
 
-function nuke_marker() {
-	if (marker !== false) {
-		marker.closePopup();
-		map.removeLayer(marker);
-		marker = false;
-	}
-	delete params["m"];
-	update_hash();
-}
-
 var MarkerWithAttribution = L.Marker.extend({
 	options: {
 		"attribution": ""
@@ -377,60 +367,6 @@ var fn_hashchanged = function () {
 	params["zoom"] = czoom;
 
 	var wantMarker = false, mlat, mlon;
-	if (isTwoNum.test(params["m"])) {
-		wantMarker = true;
-		mlat = parseFloat(params["m"].split(",")[0]);
-		mlon = parseFloat(params["m"].split(",")[1]);
-		if (isNaN(mlat) || isNaN(mlon) ||
-		    mlat < -85 || mlat > 85 ||
-		    mlon < -180 || mlon > 180)
-			wantMarker = false;
-	}
-	if (!wantMarker &&
-	    isNum.test(params["mlat"]) &&
-	    isNum.test(params["mlon"])) {
-		wantMarker = true;
-		mlat = parseFloat(params["mlat"]);
-		mlon = parseFloat(params["mlon"]);
-		if (isNaN(mlat) || isNaN(mlon) ||
-		    mlat < -85 || mlat > 85 ||
-		    mlon < -180 || mlon > 180)
-			wantMarker = false;
-	}
-	if (!wantMarker && /1/.test(params["m"])) {
-		wantMarker = true;
-		mlat = clat;
-		mlon = clon;
-		if (isNaN(mlat) || isNaN(mlon) ||
-		    mlat < -85 || mlat > 85 ||
-		    mlon < -180 || mlon > 180)
-			wantMarker = false;
-	}
-	delete params["mlat"];
-	delete params["mlon"];
-	if (!wantMarker) {
-		delete params["m"];
-		if (marker !== false) {
-			map.removeLayer(marker);
-			marker = false;
-		}
-	} else {
-		params["m"] = mlat + "," + mlon;
-		if (marker === false) {
-			marker = L.marker([mlat, mlon], {
-				"icon": marker_icon,
-				"draggable": true
-			    }).addTo(map).on("dragend", function(e) {
-				var newloc = marker.getLatLng();
-
-				params["m"] = newloc.lat + "," + newloc.lng;
-				update_hash();
-			    });
-			marker_popup(marker,
-			    'Marker | <a href="javascript:nuke_marker();">Hide</a><br />°N<br />°E');
-		} else
-			marker.setLatLng([mlat, mlon]);
-	}
 
 	if (isNaN(clat) || isNaN(clon) ||
 	    clat < -85 || clat > 85 ||
@@ -438,11 +374,6 @@ var fn_hashchanged = function () {
 		/* default value */
 		clat = 50.7;
 		clon = 7.11;
-		/* jump to marker position */
-		if (wantMarker) {
-			clat = mlat;
-			clon = mlon;
-		}
 	}
 	delete params["center_lat"];
 	delete params["center_lon"]
@@ -708,12 +639,13 @@ too much */
 		    '</span><br /><span class="nowrap">dm: ' + f[0] +
 		    " " + f[1] + "</span>";
 
-		L.popup().setLatLng(l).setContent(s).openOn(map);
-		if (marker === false) {
-			params["mlat"] = llat;
-			params["mlon"] = llon;
-			fn_hashchanged();
-		}
+//		L.popup().setLatLng(l).setContent(s).openOn(map);
+		var marker = L.marker([llat, llon], {
+			"icon": marker_icon,
+			"draggable": true
+		    }).addTo(map);
+		marker_popup(marker,
+		    'Marker<br />°N<br />°E');
 	    });
 	map.on("mousemove", fn_mousemove);
 	map.on("dragstart", function () { map.off("mousemove", fn_mousemove); });


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


More information about the useful-scripts-commits mailing list