[Mapbender-commits] r3152 - branches/beck_dev/http/gazetteer_rostock

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 13 08:52:51 EDT 2008


Author: beck
Date: 2008-10-13 08:52:51 -0400 (Mon, 13 Oct 2008)
New Revision: 3152

Modified:
   branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_client.js
   branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_client.php
   branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_server.php
Log:


Modified: branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_client.js
===================================================================
--- branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_client.js	2008-10-13 12:19:48 UTC (rev 3151)
+++ branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_client.js	2008-10-13 12:52:51 UTC (rev 3152)
@@ -8,33 +8,43 @@
 	mb_registerSubFunctions("global_resultHighlight1.paint()");
 	mb_registerSubFunctions("global_resultHighlight2.paint()");
  });
- 
+
+var formSubmitted = false;
 $(document).ready(function(){
-	$("<form />").attr({"id":"searchFormStreet","method":"post","action":"mod_WFSStreetGaz_client.php?"+getParamsForm2}).appendTo("#"+e_id2);
-   	$("#searchFormStreet").submit( function() {
-   		//try {if(startSearch2()){}}catch(e) {console.log(e);}
+	$("<form>").attr({"id":"searchFormStreet","method":"post","action":"mod_WFSStreetGaz_client.php?"+getParamsForm2}).appendTo("#"+e_id2);
+  	$("#searchFormStreet").submit( function() {
+   		//try {if(startSearch2()){}}catch(e) {console.log(e);}
+formSubmitted = true;
    		startSearch2();
    		return false; 
 	} );
 			
    	//table structure
-   	$("<table/>").attr({"id":"tableStreet","border":"0","cellpadding":"0","cellspacing":"0"}).appendTo("#searchFormStreet");
-   	$("<tr/>").attr({"id":"tr_a"}).appendTo("#tableStreet");
-   	$("<tr/>").attr({"id":"tr_b"}).appendTo("#tableStreet");
-   	$("<tr/>").attr({"id":"tr_c"}).appendTo("#tableStreet");
-   	$("<td/>").attr({"id":"td_a"}).appendTo("#tr_a");
-   	$("<td/>").attr({"id":"td_b"}).appendTo("#tr_a");
-   	$("<td/>").attr({"id":"td_c"}).appendTo("#tr_a");
-   	$("<td/>").attr({"id":"td_d"}).appendTo("#tr_b");
-   	$("<td/>").attr({"id":"td_e"}).appendTo("#tr_b");
-   	$("<td/>").attr({"id":"td_f"}).appendTo("#tr_b");
-   	$("<td/>").attr({"id":"td_g"}).appendTo("#tr_c");
-	$("<td/>").attr({"id":"td_h"}).appendTo("#tr_c");
-	$("<td/>").attr({"id":"td_i"}).appendTo("#tr_c");
+   	$("<table>").attr({"id":"tableStreet","border":"0","cellpadding":"0","cellspacing":"0"}).appendTo("#searchFormStreet");
+	
+$("#tableStreet").css({"position":"absolute"});
+$("#tableStreet").css({"top":"0"});
+$("#tableStreet").css({"left":"-15px"});
+	
+   	$("<tr>").attr({"id":"tr_a"}).appendTo("#tableStreet");
+   	$("<tr>").attr({"id":"tr_b"}).appendTo("#tableStreet");
+   	$("<tr>").attr({"id":"tr_c"}).appendTo("#tableStreet");
+   	$("<td>").attr({"id":"td_a"}).appendTo("#tr_a");
+   	$("<td>").attr({"id":"td_b"}).appendTo("#tr_a");
+   	$("<td>").attr({"id":"td_c"}).appendTo("#tr_a");
+   	$("<td>").attr({"id":"td_d"}).appendTo("#tr_b");
+   	$("<td>").attr({"id":"td_e"}).appendTo("#tr_b");
+   	$("<td>").attr({"id":"td_f"}).appendTo("#tr_b");
+   	$("<td>").attr({"id":"td_g"}).appendTo("#tr_c");
+	$("<td>").attr({"id":"td_h"}).appendTo("#tr_c");
+	$("<td>").attr({"id":"td_i"}).appendTo("#tr_c");
 	   	
    	//button ok 
    	$("<input type='submit'>").attr({"id":"button1","value":"ok"}).appendTo("#td_c");
-   	$("#button1").click( function() { 
+   	$("#button1").click( function() {
+if(formSubmitted) {
+	return false;
+}
 			eventGazResClickOV.trigger({
 				"targetArray":targetArray2
 			});			
@@ -46,7 +56,10 @@
    	//default: buttons hidden
    	$("#button1").css({"left":"-800"});
 	$("#button2").css({"left":"-800"});
-	$("#button2").click( function() { 
+	$("#button2").click( function() { 
+if(formSubmitted) {
+	return false;
+}
 		eventGazResClickOV.trigger({
 			"targetArray":targetArray2
 		});
@@ -55,10 +68,11 @@
    	//text fields
    	$("<input type='text'>").attr({"id":"feld1","size":"22"}).appendTo("#td_b");
    	$("#feld1").mousedown( function() { 
-   		clearAll();
+//		clearAll();
 		$("#button1").css({"left":"0"});
 		$("#button2").css({"left":"-800"});
 		$("#feld2").attr('disabled','true');
+clearStreet(); 
 	 } );
    	
    	$("<input type='text'>").attr({"id":"feld2","size":"22"}).appendTo("#td_e");
@@ -229,7 +243,7 @@
 		}
 	}
 	else{
-		$("#td_h").empty();
+//		$("#td_h").empty();
 		var searchString = $("#feld1").val().replace (/^\s+/, '').replace (/\s+$/, '');
 		searchValue2[0] = searchString;
 		propertyName2[0] = propNameStr0;
@@ -238,7 +252,7 @@
 			return false;
 		}
 		validate2(propertyName2,searchValue2,wfsSearchOrt,shortName2[0]);
-	}
+	}
 }
 
 function clearStreet(){
@@ -284,7 +298,7 @@
 	$("#button2").css({"left":"0"});
 	$("#feld2").attr('disabled','');
 	$("#feld2").focus();
-	$("#td_h").empty();
+//	$("#td_h").empty();
 	wfsSearchStr = nextWfsUrl;
 }
 
@@ -297,7 +311,7 @@
 function transferStrResult(resultFill,nextSearchAttr,nextWfsUrl){
 	var searchResult = resultFill;
 	$("#feld2").attr({"value":""+searchResult+""});
-	$("#td_h").empty();
+//	$("#td_h").empty();
 	propertyName2 = [];
 	searchValue2 = [];
 	propertyName2[0] = propNameStr3;
@@ -367,24 +381,28 @@
 			andConditions = "<And>" + andConditions + "</And>";
 		}
 		
-		var requestUrl = wfsUrl;	
+//		var requestUrl = wfsUrl;
+		var requestUrl = wfsUrl.replace(/localhost\/geoserver/,'geoportal.rostock.de/geoserver_hro'); // lokale Entwicklung
+
 		requestUrl += "&filter=";
 		var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
 	}
-	$("#td_h").empty();
+//	$("#td_h").empty();
 	$("<img>").attr({"id":"wheelImg","src":"../img/indicator_wheel.gif"}).appendTo("#td_h");
 	$("<span>").attr({"id":"searchDiv"}).appendTo("#td_h").html(" Suche...");
 	
 	var parameters = {command:"getSearchResults", "url":requestUrl, "filter":filter};
 	parent.mb_ajax_post("../gazetteer_rostock/mod_WFSStreetGaz_server.php", parameters, function (jsCode, status) {
-		$("#td_h").empty();
+//		$("#td_h").empty();
+$("#wheelImg").remove();
+$("#searchDiv").remove();
 		var geoObj = eval('(' + jsCode + ')');	
    		if (jsCode) {	
 			if (typeof(geoObj) == 'object') {
 				geomArray2.importGeoJSON(geoObj);
 				geomArray3.importGeoJSON(geoObj);
-				$("#td_h").empty();
-				$("<ul/>").attr({"id":"hnrUl"}).appendTo("#td_h");
+//				$("#td_h").empty();
+				$("<ul>").attr({"id":"hnrUl"}).appendTo("#td_h");
 				$("#hnrUl").css('list-style', 'none');
 				$("#hnrUl").css('margin', '0');
 				$("#hnrUl").css('padding', '0');
@@ -490,7 +508,7 @@
 						(function () {
 							var geomStr = searchAbbr + i;
 							var geomIndex = i;
-							$("<li/>").attr({"id":searchAbbr+i}).appendTo("#hnrUl");
+							$("<li>").attr({"id":searchAbbr+i}).appendTo("#hnrUl");
 							$("#"+searchAbbr+i).css('float', 'left');
 							$("#"+searchAbbr+i).css('margin', '2px');
 							$("#"+searchAbbr+i).css('padding', '1px 2px');
@@ -541,7 +559,7 @@
 					}
 				}
 				if(geomArray2.count()==0){
-					$("#td_h").empty();
+//					$("#td_h").empty();
 					$("<div>").attr({"id":"noResult"}).appendTo("#td_h");
 					if(searchAbbr==shortName2[0]){
 						$("#noResult").text(noResultText2[0]);
@@ -555,7 +573,8 @@
 				}
 			}
 			else {
-				$("#td_h").empty();
+//				$("#td_h").empty();
+
 				$("<div>").attr({"id":"noResult"}).appendTo("#td_h");
 				if(searchAbbr==shortName2[0]){
 					$("#noResult").text(noResultText2[0]);
@@ -570,6 +589,8 @@
 		}
 		else {
 			alert("No results.");
-		}
+		}
+		
+formSubmitted = false;
 	});
 }

Modified: branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_client.php
===================================================================
--- branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_client.php	2008-10-13 12:19:48 UTC (rev 3151)
+++ branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_client.php	2008-10-13 12:52:51 UTC (rev 3152)
@@ -24,7 +24,11 @@
 echo "var geomArray2 = new GeometryArray();";
 echo "var geomArray3 = new GeometryArray();";
 
-echo "var wfsSearchOrt = 'http://localhost/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:orte_sort';";
+echo "var wfsSearchOrt = 'http://geoportal.rostock.de/geoserver_hro/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:orte_sort';";
+echo "var wfsSearchStr = 'http://geoportal.rostock.de/geoserver_hro/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:str_dbr_sort';";
+echo "var wfsSearchNr = 'http://geoportal.rostock.de/geoserver_hro/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:hnr_dbr_sort';";
+
+//echo "var wfsSearchOrt = 'http://localhost/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:orte_sort';";
 //echo "var wfsSearchStr = 'http://localhost/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:str_dbr_sort';";
 //echo "var wfsSearchNr = 'http://localhost/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getFeature&TYPENAME=hro:hnr_dbr_sort';";
 

Modified: branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_server.php
===================================================================
--- branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_server.php	2008-10-13 12:19:48 UTC (rev 3151)
+++ branches/beck_dev/http/gazetteer_rostock/mod_WFSStreetGaz_server.php	2008-10-13 12:52:51 UTC (rev 3152)
@@ -35,7 +35,7 @@
 	$url = $_REQUEST["url"];
 
 	$admin = new administration();
-		
+
 	$req = urldecode($url).urlencode($admin->char_decode(stripslashes($filter)));
 	$mygml = new gml2();
 	
@@ -61,6 +61,7 @@
 	$mygml->parseFile($req);
 	
 	header("Content-type:application/x-json; charset=utf-8");
+
 	echo $mygml->toGeoJSON();
 }
 else {



More information about the Mapbender_commits mailing list