[Mapbender-commits] r4313 - in branches/2.6/http: classes
javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Jul 6 12:29:58 EDT 2009
Author: verenadiewald
Date: 2009-07-06 12:29:57 -0400 (Mon, 06 Jul 2009)
New Revision: 4313
Modified:
branches/2.6/http/classes/class_wfs_conf.php
branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
Log:
http://trac.osgeo.org/mapbender/ticket/463
Modified: branches/2.6/http/classes/class_wfs_conf.php
===================================================================
--- branches/2.6/http/classes/class_wfs_conf.php 2009-07-06 13:39:29 UTC (rev 4312)
+++ branches/2.6/http/classes/class_wfs_conf.php 2009-07-06 16:29:57 UTC (rev 4313)
@@ -1,7 +1,7 @@
<?php
# $Id$
# http://www.mapbender.org/index.php/class_wfs_conf.php
-# Copyright (C) 2002 CCGIS
+# Copyright (C) 2002 CCGIS
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,23 +31,23 @@
function __construct () {
}
-
+
function __toString () {
$json = new Mapbender_JSON();
return $json->encode($this->confArray);
}
-
+
/**
* Loads WFS conf data from the database
- *
+ *
* @return Object WFS conf data.
* @param $idOrIdArray Object May be an integer or an array of integers representing WFS conf IDs.
*/
public function load ($idOrIdArray) {
// Check parameter and set idArray
if (isset($idOrIdArray)){
-
- // parameter is a number
+
+ // parameter is a number
if (!is_array($idOrIdArray) && is_numeric($idOrIdArray)) {
$idOrIdArray = array(intval($idOrIdArray));
}
@@ -82,13 +82,13 @@
return null;
}
}
-
+
// --------------------------- private -----------------------------------
/**
* Gets the database content for a number of WFS configurations given by their IDs.
- *
+ *
* @return Array
* @param $idArray Array an array of integer values representing WFS conf IDs.
*/
@@ -98,7 +98,7 @@
$sql = "SELECT * FROM wfs_conf ";
$sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
$sql .= "WHERE wfs_conf.wfs_conf_id = $1 LIMIT 1";
-
+
$v = array($id);
$t = array("i");
$res = db_prep_query($sql, $v, $t);
@@ -107,7 +107,7 @@
}
return $rowArray;
}
-
+
public static function getGeomColumnNameByConfId ($confId) {
$elArray = self::getWfsConfElementFromDb($confId);
foreach ($elArray as $element) {
@@ -117,10 +117,10 @@
}
return null;
}
-
+
/**
* Gets the database content of a WFS conf element given by a WFS conf ID.
- *
+ *
* @return Array
* @param $id Integer the WFS conf ID.
*/
@@ -134,7 +134,7 @@
$v = array($id);
$t = array('i');
$res = db_prep_query($sql, $v, $t);
-
+
$elementArray = array();
while ($row = db_fetch_array($res)) {
$currentElement = array("element_name" => $row["element_name"],
@@ -162,7 +162,7 @@
/**
* Gets the database content of a WFS feature type given by a WFS ID and a featuretype ID.
- *
+ *
* @return Array
* @param $wfsId Integer the WFS ID.
* @param $featuretypeId Integer the WFS featuretype ID.
@@ -171,35 +171,36 @@
$sql = "SELECT * FROM wfs_featuretype WHERE fkey_wfs_id = $1 AND featuretype_id = $2";
$v = array($wfsId, $featuretypeId);
$t = array("i", "i");
-
+
$res = db_prep_query($sql, $v, $t);
$currentRow = array();
-
+
if($row = db_fetch_array($res)){
$currentRow["featuretype_name"] = $row["featuretype_name"];
$currentRow["featuretype_srs"] = $row["featuretype_srs"];
}
-
+
return $currentRow;
}
-
+
/**
* get WFS conf data from database
*/
private function getWfsConfFromDB ($idArray) {
-
+
// if a user has access to some WFS confs...
if (count($idArray) > 0) {
// get WFS conf data from DB
$rowArray = self::getWfsConfFromDbByArray($idArray);
-
+
for ($i=0; $i < count($rowArray); $i++) {
-
- // WFS conf data
- $currentRow = array("g_label" => $rowArray[$i]["g_label"],
+
+ // WFS conf data
+ $currentRow = array("g_label" => $rowArray[$i]["g_label"],
"g_label_id" => $rowArray[$i]["g_label_id"],
+ "wfs_conf_abstract" => $rowArray[$i]["wfs_conf_abstract"],
"g_style" => $rowArray[$i]["g_style"],
"g_button" => $rowArray[$i]["g_button"],
"g_button_id" => $rowArray[$i]["g_button_id"],
@@ -232,14 +233,14 @@
return array();
}
}
-
+
}
/**
* @deprecated
*/
class wfs_conf{
-
+
var $wfs_id;
var $wfs_name;
var $wfs_title;
@@ -247,18 +248,18 @@
var $wfs_getcapabilities;
var $wfs_describefeaturetype;
var $wfs_getfeature;
-
+
var $features;
var $elements;
var $namespaces;
-
+
function getallwfs($userid){
$this->wfs_id = array();
$this->wfs_name = array();
$this->wfs_title = array();
$this->wfs_abstract = array();
-
+
global $DBSERVER,$DB,$OWNER,$PW;
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db($DB,$con);
@@ -272,7 +273,7 @@
$sql = "SELECT * FROM wfs";
$res = db_query($sql);
}
-
+
$cnt = 0;
while ($row = db_fetch_array($res)){
$this->wfs_version[$cnt] = $row["wfs_version"];
@@ -284,7 +285,7 @@
$this->wfs_describefeaturetype[$cnt] = $row["wfs_describefeaturetype"];
$this->wfs_getfeature[$cnt] = $row["wfs_getfeature"];
$cnt++;
- }
+ }
}
function getfeatures($wfsid){
$this->features = new features($wfsid);
@@ -297,19 +298,19 @@
}
}
class features extends wfs_conf{
-
+
var $featuretype_id;
var $featuretype_name;
var $featuretype_title;
var $featuretype_srs;
-
- function features($id){
-
+
+ function features($id){
+
$featuretype_id = array();
$featuretype_name = array();
$featuretype_title = array();
$featuretype_srs = array();
-
+
global $DBSERVER,$DB,$OWNER,$PW;
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db($DB,$con);
@@ -324,21 +325,21 @@
$this->featuretype_title[$cnt] = $row["featuretype_title"];
$this->featuretype_srs[$cnt] = $row["featuretype_srs"];
$cnt++;
- }
- }
+ }
+ }
}
class elements extends wfs_conf{
-
+
var $element_id;
var $element_name;
var $element_type;
-
+
function elements($fid){
-
+
$element_id = array();
$element_name = array();
$element_type = array();
-
+
global $DBSERVER,$DB,$OWNER,$PW;
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db($DB,$con);
@@ -356,15 +357,15 @@
}
}
class namespaces extends wfs_conf{
-
+
var $namespace_name;
var $namespace_location;
-
+
function namespaces($fid){
-
+
$namespace_name = array();
$namespace_location = array();
-
+
global $DBSERVER,$DB,$OWNER,$PW;
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db($DB,$con);
Modified: branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php 2009-07-06 13:39:29 UTC (rev 4312)
+++ branches/2.6/http/javascripts/mod_wfs_gazetteer_client.php 2009-07-06 16:29:57 UTC (rev 4313)
@@ -1,8 +1,8 @@
-<?php
+<?php
# $Id$
# maintained by http://www.mapbender.org/index.php/User:Verena Diewald
# http://www.mapbender.org/index.php/WFS_gazetteer
-# Copyright (C) 2002 CCGIS
+# Copyright (C) 2002 CCGIS
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,14 +27,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
<title>mod_wfs_gazetteer</title>
<?php
include '../include/dyn_css.php';
?>
<script type="text/javascript">
-<?php
+<?php
include '../include/dyn_js.php';
include '../include/dyn_php.php';
include(dirname(__FILE__) . "/../../conf/" . $wfs_spatial_request_conf_filename);
@@ -145,9 +145,9 @@
function wfsInitFunction (j) {
var functionCall = "parent.mb_regButton_frame('initWfsButton', '"+frameName+"', "+j+")";
- var x = new Function ("", functionCall);
+ var x = new Function ("", functionCall);
x();
-}
+}
function initWfsButton(ind, pos) {
parent.mb_button[ind] = document.getElementById(buttonWfs_id[pos]);
@@ -165,7 +165,7 @@
mod_wfs_spatialRequest_height = parent.mb_mapObj[ind].height;
mod_wfs_spatialRequest_epsg = parent.mb_mapObj[ind].epsg;
parent.mb_registerPanSubElement("measuring");
-}
+}
function displayButtons() {
for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
@@ -193,7 +193,7 @@
el.onmousedown = null;
el.onmouseup = null;
el.onmousemove = null;
-
+
if (obj.id == button_point) {
if (activeButton == null) {
activeButton = obj;
@@ -238,7 +238,7 @@
spatialRequestGeom = queryGeom;
}
parent.mb_disableThisButton(selectedType);
-
+
// spatialRequestGeom is a Geometry, but for the highlight
// a MultiGeometry is needed.
var multiGeom;
@@ -262,11 +262,11 @@
multiGeom = new parent.MultiGeometry(spatialRequestGeom.geomType);
multiGeom.add(spatialRequestGeom);
}
-
+
// add highlight of geometry
requestGeometryHighlight.add(multiGeom);
requestGeometryHighlight.paint();
-
+
});
}
@@ -303,7 +303,7 @@
// rebuild form
initModWfsGazetteer();
}
-
+
}
function removeChildNodes(node) {
@@ -316,7 +316,7 @@
/**
* removes whitespaces and endlines before and after a string
*
- */
+ */
function trimString (str) {
return str.replace(/^\s+|\s+|\n+$/g, '');
}
@@ -341,7 +341,7 @@
styleObj=document.createElement("style");
styleObj.setAttribute("type","text/css");
document.getElementsByTagName("head")[0].appendChild(styleObj);
- styleObj.appendChild(document.createTextNode(rule+"\n"));
+ styleObj.appendChild(document.createTextNode(rule+"\n"));
}
}
@@ -356,14 +356,14 @@
var currentNode = document.getElementById(currentId);
removeChildNodes(currentNode);
}
-
+
geomArray = new parent.GeometryArray();
parent.mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString:wfsConfIdString}, function(json, status) {
global_wfsConfObj = json;
var wfsCount = 0;
for (var wfsConfId in global_wfsConfObj) {
- global_selectedWfsConfId = wfsConfId;
+ global_selectedWfsConfId = wfsConfId;
if (typeof(global_wfsConfObj[wfsConfId] != 'function')) {
wfsCount++;
}
@@ -377,23 +377,23 @@
}
else {
appendWfsConfSelectBox();
-
+
}
parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
});
-
+
// creates a Highlight object for the request geometry
var styleProperties = {"position":"absolute", "top":"0px", "left":"0px", "z-index":100};
requestGeometryHighlight = new parent.Highlight(targetArray, "requestGeometryHighlight", styleProperties, 2);
parent.mb_registerSubFunctions("window.frames['" + frameName +"'].requestGeometryHighlight.paint()");
-
+
}
function setWfsInfo() {
-
+
var bodyNode = document.getElementById("wfsIcons");
removeChildNodes(bodyNode);
- var bulbNode = document.createElement("a");
+ var bulbNode = document.createElement("a");
bulbNode.name = "wfsInfo";
bulbNode.id = "wfsInfo";
bodyNode.appendChild(bulbNode);
@@ -409,7 +409,7 @@
bulbNode.appendChild(imgNode);
bulbNode.href = "javascript:openwindow('../php/mod_featuretypeMetadata.php?wfs_conf_id=" + global_selectedWfsConfId.toString() + "');";
bulbNode.style.visibility = "visible";
-
+
// set image: remove this WFS
var wfsRemoveNode = document.createElement("img");
wfsRemoveNode.name = "wfsRemove";
@@ -422,8 +422,8 @@
// Internet explorer
if (parent.ie) {
wfsRemoveNode.onclick = function() {
- var x = new Function ("", "delete global_wfsConfObj[global_selectedWfsConfId];setWfsConfIdString();initModWfsGazetteer();parent.mb_setWmcExtensionData({'wfsConfIdString':wfsConfIdString});");
- x();
+ var x = new Function ("", "delete global_wfsConfObj[global_selectedWfsConfId];setWfsConfIdString();initModWfsGazetteer();parent.mb_setWmcExtensionData({'wfsConfIdString':wfsConfIdString});");
+ x();
};
}
// Firefox
@@ -431,10 +431,10 @@
wfsRemoveNode.onclick = function () {
delete global_wfsConfObj[global_selectedWfsConfId];
setWfsConfIdString();
- initModWfsGazetteer();
+ initModWfsGazetteer();
parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
}
- }
+ }
// set wfsGeomType image
var wfsGeomTypeNode = document.createElement("img");
wfsGeomTypeNode.name = "wfsGeomType";
@@ -467,7 +467,7 @@
function setWfsConfIdString() {
var str = [];
for (var wfsConfId in global_wfsConfObj) {
- global_selectedWfsConfId = wfsConfId;
+ global_selectedWfsConfId = wfsConfId;
if (typeof(global_wfsConfObj[wfsConfId] != 'function')) {
str.push(wfsConfId);
}
@@ -498,9 +498,9 @@
var isSelected = false;
for (var wfsConfId in global_wfsConfObj) {
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;
@@ -512,7 +512,7 @@
var form = document.getElementById('selectWfsConfForm');
form.appendChild(selectNode);
-
+
appendStyles();
appendWfsForm();
}
@@ -525,12 +525,12 @@
removeChildNodes(form);
var resultDiv = document.getElementById("res");
removeChildNodes(resultDiv);
-
+
var divContainer = document.createElement("div");
divContainer.className = global_wfsConfObj[global_selectedWfsConfId].g_label_id;
-
+
divContainer.innerHTML = global_wfsConfObj[global_selectedWfsConfId].g_label;
-
+
form.appendChild(divContainer);
var wfsConfElementArray = global_wfsConfObj[global_selectedWfsConfId].element;
@@ -551,7 +551,7 @@
inputNode.id = wfsConfElementArray[i].element_name+"Checkbox";
inputNode.innerHTML = wfsConfElementArray[i].f_form_element_html;
}
- else{
+ else{
var inputNode = document.createElement("input");
inputNode.type = "text";
inputNode.className = wfsConfElementArray[i].f_style_id;
@@ -564,7 +564,7 @@
}
form.appendChild(spanNode);
form.appendChild(inputNode);
-
+
//build imgNode for datepicker image
if(wfsConfElementArray[i].f_form_element_html.match(/datepicker/)){
var imgNode = document.createElement("span");
@@ -581,9 +581,9 @@
submitButton.id = "submitButton";
submitButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
submitButton.value = global_wfsConfObj[global_selectedWfsConfId].g_button;
-
+
form.appendChild(submitButton);
-
+
var delFilterButton = document.createElement("input");
delFilterButton.type = "button";
delFilterButton.style.marginLeft = "5px";
@@ -592,8 +592,8 @@
// Internet explorer
if (parent.ie) {
delFilterButton.onclick = function() {
- var x = new Function ("", "clearFilter();");
- x();
+ var x = new Function ("", "clearFilter();");
+ x();
};
}
// Firefox
@@ -603,7 +603,7 @@
}
}
form.appendChild(delFilterButton);
-
+
checkSrs();
}
@@ -618,7 +618,7 @@
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;
}
@@ -634,17 +634,17 @@
if (parseInt(wfsConfElementArray[i].f_search)) {
if(wfsConfElementArray[i].f_form_element_html.match(/checkbox/)){
var elementArray = document.getElementsByName(wfsConfElementArray[i].element_name);
- for (var j = 0; j < elementArray.length; j++){
+ for (var j = 0; j < elementArray.length; j++){
elementArray[j].checked = "";
}
document.getElementById('checkAll').checked = "";
}
else{
- document.getElementById(wfsConfElementArray[i].element_name).value = "";
+ document.getElementById(wfsConfElementArray[i].element_name).value = "";
}
- }
+ }
}
-
+
//remove geometry from spatialrequest, remove drawn rectangle or polygon and hint
spatialRequestGeom = null;
requestGeometryHighlight.clean();
@@ -652,7 +652,7 @@
if(document.getElementById('spatialResHint')){
document.getElementById("spatialResHint").innerHTML = "";
}
-
+
//remove result popup
if(typeof(resultGeometryPopup)!="undefined"){
resultGeometryPopup.destroy();
@@ -661,7 +661,7 @@
if(typeof(wfsPopup)!="undefined"){
wfsPopup.destroy();
}
-
+
if(document.getElementById('spatialResHint')){
document.getElementById("spatialResHint").innerHTML = "";
}
@@ -673,7 +673,7 @@
var el = global_wfsConfObj[global_selectedWfsConfId].element;
inputNotEnough = [];
for (var i = 0; i < el.length; i++){
-
+
if( el[i]['f_search'] == 1){
if(el[i]['f_form_element_html'].match(/\<select/)){
var elementValue = document.getElementById(el[i]['element_name']).options[document.getElementById(el[i]['element_name']).selectedIndex].value;
@@ -681,8 +681,8 @@
else if(el[i]['f_form_element_html'].match(/checkbox/)){
var elementArray = document.getElementsByName(el[i]['element_name']);
var selectedVal = [];
- for (var j = 0; j < elementArray.length; j++){
- if (elementArray[j].checked == true){
+ for (var j = 0; j < elementArray.length; j++){
+ if (elementArray[j].checked == true){
selectedVal.push(elementArray[j].value);
}
}
@@ -691,7 +691,7 @@
else{
var elementValue = document.getElementById(el[i]['element_name']).value;
}
-
+
if (elementValue != '') {
cnt++;
}
@@ -700,17 +700,17 @@
}
}
}
-
+
if(inputNotEnough.length>0){
alert("Mandatory fields: "+inputNotEnough.join(', '));
return false;
}
-
+
// if(spatialRequestGeom == null){
// alert("Bitte räumliche Eingrenzung vornehmen.");
// return false;
// }
-
+
return cnt;
}
function validate(){
@@ -726,7 +726,7 @@
global_resultHighlight = new parent.Highlight(targetArray, "wfs_gazetteer_highlight", {"position":"absolute", "top":"0px", "left":"0px", "z-index":100}, 2);
var filterParameterCount = getNumberOfFilterParameters();
-
+
if(filterParameterCount == 0 && spatialRequestGeom == null){
//if(filterParameterCount == 0){
//alert("Please specify at least one filter attribute.");
@@ -735,10 +735,10 @@
else{
if(inputNotEnough.length==0){
var andConditions = "";
-
+
var el = global_wfsConfObj[global_selectedWfsConfId].element;
var srs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
-
+
for (var i = 0; i < el.length; i++) {
if (el[i]['f_search'] == 1){
if(el[i]['f_form_element_html'].match(/\<select/)){
@@ -747,8 +747,8 @@
else if(el[i]['f_form_element_html'].match(/checkbox/)){
var elementArray = document.getElementsByName(el[i]['element_name']);
var selectedVal = [];
- for (var j = 0; j < elementArray.length; j++){
- if (elementArray[j].checked == true){
+ for (var j = 0; j < elementArray.length; j++){
+ if (elementArray[j].checked == true){
selectedVal.push(elementArray[j].value);
}
}
@@ -758,7 +758,7 @@
var elementValue = document.getElementById(el[i]['element_name']).value;
}
}
-
+
if (el[i]['f_search'] == 1 && elementValue != '') {
var a = new Array();
a = elementValue.split(",");
@@ -877,10 +877,10 @@
}
}
}
-
+
if(spatialRequestGeom!=null){
if(spatialRequestGeom.geomType == "polygon"){
- if(buttonPolygon.filteroption=='within'){
+ if(buttonPolygon.filteroption=='within'){
andConditions += "<Within><ogc:PropertyName>";
for (var j=0; j < el.length; j++) {
if(el[j]['f_geom']==1){
@@ -906,7 +906,7 @@
}
}
andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
- andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+ andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
for(var k=0; k<spatialRequestGeom.count(); k++){
if(k>0) andConditions += " ";
andConditions += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
@@ -914,12 +914,12 @@
andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
andConditions += "</gml:Polygon></Intersects>";
}
- }
+ }
else if(spatialRequestGeom.geomType == "line"){
var rectangle = [];
rectangle = spatialRequestGeom.getBBox();
-
- if(buttonRectangle.filteroption=='within'){
+
+ if(buttonRectangle.filteroption=='within'){
andConditions += "<Within><ogc:PropertyName>";
for (var j=0; j < el.length; j++) {
if(el[j]['f_geom']==1){
@@ -950,7 +950,7 @@
}
}
andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
- andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+ andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
andConditions += rectangle[0].x+","+rectangle[0].y;
andConditions += " ";
andConditions += rectangle[0].x+","+rectangle[1].y;
@@ -962,13 +962,13 @@
andConditions += rectangle[0].x+","+rectangle[0].y;
andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
andConditions += "</gml:Polygon></Intersects>";
- }
+ }
}
else if(spatialRequestGeom.geomType == "point"){
var tmp = spatialRequestGeom.get(0);
var mapPos = parent.makeRealWorld2mapPos("mapframe1",tmp.x, tmp.y);
var buffer = mb_wfs_tolerance/2;
- var mapPosXAddPix = mapPos[0] + buffer;
+ var mapPosXAddPix = mapPos[0] + buffer;
var mapPosYAddPix = mapPos[1] +buffer;
var mapPosXRemovePix = mapPos[0] - buffer;
var mapPosYRemovePix = mapPos[1] - buffer;
@@ -983,47 +983,47 @@
andConditions += el[j]['element_name'];
}
}
- andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+ andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
andConditions += realWorld1[0] + "," + realWorld1[1] + " " + realWorld2[0] + "," + realWorld2[1] + " ";
- andConditions += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1];
+ andConditions += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1];
andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects>";
}
//andConditions += "<ogc:Not><ogc:PropertyIsNull>";
//andConditions += "<ogc:PropertyName>" + elementName + "</ogc:PropertyName>";
//andConditions += "</ogc:PropertyIsNull></ogc:Not>";
}
-
+
if (filterParameterCount > 1 || spatialRequestGeom != null) {
andConditions = "<And>" + andConditions + "</And>";
}
-
+
var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
-
+
document.getElementById("res").innerHTML = "<table><tr><td><img src='"+progressIndicatorImg+"'></td><td>"+progressIndicatorText+"</td></tr></table>";
var parameters = {
- "command" : "getSearchResults",
- "wfs_conf_id" : global_selectedWfsConfId,
+ "command" : "getSearchResults",
+ "wfs_conf_id" : global_selectedWfsConfId,
"typename" : global_wfsConfObj[global_selectedWfsConfId].featuretype_name,
- "frame" : this.name,
- "filter" : filter,
+ "frame" : this.name,
+ "filter" : filter,
"backlink" : ""
};
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>";
-
+
if(status=='success'){
for (var i=0; i < parent.wms.length; i++) {
for (var j=0; j < parent.wms[i].objLayer.length; j++) {
var currentLayer = parent.wms[i].objLayer[j];
- var wms_id = parent.wms[i].wms_id;
+ var wms_id = parent.wms[i].wms_id;
if (currentLayer.gui_layer_wfs_featuretype == global_selectedWfsConfId) {
- var layer_name = currentLayer.layer_name;
- parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'querylayer',1);
- parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'visible',1);
+ var layer_name = currentLayer.layer_name;
+ parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'querylayer',1);
+ parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'visible',1);
}
}
}
- var geoObj = eval('(' + jsCode + ')');
+ var geoObj = eval('(' + jsCode + ')');
if (jsCode) {
if (typeof(geoObj) == 'object') {
geomArray.importGeoJSON(geoObj);
@@ -1045,7 +1045,7 @@
else{
return false;
}
- }
+ }
//spatialRequestGeom = null;
return false;
}
@@ -1058,7 +1058,7 @@
else{
var contentHtml = "No results.";
}
-
+
if(showResultInPopup==1){
if (typeof(resultGeometryPopup) == "undefined") {
resultGeometryPopup = new parent.mb_popup(searchPopupTitle,contentHtml,searchPopupWidth,searchPopupHeight,searchPopupX,searchPopupY);
@@ -1070,13 +1070,13 @@
resultGeometryPopup.show();
parent.$("#resultTable").tablesorter({
sortList: [[0,0]],
- widgets: ['zebra']
+ widgets: ['zebra']
});
}
else{
document.getElementById("res").innerHTML = contentHtml;
}
-}
+}
function createListOfGeometries(){
if(showResultInPopup==1){
@@ -1089,7 +1089,7 @@
var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
var labelArray = [];
if (geomArray.count() > 0) {
-
+
if(showResultInPopup==1){
listOfGeom += "<thead><tr>";
var labelObj = getListTitle();
@@ -1100,7 +1100,7 @@
}
listOfGeom += "</tr></thead>";
}
- listOfGeom += "<tbody>";
+ listOfGeom += "<tbody>";
for (var i = 0 ; i < geomArray.count(); i ++) {
if (geomArray.get(i).get(-1).isComplete()) {
listOfGeom += "<tr>\n";
@@ -1129,13 +1129,13 @@
listOfGeom += " onclick=\""+domPath+"setResult('click',"+i+"); "+domPath+"showWfs("+i+");\" ";
listOfGeom += ">"+ resultElObj[l] +"</td>";
}
- }
- listOfGeom += "\t</tr>\n";
+ }
+ listOfGeom += "\t</tr>\n";
}
}
}
listOfGeom += "</tbody></table></form>\n";
- return listOfGeom;
+ return listOfGeom;
}
function getListTitle(){
@@ -1149,7 +1149,7 @@
}
return labelArray;
}
-
+
function getListValues(geom){
var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
var resultArray = [];
@@ -1217,9 +1217,9 @@
for(var key in currentDetail){
var currentDetailName = key;
var currentDetailValue = currentDetail[key];
- resultHtml +="<tr><td>\n";
+ resultHtml +="<tr><td>\n";
resultHtml += currentDetailName;
- resultHtml +="</td>\n";
+ resultHtml +="</td>\n";
resultHtml += "<td>\n";
resultHtml += currentDetailValue;
resultHtml += "</td></tr>\n";
More information about the Mapbender_commits
mailing list