[Mapbender-commits] r4324 - branches/2.6/http/javascripts trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jul 9 04:18:02 EDT 2009


Author: verenadiewald
Date: 2009-07-09 04:17:59 -0400 (Thu, 09 Jul 2009)
New Revision: 4324

Modified:
   branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
   trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
Log:
http://trac.osgeo.org/mapbender/ticket/494

Modified: branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php	2009-07-09 07:47:15 UTC (rev 4323)
+++ branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php	2009-07-09 08:17:59 UTC (rev 4324)
@@ -623,7 +623,6 @@
 		if(submit)submit.disabled = true;
 	}
 	else{
-		//disable Submit Button
 		if(submit)submit.disabled = false;
 	}
 }
@@ -1200,15 +1199,10 @@
 				}
 				showDetailsObj.push(currentObj);
 			}
-			details = 1;
 		}
-		else{
-			details = 0;
-		}
 	}
 	var resultHtml = "";
 	resultHtml += "<table style='background-color:#EEEEEE;'>\n";
-//	for (var elPos in showDetailsObj) {
 
 	showDetailsObj.sort(showDetailObjSort);
 	for (var i=0; i < showDetailsObj.length; i++) {
@@ -1225,11 +1219,8 @@
 			resultHtml += "</td></tr>\n";
 		}
 	}
-	if(details != 1){
-		resultHtml +="<tr><td>No detail information</td></tr>\n";
-	}
 	resultHtml += "</table>\n";
-	if(showResultInPopup==1){
+	if(showResultInPopup==1 && showDetailsObj.length > 0){
 		if (typeof(wfsPopup) == "undefined") {
 			wfsPopup = new parent.mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
 		}

Modified: trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2009-07-09 07:47:15 UTC (rev 4323)
+++ trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2009-07-09 08:17:59 UTC (rev 4324)
@@ -504,7 +504,7 @@
 		var optionNode = document.createElement("option");
 		
 		optionNode.value = wfsConfId;
-		optionNode.innerHTML = global_wfsConfObj[wfsConfId].g_label;
+		optionNode.innerHTML = global_wfsConfObj[wfsConfId].wfs_conf_abstract;
 
 		if (!isSelected) {
 			optionNode.selected = true;
@@ -615,16 +615,18 @@
 	//check SRS
 	var ind = parent.getMapObjIndexByName("mapframe1");
 	var submit = document.getElementById("submitButton");
-	if(global_wfsConfObj[global_selectedWfsConfId].featuretype_srs.toUpperCase()!=parent.mb_mapObj[ind].getSRS().toUpperCase()){
-		var msg = "Different EPSG of map and wfs featuretype, no spatial request possible!\n";
-		msg += parent.mb_mapObj[ind].getSRS()+" und "+global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
+	var patternString = parent.mb_mapObj[ind].getSRS().toUpperCase();
+	var pattern = new RegExp(patternString);
+
+if(global_wfsConfObj[global_selectedWfsConfId].featuretype_srs.match(pattern) == -1){
+		var msg = '<?php echo _mb("Different EPSG of map and wfs featuretype, no spatial request possible!");?>';
+		msg += parent.mb_mapObj[ind].getSRS()+"  -  "+global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
 		alert(msg);
-			
+
 		//disable Submit Button
 		if(submit)submit.disabled = true;
 	}
 	else{
-		//disable Submit Button
 		if(submit)submit.disabled = false;
 	}
 }
@@ -1207,15 +1209,10 @@
 				}
 				showDetailsObj.push(currentObj);
 			}
-			details = 1;
 		}
-		else{
-			details = 0;
-		}
 	}
 	var resultHtml = "";
 	resultHtml += "<table style='background-color:#EEEEEE;'>\n";
-//	for (var elPos in showDetailsObj) {
 
 	showDetailsObj.sort(showDetailObjSort);
 	for (var i=0; i < showDetailsObj.length; i++) {
@@ -1232,11 +1229,8 @@
 			resultHtml += "</td></tr>\n";
 		}
 	}
-	if(details != 1){
-		resultHtml +="<tr><td>No detail information</td></tr>\n";
-	}
 	resultHtml += "</table>\n";
-	if(showResultInPopup==1){
+	if(showResultInPopup==1 && showDetailsObj.length > 0){
 		if (typeof(wfsPopup) == "undefined") {
 			wfsPopup = new parent.mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
 		}
@@ -1298,6 +1292,6 @@
 <div name='displaySpatialButtons' id='displaySpatialButtons' style='width:180px;margin-top:5px;background-color:#FFFFFF;'></div>
 <form name='wfsForm' id='wfsForm' onsubmit='return validate()'>
 </form>
-<div name='res' id='res' style='width:180px'></div>
+<div class='resultDiv' name='res' id='res' style='width:180px'></div>
 </body>
 </html>



More information about the Mapbender_commits mailing list