[Mapbender-commits] r3098 - branches/nimix_dev/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Oct 2 11:28:13 EDT 2008


Author: nimix
Date: 2008-10-02 11:28:13 -0400 (Thu, 02 Oct 2008)
New Revision: 3098

Modified:
   branches/nimix_dev/http/javascripts/mod_tooltip.php
Log:
fix tooltips when first request has no result

Modified: branches/nimix_dev/http/javascripts/mod_tooltip.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_tooltip.php	2008-10-02 15:27:36 UTC (rev 3097)
+++ branches/nimix_dev/http/javascripts/mod_tooltip.php	2008-10-02 15:28:13 UTC (rev 3098)
@@ -63,6 +63,7 @@
 var tooltipWmsRequestCount = 0;
 var numberOfFinishedWfsRequests = 0;
 var numberOfFinishedWmsRequests = 0;
+var visibleRequest = 0;
 var TooltipMsg = {'title':"<?php echo _mb("Informations");?>"};
 
 //buttonWfs_toDigitize_on ="0";
@@ -86,6 +87,7 @@
 	point = new Point(clickX,clickY);
 	var point_geom = new Geometry(geomType.point);
 	point_geom.addPoint(mapToReal(tooltipTarget,point));
+	visibleRequest = 0;
 	
 	//FeatureInfo requests
 	urls = mb_mapObj[ind].getFeatureInfoRequests(point);
@@ -118,11 +120,16 @@
 	numberOfFinishedWmsRequests++;
 
 	//check if there are results
-	if(js_code == "")
+	if(js_code == ""){
+		if(!isFirstResult())
+			displayResultDoc("");
 		return;
+	}
 	
 	for(var k=0;k < no_result_text.length;k++){
 		if(js_code.indexOf(no_result_text[k])!==-1){
+			if(!isFirstResult())
+				displayResultDoc("");
 			return;
 		}
 	}
@@ -146,11 +153,13 @@
 				var html = createDetailedWfsResultHtml(resultGeomArray);
 			displayResultDoc(html);
 		}
+		else if(!isFirstResult())
+			displayResultDoc("");
 	}
 }
 
 function isFirstResult(){
-	return (numberOfFinishedWfsRequests+numberOfFinishedWmsRequests) == 1;
+	return visibleRequest == 0;
 }
 
 function isLastResult(){
@@ -174,6 +183,7 @@
 		if(isLastResult())
 			oDoc.close();
 	});	
+	visibleRequest++;
 }
 
 function showBalloonFrame(html){



More information about the Mapbender_commits mailing list