[Mapbender-commits] r8060 - branches/2.7/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Aug 12 08:46:40 EDT 2011


Author: verenadiewald
Date: 2011-08-12 05:46:40 -0700 (Fri, 12 Aug 2011)
New Revision: 8060

Modified:
   branches/2.7/http/javascripts/mod_tooltip.php
Log:
http://trac.osgeo.org/mapbender/ticket/863

Modified: branches/2.7/http/javascripts/mod_tooltip.php
===================================================================
--- branches/2.7/http/javascripts/mod_tooltip.php	2011-08-04 11:53:23 UTC (rev 8059)
+++ branches/2.7/http/javascripts/mod_tooltip.php	2011-08-12 12:46:40 UTC (rev 8060)
@@ -78,23 +78,35 @@
 var tooltipMsg = {'title':"<?php echo _mb("Information");?>"};
 
 function mod_tooltipInit(){
-	var tooltip_map = getMapObjByName(tooltipTarget);
-	var ind = getMapObjIndexByName(tooltipTarget);
-	var myMapObj = mb_mapObj[ind];		
+        var ind = getMapObjIndexByName(tooltipTarget);
+	var myMapObj = mb_mapObj[ind];
+        var domNode = myMapObj.getDomElement();
 
-	var map_el = myMapObj.getDomElement();
-
-	$(map_el.ownerDocument).mousemove(function(event){
-		point = tooltip_map.getMousePosition(event);
-		//mb_getMousePos(event,myMapObj.getMousePosition(event));
-		mod_tooltip_run(point);
-	}).mouseout(function(){
-		mouseMoves=0;
-	});
+        $(domNode).bind("mousemove", function (e) {
+            var tooltip_map = getMapObjByName(tooltipTarget);
+            point = tooltip_map.getMousePosition(e);
+            mod_tooltip_run(point);
+        });
+        $(domNode).bind("mouseout", function() {
+            mouseMoves=0;
+        });
+	
 }
 
 eventInit.register(mod_tooltipInit); //initialize tooltips!
 
+Mapbender.events.afterMapRequest.register(function () {
+    var ind = getMapObjIndexByName(tooltipTarget);
+	var myMapObj = mb_mapObj[ind];
+        var domNode = myMapObj.getDomElement();
+
+        $(domNode).bind("mousemove", function (e) {
+            var tooltip_map = getMapObjByName(tooltipTarget);
+            point = tooltip_map.getMousePosition(e);
+            mod_tooltip_run(point);
+        });
+});
+
 function mod_tooltip_run(point){
 	mouseMoves++;
 	var currentMouseMoves = mouseMoves;



More information about the Mapbender_commits mailing list