[Mapbender-commits] r2680 - branches/2.5/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 21 10:04:20 EDT 2008


Author: verenadiewald
Date: 2008-07-21 10:04:20 -0400 (Mon, 21 Jul 2008)
New Revision: 2680

Modified:
   branches/2.5/http/javascripts/mod_wfs_SpatialRequest.php
Log:
get featuretype srs for ogc spatial filter from database object

Modified: branches/2.5/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- branches/2.5/http/javascripts/mod_wfs_SpatialRequest.php	2008-07-21 12:25:22 UTC (rev 2679)
+++ branches/2.5/http/javascripts/mod_wfs_SpatialRequest.php	2008-07-21 14:04:20 UTC (rev 2680)
@@ -458,9 +458,11 @@
 	}
 
 	numberOfAjaxCalls =  js_wfs_conf_id.length;
+	
 
 	if(queryGeom.geomType==geomType.polygon){
 		for(var i=0; i<js_wfs_conf_id.length; i++){
+			var srs = wfs_config[js_wfs_conf_id[i]]['featuretype_srs'];
 			var url = wfs_config[js_wfs_conf_id[i]]['wfs_getfeature'];
 			url += mb_getConjunctionCharacter(wfs_config[js_wfs_conf_id[i]]['wfs_getfeature']);
 			url += "service=wfs&request=getFeature&version=1.0.0";
@@ -475,7 +477,7 @@
 						filter += wfs_config[js_wfs_conf_id[i]]['element'][j]['element_name'];
 					}
 				}
-				filter += "</ogc:PropertyName><gml:Polygon srsName=\"EPSG:4326\">";
+				filter += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
 				filter += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 				for(var k=0; k<queryGeom.count(); k++){
 					if(k>0)	filter += " ";
@@ -491,7 +493,7 @@
 						filter += wfs_config[js_wfs_conf_id[i]]['element'][j]['element_name'];
 					}
 				}
-				filter += "</ogc:PropertyName><gml:Polygon srsName='4326'>";
+				filter += "</ogc:PropertyName><gml:Polygon srsName='"+srs+"'>";
 				filter += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 				for(var k=0; k<queryGeom.count(); k++){
 					if(k>0)	filter += " ";
@@ -511,6 +513,7 @@
 			var rectangle = queryGeom.getBBox();
 		}
 		for(var i=0; i<js_wfs_conf_id.length; i++){
+			var srs = wfs_config[js_wfs_conf_id[i]]['featuretype_srs'];
 			var url = wfs_config[js_wfs_conf_id[i]]['wfs_getfeature'];
 			url += mb_getConjunctionCharacter(wfs_config[js_wfs_conf_id[i]]['wfs_getfeature']);
 			param = "service=wfs&request=getFeature&version=1.0.0&typename="+ wfs_config[js_wfs_conf_id[i]]['featuretype_name']+"&filter=";
@@ -523,7 +526,7 @@
 						filter += wfs_config[js_wfs_conf_id[i]]['element'][j]['element_name'];
 					}
 				}
-				filter += "</ogc:PropertyName><gml:Polygon srsName='4326'>";
+				filter += "</ogc:PropertyName><gml:Polygon srsName='"+srs+"'>";
 				filter += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 				filter += rectangle[0].x+","+rectangle[0].y;
 				filter += " ";
@@ -544,7 +547,7 @@
 						filter += wfs_config[js_wfs_conf_id[i]]['element'][j]['element_name'];
 					}
 				}
-				filter += "</ogc:PropertyName><gml:Polygon srsName='4326'>";
+				filter += "</ogc:PropertyName><gml:Polygon srsName='"+srs+"'>";
 				filter += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 				filter += rectangle[0].x+","+rectangle[0].y;
 				filter += " ";
@@ -577,6 +580,7 @@
 		var realWorld3 = makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
 		var realWorld4 = makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYAddPix);
 		for(var i=0; i<js_wfs_conf_id.length; i++){
+			var srs = wfs_config[js_wfs_conf_id[i]]['featuretype_srs'];
 			var url = wfs_config[js_wfs_conf_id[i]]['wfs_getfeature'];
 			url += mb_getConjunctionCharacter(wfs_config[js_wfs_conf_id[i]]['wfs_getfeature']);
 			param = "service=wfs&request=getFeature&version=1.0.0&typename="+ wfs_config[js_wfs_conf_id[i]]['featuretype_name']+"&filter=";
@@ -587,7 +591,7 @@
 					filter += wfs_config[js_wfs_conf_id[i]]['element'][j]['element_name'];
 				}
 			}
-			filter += "</ogc:PropertyName><gml:Polygon srsName='4326'><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+			filter += "</ogc:PropertyName><gml:Polygon srsName='"+srs+"'><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 			filter += realWorld1[0] + "," + realWorld1[1] + " " + realWorld2[0] + "," + realWorld2[1] +  " ";
 			filter += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1];
 			filter += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></ogc:Filter>";



More information about the Mapbender_commits mailing list