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

mirabilos at evolvis.org mirabilos at evolvis.org
Fri Jun 13 06:21:10 CEST 2014


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 "Supplemental git repository mirkarte for Evolvis project useful-scripts".

The branch, master has been updated
       via  7f088c0d514780dcaeffb7a059fd1a2ba34798f8 (commit)
       via  7c424c68815819e76ea5acd100f2ce13c7be67b0 (commit)
       via  ec9861f55bda229fff60a46fbb5557e31ecc5ac8 (commit)
      from  75da5cfc456b371ac478f6e042a773c51af87918 (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 7f088c0d514780dcaeffb7a059fd1a2ba34798f8
Author: Thorsten Glaser <tg at mirbsd.org>
Date:   Fri Jun 13 06:20:55 2014 +0200

    • fix deleting a marker
    • permit deleting a marker from its popup

commit 7c424c68815819e76ea5acd100f2ce13c7be67b0
Author: Thorsten Glaser <tg at mirbsd.org>
Date:   Fri Jun 13 06:11:53 2014 +0200

    branding

commit ec9861f55bda229fff60a46fbb5557e31ecc5ac8
Author: Thorsten Glaser <tg at mirbsd.org>
Date:   Fri Jun 13 06:06:45 2014 +0200

    create marker on right-click

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

Summary of changes:
 mirkarte.js |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/mirkarte.js b/mirkarte.js
index 35c58f1..b425938 100644
--- a/mirkarte.js
+++ b/mirkarte.js
@@ -66,6 +66,16 @@ function marker_popup(marker, text) {
 	    });
 }
 
+function nuke_marker() {
+	if (marker !== false) {
+		marker.closePopup();
+		map.removeLayer(marker);
+		marker = false;
+	}
+	delete params["m"];
+	update_hash();
+}
+
 if (typeof(window.onhashchange) !== "undefined" &&
     (document.documentMode === undefined || document.documentMode > 7)) {
 	(function () {
@@ -206,7 +216,7 @@ var fn_hashchange = function (event) {
 		if (!wantMarker) {
 			delete params["m"];
 			if (marker !== false) {
-				map.removeControl(marker);
+				map.removeLayer(marker);
 				marker = false;
 			}
 		} else {
@@ -221,7 +231,8 @@ var fn_hashchange = function (event) {
 					params["m"] = newloc.lat + "," + newloc.lng;
 					update_hash();
 				    });
-				marker_popup(marker, "Marker<br />°N<br />°E");
+				marker_popup(marker,
+				    'Marker | <a href="javascript:nuke_marker();">Hide</a><br />°N<br />°E');
 			} else
 				marker.setLatLng([mlat, mlon]);
 		}
@@ -253,8 +264,11 @@ $(document).observe("dom:loaded", function () {
 	map = L.map("map", {
 /*		"worldCopyJump": true,*/
 		"maxBounds": [[-85, -180], [85, 180]],
+		"attributionControl": false,
 		"zoomControl": false
 	    });
+	L.control.attribution({"prefix": "MirKarte (Beta) | " +
+	    L.Control.Attribution.prototype.options.prefix}).addTo(map);
 	var myzoomclass = L.Control.Zoom.extend({
 		onAdd: function (map) {
 			var container = L.Control.Zoom.prototype.onAdd.apply(this, [map]);
@@ -515,6 +529,9 @@ too much */
 	map.on('contextmenu', function (e) {
 		var f = llformat(e.latlng.lat, e.latlng.lng);
 
+		if (marker === false)
+			window.location.hash = window.location.hash +
+			    "&m=" + e.latlng.lat + "," + e.latlng.lng;
 		L.popup().setLatLng(e.latlng).setContent("d: " +
 		    e.latlng.lat + "," + e.latlng.lng + "<br />dm: " +
 		    f[0] + " " + f[1]).openOn(map);


hooks/post-receive
-- 
Supplemental git repository mirkarte for Evolvis project useful-scripts
(Evolvis project useful-scripts repository mirkarte)


More information about the useful-scripts-commits mailing list