[Mapbender-commits] r7054 - in trunk/mapbender/http: classes javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 22 03:38:34 EDT 2010


Author: verenadiewald
Date: 2010-10-22 00:38:34 -0700 (Fri, 22 Oct 2010)
New Revision: 7054

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

Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php	2010-10-19 14:05:05 UTC (rev 7053)
+++ trunk/mapbender/http/classes/class_wfs.php	2010-10-22 07:38:34 UTC (rev 7054)
@@ -88,14 +88,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);
@@ -111,7 +115,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,
@@ -119,7 +123,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);
 	}

Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php	2010-10-19 14:05:05 UTC (rev 7053)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php	2010-10-22 07:38:34 UTC (rev 7054)
@@ -2728,10 +2728,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 && (type === "insert" || type === "update")) {
@@ -2838,7 +2838,7 @@
 				wfsSubWrite(m, type, status, success, fid, callback);
 			}
 		);
-	}
+//	}
 }
 
 function getJsWfsConfIdByDbWfsConfId (wfsConf, id) {

Modified: trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2010-10-19 14:05:05 UTC (rev 7053)
+++ trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php	2010-10-22 07:38:34 UTC (rev 7054)
@@ -1010,7 +1010,9 @@
 			var andConditions = [];
 			
 			var el = global_wfsConfObj[global_selectedWfsConfId].element;
-			var srs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
+			//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_]+/;
@@ -1286,7 +1288,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) {

Modified: trunk/mapbender/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_gazetteer_server.php	2010-10-19 14:05:05 UTC (rev 7053)
+++ trunk/mapbender/http/php/mod_wfs_gazetteer_server.php	2010-10-22 07:38:34 UTC (rev 7054)
@@ -126,6 +126,7 @@
 	$filter = $_REQUEST["filter"];
 	$url = $_REQUEST["url"];
 	$typename = $_REQUEST["typename"];
+	$destSrs = $_REQUEST["destSrs"];
 
 	$wfsConf = WfsConfiguration::createFromDb($wfs_conf_id);
 	if (is_null($wfsConf)) {
@@ -143,7 +144,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