[Mapbender-commits] r7055 - in branches/2.6/http: classes javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 22 03:59:05 EDT 2010


Author: verenadiewald
Date: 2010-10-22 00:59:05 -0700 (Fri, 22 Oct 2010)
New Revision: 7055

Modified:
   branches/2.6/http/classes/class_wfs.php
   branches/2.6/http/javascripts/mod_digitize_tab.php
   branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
   branches/2.6/http/php/mod_wfs_gazetteer_server.php
Log:
http://trac.osgeo.org/mapbender/ticket/712

Modified: branches/2.6/http/classes/class_wfs.php
===================================================================
--- branches/2.6/http/classes/class_wfs.php	2010-10-22 07:38:34 UTC (rev 7054)
+++ branches/2.6/http/classes/class_wfs.php	2010-10-22 07:59:05 UTC (rev 7055)
@@ -78,14 +78,18 @@
 		return $this->get($url);
 	}
 	
-	protected function getFeaturePost ($featureTypeName, $filter) {
+	protected function getFeaturePost ($featureTypeName, $filter, $destSrs) {
 		$postData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . 
 			"<wfs:GetFeature service=\"WFS\" version=\"" . $this->getVersion() . "\" " . 
 			"xmlns:wfs=\"http://www.opengis.net/wfs\" " . 
 			"xmlns:gml=\"http://www.opengis.net/gml\" " . 
 			"xmlns:ogc=\"http://www.opengis.net/ogc\">" . 
 			"<wfs:Query ";
-			
+		
+		if($destSrs) {
+			$postData .= "srsName=\"" . $destSrs . "\" ";
+		}
+		
 		// add namespace
 		if (strpos($featureTypeName, ":") !== false) {
 			$ft = $this->findFeatureTypeByName($featureTypeName);
@@ -101,7 +105,7 @@
 		return $this->post($this->getFeature, $postData);
 	}
 	
-	public function getFeature ($featureTypeName, $filter) {
+	public function getFeature ($featureTypeName, $filter, $destSrs=null) {
 
 // FOR NOW, WE ONLY DO POST REQUESTS!
 // THE FILTERS ARE CONSTRUCTED ON THE CLIENT SIDE,
@@ -109,7 +113,7 @@
 // WOULD BE TOO MUCH FOR NOW
 //
 //		if (strpos($this->getFeature, "?") === false) {
-			return $this->getFeaturePost($featureTypeName, $filter);
+			return $this->getFeaturePost($featureTypeName, $filter, $destSrs);
 //		}
 //		return $this->getFeatureGet($featureTypeName, $filter);
 	}
@@ -218,8 +222,14 @@
 		$propertiesSegment = "";
 		foreach ($feature->properties as $key => $value) {
 			if (isset($value)) {
+				if (is_numeric($value) || $value == "") {
+					$value = $value;
+				}
+				else {
+					$value = "<![CDATA[$value]]>";
+				}
 				$propertiesSegment .= "<wfs:Property><wfs:Name>$featureNS:$key</wfs:Name>" . 
-					"<wfs:Value><![CDATA[$value]]></wfs:Value></wfs:Property>";
+					"<wfs:Value>$value</wfs:Value></wfs:Property>";
 			}
 		}
 

Modified: branches/2.6/http/javascripts/mod_digitize_tab.php
===================================================================
--- branches/2.6/http/javascripts/mod_digitize_tab.php	2010-10-22 07:38:34 UTC (rev 7054)
+++ branches/2.6/http/javascripts/mod_digitize_tab.php	2010-10-22 07:59:05 UTC (rev 7055)
@@ -2077,10 +2077,10 @@
 	var patternString = parent.mb_mapObj[mapObjInd].epsg.toUpperCase();
 	var pattern = new RegExp(patternString);
 
-	if(!myconf['featuretype_srs'].match(pattern)){
-		proceed = confirm(msgObj.errorMessageEpsgMismatch + parent.mb_mapObj[mapObjInd].epsg + " / "+ myconf['featuretype_srs'] + ". Proceed?");
-	}
-	if (proceed) {
+//	if(!myconf['featuretype_srs'].match(pattern)){
+//		proceed = confirm(msgObj.errorMessageEpsgMismatch + parent.mb_mapObj[mapObjInd].epsg + " / "+ myconf['featuretype_srs'] + ". Proceed?");
+//	}
+//	if (proceed) {
 		var fid = false;
 		var errorMessage = "";
 		if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
@@ -2148,7 +2148,7 @@
 				wfsSubWrite(m, type, status, success, fid);
 			}
 		);
-	}
+//	}
 }
 
 function wfsSubWrite(m, type, status, success, fid) {

Modified: branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php	2010-10-22 07:38:34 UTC (rev 7054)
+++ branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php	2010-10-22 07:59:05 UTC (rev 7055)
@@ -751,7 +751,8 @@
 			var andConditions = "";
 
 			var el = global_wfsConfObj[global_selectedWfsConfId].element;
-			var srs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
+			var ind = parent.getMapObjIndexByName("mapframe1");
+			var srs = parent.mb_mapObj[ind].getSRS();
 			var ftName = global_wfsConfObj[global_selectedWfsConfId].featuretype_name;
 
 			var pattern = /:[a-zA-Z0-9_]+/;
@@ -1019,7 +1020,8 @@
 				"typename" : global_wfsConfObj[global_selectedWfsConfId].featuretype_name,
 				"frame" : this.name,
 				"filter" : filter,
-				"backlink" : ""
+				"backlink" : "",
+				"destSrs" : srs
 			};
 			parent.mb_ajax_get("../php/mod_wfs_gazetteer_server.php", parameters, function (jsCode, status) {
 				document.getElementById("res").innerHTML = "<table><tr><td>"+arrangeResultsText+"</td></tr></table>";

Modified: branches/2.6/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- branches/2.6/http/php/mod_wfs_gazetteer_server.php	2010-10-22 07:38:34 UTC (rev 7054)
+++ branches/2.6/http/php/mod_wfs_gazetteer_server.php	2010-10-22 07:59:05 UTC (rev 7055)
@@ -127,6 +127,7 @@
 	$filter = $_REQUEST["filter"];
 	$url = $_REQUEST["url"];
 	$typename = $_REQUEST["typename"];
+	$destSrs = $_REQUEST["destSrs"];
 
 	$wfsConf = WfsConfiguration::createFromDb($wfs_conf_id);
 	if (is_null($wfsConf)) {
@@ -144,7 +145,7 @@
 
 	$myWfsFactory = new UniversalWfsFactory();
 	$myWfs = $myWfsFactory->createFromDb($wfsId);
-	$data = $myWfs->getFeature($typename, $filter);
+	$data = $myWfs->getFeature($typename, $filter,$destSrs);
 	if ($data === null) die('{}');
 	
 //	$geomColumn = WfsConf::getGeomColumnNameByConfId($wfs_conf_id);



More information about the Mapbender_commits mailing list