[Mapbender-commits] r5401 - in trunk/mapbender: http/img http/img/marker http/plugins lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Jan 23 15:49:28 EST 2010


Author: christoph
Date: 2010-01-23 15:49:28 -0500 (Sat, 23 Jan 2010)
New Revision: 5401

Added:
   trunk/mapbender/http/img/marker/
   trunk/mapbender/http/img/marker/black.png
   trunk/mapbender/http/img/marker/blue.png
   trunk/mapbender/http/img/marker/brown.png
   trunk/mapbender/http/img/marker/gray.png
   trunk/mapbender/http/img/marker/green.png
   trunk/mapbender/http/img/marker/orange.png
   trunk/mapbender/http/img/marker/purple.png
   trunk/mapbender/http/img/marker/red.png
   trunk/mapbender/http/img/marker/white.png
   trunk/mapbender/http/img/marker/yellow.png
   trunk/mapbender/http/plugins/mb_twitter_update.js
   trunk/mapbender/lib/marker.js
Log:


Added: trunk/mapbender/http/img/marker/black.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/black.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/blue.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/blue.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/brown.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/brown.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/gray.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/green.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/green.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/orange.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/orange.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/purple.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/purple.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/red.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/red.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/white.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/white.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/img/marker/yellow.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/http/img/marker/yellow.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/mapbender/http/plugins/mb_twitter_update.js
===================================================================
--- trunk/mapbender/http/plugins/mb_twitter_update.js	                        (rev 0)
+++ trunk/mapbender/http/plugins/mb_twitter_update.js	2010-01-23 20:49:28 UTC (rev 5401)
@@ -0,0 +1,51 @@
+$twitterUpdate = $(this);
+var that = this;
+
+Mapbender.events.init.register(function () {
+	var button = new Mapbender.Button({
+		domElement: that,
+		over: options.src.replace(/_off/, "_over"),
+		on: options.src.replace(/_off/, "_on"),
+		off: options.src,
+		name: options.id,
+		go: function () {
+ 			options.$target.each(function () {
+	 			$(this).css("cursor", "pointer")
+	 			.mousedown(function (e) {
+					mb_disableThisButton(options.id);
+					var map = $(this).mapbender();
+					var pix = map.getMousePosition(e);
+					var p = map.convertPixelToReal(pix);
+					
+					var m = new Mapbender.Marker(p, map);
+
+					var $twitterStatus = $("<div class='ui-corner-all ui-widget-content' " + 
+						"style='position:absolute;top:" + 
+						(pix.y + parseInt(this.style.top, 10)) + "px;" + 
+						"left:" + (pix.x + parseInt(this.style.left, 10)) + "px;" + 
+						"border:1px solid black;z-index:999'>" + 
+						"<div>What's happening?<span style='float:right'>140</span></div>" + 
+						"<textarea rows='2' cols='70'></textarea>" + 
+						"<br><a style='float:right' class='ui-state-default ui-corner-all' href='#'>update</a>" + 
+						"</div>").appendTo("body");
+					var $charsLeft = $("span", $twitterStatus);
+					var $textarea = $twitterStatus.children().eq(1);
+					$textarea.focus().keypress(function () {
+						var chars = $textarea.val().length;
+						var avail = 140 - chars;
+						$charsLeft.text(avail);
+					});
+
+					
+					// open status input
+					return false;
+	 			});
+			});
+		},
+		stop: function () {
+ 			options.$target.each(function () {
+				$(this).css("cursor", "default").unbind("mousedown");
+			});
+		}
+	});
+});

Added: trunk/mapbender/lib/marker.js
===================================================================
--- trunk/mapbender/lib/marker.js	                        (rev 0)
+++ trunk/mapbender/lib/marker.js	2010-01-23 20:49:28 UTC (rev 5401)
@@ -0,0 +1,22 @@
+Mapbender.Marker = function (p, map) {
+	var h = new Highlight(
+		[map.elementName],
+		map.elementName + "_" + parseInt(Math.random()*100000,10),
+		"",
+		1
+	);
+	var g = new MultiGeometry(geomType.point);
+	g.addGeometry(geomType.point);
+	g.get(-1).add(p);
+	g.e.setElement("Mapbender:icon", "../img/marker/red.png");
+	g.e.setElement("Mapbender:iconOffsetX", -10);
+	g.e.setElement("Mapbender:iconOffsetY", -34);
+	
+	h.add(g);
+	h.paint();
+
+	map.events.afterMapRequest.register(function () {
+		h.paint();
+	});
+	
+};



More information about the Mapbender_commits mailing list