[Mapbender-commits] r2870 - branches/nimix_dev/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Aug 18 12:12:00 EDT 2008
Author: nimix
Date: 2008-08-18 12:12:00 -0400 (Mon, 18 Aug 2008)
New Revision: 2870
Removed:
branches/nimix_dev/http/javascripts/mod_gazetteerSQL_client.php
branches/nimix_dev/http/javascripts/mod_wfs_gazetteer_client.php
Modified:
branches/nimix_dev/http/javascripts/geometry.js
branches/nimix_dev/http/javascripts/map.js
branches/nimix_dev/http/javascripts/map.php
branches/nimix_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php
branches/nimix_dev/http/javascripts/mod_digitize_tab.php
branches/nimix_dev/http/javascripts/mod_dragMapSize.php
branches/nimix_dev/http/javascripts/mod_loadwmc.php
branches/nimix_dev/http/javascripts/mod_log.php
branches/nimix_dev/http/javascripts/mod_savewmc.php
branches/nimix_dev/http/javascripts/mod_setBackground.php
branches/nimix_dev/http/javascripts/mod_tab.js
branches/nimix_dev/http/javascripts/mod_wfs_SpatialRequest.php
branches/nimix_dev/http/javascripts/mod_wfs_client.html
branches/nimix_dev/http/javascripts/wfs.js
Log:
merge
Modified: branches/nimix_dev/http/javascripts/geometry.js
===================================================================
--- branches/nimix_dev/http/javascripts/geometry.js 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/geometry.js 2008-08-18 16:12:00 UTC (rev 2870)
@@ -348,15 +348,15 @@
// MULTILINESTRING
//
this.addMember(geomType.line);
- this.get(-1).addGeometry();
for (var m = 0; m < coordinates.length; m++) {
+ this.get(-1).addGeometry();
var currentLine = coordinates[m];
for (var n = 0; n < currentLine.length; n++) {
var currentPoint = currentLine[n];
this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
}
+ this.getGeometry(-1,-1).setEpsg(featureEpsg);
}
- this.getGeometry(-1,-1).setEpsg(featureEpsg);
this.close();
break;
@@ -372,8 +372,8 @@
var currentPoint = currentPolygon[n];
this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
}
+ this.getGeometry(-1,-1).setEpsg(featureEpsg);
}
- this.getGeometry(-1,-1).setEpsg(featureEpsg);
this.close();
break;
@@ -389,8 +389,8 @@
var currentPoint = currentPolygon[n];
this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
}
+ this.getGeometry(-1,-1).setEpsg(featureEpsg);
}
- this.getGeometry(-1,-1).setEpsg(featureEpsg);
this.close();
break;
@@ -1057,6 +1057,19 @@
};
/**
+ * removes an element with a given name. If an element with this name exists, it is removed.
+ *
+ * @param {String} aName the name of the element to delete
+ */
+ this.delElement = function(aName){
+ var i = this.getElementIndexByName(aName);
+ if (i !== false) {
+ name.splice(i, 1);
+ value.splice(i, 1);
+ }
+ }
+
+ /**
* checks if an index is valid
*
* @private
@@ -1143,7 +1156,7 @@
* @param {String} col a color
* @private
*/
- this.drawGeometry = function(t,g,col){
+ this.drawGeometry = function(t,g,col){
if(t == geomType.point) {
var poiIcon = g.e.getElementValueByName("Mapbender:icon");
for(var i=0, ilen = g.count(); i < ilen; i++){
@@ -1200,7 +1213,7 @@
*/
this.isTooSmall = function(g){
// TODO switch between dot, original, circle
- return false;
+// return false;
var tmp = g.getBBox();
var min = realToMap(mapframe,tmp[0]);
@@ -1262,17 +1275,27 @@
* @param {Float} y y coordinate within the map frame
*/
var displayIcon = function (url, x, y) {
- var newImg = document.createElement("img");
- newImg.src = url;
- newImg.className = "mapsymbol";
- newImg.style.cursor = "help";
- newImg.style.position = "absolute";
-
- // center the image at x, y
- newImg.style.top = y - Math.round(newImg.height/2);
- newImg.style.left = x - Math.round(newImg.width/2);
- newImg.style.zIndex = 100;
- that.canvasDivTag.getTag().appendChild(newImg);
+ if(ie){
+ var newImg = document.createElement("img");
+ var newImgTop = y - Math.round(80/2);
+ var newImgLeft = x - Math.round(80/2);
+ that.canvasDivTag.getTag().innerHTML = "<img src='" + url + "' style='position:absolute;top:"+newImgTop+";left:"+newImgLeft+";z-index:100'/>";
+ }
+ else{
+ var newImg = document.createElement("img");
+ newImg.src = url;
+ that.canvasDivTag.getTag().appendChild(newImg);
+ //newImg.className = "mapsymbol";
+ //newImg.style.cursor = "help";
+ newImg.style.position = "absolute";
+
+ // center the image at x, y
+ newImg.style.top = y - Math.round(80/2);
+ newImg.style.left = x - Math.round(80/2);
+ // newImg.style.top = y - Math.round(80);
+ // newImg.style.left = x;
+ newImg.style.zIndex = 100;
+ }
};
/**
@@ -1291,6 +1314,10 @@
var mapObjInd = getMapObjIndexByName(mapframe);
var mapframeWidth = mb_mapObj[mapObjInd].width;
var mapframeHeight = mb_mapObj[mapObjInd].height;
+ eventResizeMap.register(function () {
+ mapframeWidth = mb_mapObj[mapObjInd].width;
+ mapframeHeight = mb_mapObj[mapObjInd].height;
+ });
var style = aStyle;
var canvas = new jsGraphics(aTagName, window.frames[mapframe]);
canvas.setStroke(lineWidth);
Modified: branches/nimix_dev/http/javascripts/map.js
===================================================================
--- branches/nimix_dev/http/javascripts/map.js 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/map.js 2008-08-18 16:12:00 UTC (rev 2870)
@@ -232,11 +232,14 @@
}
}
- var imageString = "<img id='"+myMapId+"' name='mapimage' ";
- imageString += "src='" + newMapURL + "' ";
- imageString += "width='"+currentMapObject.width+"' ";
- imageString += "height='"+currentMapObject.height+"' ";
- imageString += "border='0'>";
+ var imageString = "";
+ if (newMapURL) {
+ imageString = "<img id='"+myMapId+"' name='mapimage' ";
+ imageString += "src='" + newMapURL + "' ";
+ imageString += "width='"+currentMapObject.width+"' ";
+ imageString += "height='"+currentMapObject.height+"' ";
+ imageString += "border='0'>";
+ }
var newMapRequest = "<div id='"+myDivId+"' ";
newMapRequest += "style=\"position:absolute; top:0px; left:0px; ";
@@ -409,7 +412,14 @@
else if(path && validation){
newfeatureInfoRequest += requestParams;
try{
- var p = new mb_popup("Feature Info","url:"+path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr,300,400);
+ var p = new mb_popup({
+ title:"Feature Info",
+ url:path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr,
+ width:600,
+ height:500,
+ top:200,
+ left:600
+ });
p.show();
}catch(e){
window.open(path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
@@ -419,7 +429,14 @@
else if(validation){
newfeatureInfoRequest += requestParams;
try{
- var p = new mb_popup("Feature Info","url:"+newfeatureInfoRequest,300,400);
+ var p = new mb_popup({
+ title:"Feature Info",
+ url:newfeatureInfoRequest,
+ width:600,
+ height:500,
+ top:200,
+ left:600
+ });
p.show();
}
catch(e){
Modified: branches/nimix_dev/http/javascripts/map.php
===================================================================
--- branches/nimix_dev/http/javascripts/map.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/map.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -45,7 +45,6 @@
*/
$_SESSION["mb_user_gui"] = $gui_id;
-session_write_close();
ob_start();
header('Content-type: application/x-javascript');
@@ -169,4 +168,4 @@
}
}
}
-?>
\ No newline at end of file
+?>
Modified: branches/nimix_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -20,345 +20,372 @@
require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'>
-<title>Add WMS from Filtered Catalog</title>
-<STYLE TYPE="text/css">
-<!--
-body{
- font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
- font-size:10pt
-}
-
-table{
- font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
- font-size:11;
-}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-.wms_button{
- color: black;
- border: solid thin;
- height:22px;
- width:60px;
-}
--->
-</STYLE>
-<?php
-include '../include/dyn_css.php';
-?>
-<script type="text/javascript">
-<!--
-//set defaults of element vars
-try{if(option_all){}}catch(e){option_all='1';};
-try{if(option_group){}}catch(e){option_group='1';};
-try{if(option_gui){}}catch(e){option_gui='1';};
-try{if(option_dbgui){}}catch(e){option_dbgui='1';};
-try{if(option_dbgroup){}}catch(e){option_dbgroup='1';};
-try{if(option_dball){}}catch(e){option_dball='1';};
-try{if(capabilitiesInput){}}catch(e){capabilitiesInput='0';};
-try{if(gui_list){}}catch(e){gui_list=''};
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-var guis = gui_list.split(",");
-if(gui_list==='')
- guis = [];
+<head>
+ <meta http-equiv="cache-control" content="no-cache" />
+ <meta http-equiv="pragma" content="no-cache" />
+ <meta http-equiv="expires" content="0" />
+ <?php printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" />",CHARSET); ?>
+ <title>Add WMS</title>
+ <script type="text/javascript">
+ <!--
+ // Set default for element variables if they are undefined
+ option_all = (typeof(option_all) !== 'undefined') ? option_all : '1';
+ option_group = (typeof(option_group) !== 'undefined') ? option_group : '1';
+ option_gui = (typeof(option_gui) !== 'undefined') ? option_gui : '1';
+ option_dball = (typeof(option_dball) !== 'undefined') ? option_dball : '1';
+ option_dbgroup = (typeof(option_dbgroup) !== 'undefined') ? option_dbgroup : '1';
+ option_dbgui = (typeof(option_dbgui) !== 'undefined') ? option_dbgui : '1';
+ capabilitiesInput = (typeof(capabilitiesInput) !== 'undefined') ? capabilitiesInput : '0';
+ gui_list = (typeof(gui_list) !== 'undefined') ? gui_list : '';
-var global_source = "capabilities"; // "capabilities" || "db"
-var phpUrl = "../php/mod_addWMSfromfilteredList_server.php?<?php echo $urlParameters;?>";
+ var guis = gui_list.split(',');
+
+ if(gui_list === '') {
+ guis = [];
+ }
-// ----------------- Load service --------------------
+ var global_source = 'capabilities'; // [capabilities,db]
+ var phpUrl = '../php/mod_addWMSfromfilteredList_server.php?<?php echo $urlParameters;?>';
-function mod_addWMSfromDB(gui_id, wms_id) {
- window.opener.mod_addWMSById_load(gui_id, wms_id);
-}
+ // Load service
-function mod_addWMSfromfilteredList(pointer_name,version){
-//TODO: load active
- var load = false;
- var conjunctionCharacter = window.opener.mb_getConjunctionCharacter(pointer_name);
-
- if (version == '1.0.0') {
- load = pointer_name + conjunctionCharacter + "REQUEST=capabilities&WMTVER=1.0.0";
+ function mod_addWMSfromDB(gui_id,wms_id) {
+ parent.mod_addWMSById_load(gui_id,wms_id);
}
- else if (version == '1.1.0' || version == '1.1.1') {
- load = pointer_name + conjunctionCharacter + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=" + version;
+
+ function mod_addWMSfromfilteredList(pointer_name,version){
+ //TODO: load active
+ var load = false;
+ var conjunctionCharacter = parent.mb_getConjunctionCharacter(pointer_name);
+
+ if(version == '1.0.0') {
+ load = pointer_name + conjunctionCharacter + 'REQUEST=capabilities&WMTVER=1.0.0';
+ }
+ else if(version == '1.1.0' || version == '1.1.1') {
+ load = pointer_name + conjunctionCharacter + 'REQUEST=GetCapabilities&SERVICE=WMS&VERSION=' + version;
+ }
+ if(load !== false) {
+ parent.mod_addWMS_load(load);
+ }
}
- if (load !== false) {
- window.opener.mod_addWMS_load(load);
+
+ function mod_addWmsfromURL(){
+ var capabilities = document.getElementById('CapURL').value;
+ parent.mod_addWMS_load(capabilities);
}
-}
-function mod_addWmsfromURL(){
- cap = document.getElementById("CapURL").value;
- window.opener.mod_addWMS_load(cap);
-}
+ // Retrieve data
-// ----------------- Retrieve data --------------------
+ function setSource(sourceValue) {
+ global_source = sourceValue;
+ }
-function setSource(sourceValue) {
- global_source = sourceValue;
-}
+ function getGroups() {
+ imageOn();
+ parent.mb_ajax_json(phpUrl, {"command":"getGroups"}, function (json, status) {
+ imageOff();
+ displayGroups(json.group);
+ });
+ }
-function getGroups() {
- imageOn();
- window.opener.mb_ajax_json(phpUrl, {"command":"getGroups"}, function (json, status) {
- imageOff();
- displayGroups(json.group);
- });
-}
+ function getGUIs() {
+ imageOn();
+ parent.mb_ajax_json(phpUrl, {"command":"getGUIs"}, function (json, status) {
+ imageOff();
+ displayGUIs(json.gui);
+ });
+ }
-function getGUIs() {
- imageOn();
- window.opener.mb_ajax_json(phpUrl, {"command":"getGUIs"}, function (json, status) {
- imageOff();
- displayGUIs(json.gui);
- });
-}
+ function getWMSByGUI(guiId) {
+ if(guiId=="")
+ return getAllWMS();
+ imageOn();
+ parent.mb_ajax_json(phpUrl, {"command":"getWMSByGUI", "guiId":guiId}, function (json, status) {
+ imageOff();
+ displayWMS(json.wms, guiId);
+ });
+ }
-function getWMSByGUI(guiId) {
- if(guiId=="")
- return getAllWMS();
- imageOn();
- window.opener.mb_ajax_json(phpUrl, {"command":"getWMSByGUI", "guiId":guiId}, function (json, status) {
- imageOff();
- displayWMS(json.wms);
- });
-}
+ function getWMSByGroup(groupId) {
+ imageOn();
+ parent.mb_ajax_json(phpUrl, {"command":"getWMSByGroup", "groupId":groupId}, function (json, status) {
+ imageOff();
+ displayWMS(json.wms);
+ });
+ }
-function getWMSByGroup(groupId) {
- imageOn();
- window.opener.mb_ajax_json(phpUrl, {"command":"getWMSByGroup", "groupId":groupId}, function (json, status) {
- imageOff();
- displayWMS(json.wms);
- });
-}
+ function getAllWMS() {
+ imageOn();
+ parent.mb_ajax_json(phpUrl, {"command":"getAllWMS"}, function (json, status) {
+ imageOff();
+ displayWMS(json.wms);
+ });
+ }
-function getAllWMS() {
- imageOn();
- window.opener.mb_ajax_json(phpUrl, {"command":"getAllWMS"}, function (json, status) {
- imageOff();
- displayWMS(json.wms);
- });
-}
+ // ----------------- Display results --------------------
-// ----------------- Display results --------------------
+ function removeChildNodes(node) {
+ while (node.childNodes.length > 0) {
+ var childNode = node.firstChild;
+ node.removeChild(childNode);
+ }
+ }
-function removeChildNodes(node) {
- while (node.childNodes.length > 0) {
- var childNode = node.firstChild;
- node.removeChild(childNode);
+ function setTableHeader(text,titleLeft,titleRight) {
+ document.getElementById('resultString').innerHTML = text;
+ document.getElementById('titleLeft').innerHTML = titleLeft;
+ document.getElementById('titleRight').innerHTML = titleRight;
+
+ removeChildNodes(document.getElementById('resultTableBody'));
}
-}
-function setTableHeader(text, titleLeft, titleRight) {
- document.getElementById("resultTable").style.visibility = 'visible';
- document.getElementById("resultString").innerHTML = text;
- document.getElementById("titleLeft").innerHTML = titleLeft;
- document.getElementById("titleRight").innerHTML = titleRight;
- removeChildNodes(document.getElementById("resultTableBody"));
-}
+ function addTableRow(leftText,rightText,onClick) {
+ var resultTableBoy = document.getElementById('resultTableBody');
+ var leftTableCell = document.createElement('td');
+ var rightTableCell = document.createElement('td');
+ var leftTableCellContent = document.createElement('strong');
+ var rightTableCellContent = document.createElement('em');
+ var tableRow = document.createElement('tr');
+
+ leftTableCellContent.innerHTML = leftText;
+ rightTableCellContent.innerHTML = rightText;
-function addRow(tableId, leftText, rightText, onClick) {
- var leftNode = document.createElement("td");
- var leftDivNode = createDiv(leftText, onClick);
- leftNode.appendChild(leftDivNode);
+ leftTableCell.appendChild(leftTableCellContent);
+ rightTableCell.appendChild(rightTableCellContent);
+ tableRow.appendChild(leftTableCell);
+ tableRow.appendChild(rightTableCell);
+
+ tableRow.setAttribute('onclick',onClick);
- var rightNode = document.createElement("td");
- var rightDivNode = createDiv(rightText, onClick);
- rightNode.appendChild(rightDivNode);
+ if(resultTableBoy.childNodes.length % 2 !== 0) {
+ tableRow.className += tableRow.className + ' alternate';
+ }
- var rowNode = document.createElement("tr");
- rowNode.setAttribute("onmouseover", "this.style.backgroundColor = \"#F08080\"");
- rowNode.setAttribute("onmouseout", "this.style.backgroundColor = \"#FFFFFF\"");
- rowNode.appendChild(leftNode);
- rowNode.appendChild(rightNode);
-
- document.getElementById(tableId).appendChild(rowNode);
-}
+ resultTableBoy.appendChild(tableRow);
+ }
-function createDiv(text, onClick) {
- var divNode = document.createElement("div");
- divNode.style.cursor = "pointer";
- divNode.setAttribute("onclick", onClick);
- divNode.innerHTML = text;
- return divNode;
-}
+ function imageOn() {
+ document.getElementById("progressIndicator").style.visibility = "visible";
+ document.getElementById("progressIndicator").style.display = "block";
+ document.getElementById("resultTable").style.visibility = "hidden";
+ document.getElementById("resultTable").style.display = "none";
+ document.getElementById("resultString").style.visibility = "hidden";
+ document.getElementById("resultString").style.display = "none";
+ }
-function imageOn() {
- document.getElementById("searchImage").style.visibility = "visible";
- document.getElementById("resultTable").style.visibility = "hidden";
- document.getElementById("resultString").style.visibility = "hidden";
-}
+ function imageOff() {
+ document.getElementById("progressIndicator").style.visibility = "hidden";
+ document.getElementById("progressIndicator").style.display = "none";
+ document.getElementById("resultTable").style.visibility = "visible";
+ document.getElementById("resultTable").style.display = "block";
+ document.getElementById("resultString").style.visibility = "visible";
+ document.getElementById("resultString").style.display = "block";
+ }
-function imageOff() {
- document.getElementById("searchImage").style.visibility = "hidden";
- document.getElementById("resultTable").style.visibility = "visible";
- document.getElementById("resultString").style.visibility = "visible";
-}
+ function noResult() {
+ document.getElementById("resultTable").style.visibility = 'hidden';
+ document.getElementById("resultString").innerHTML = noResultText;
+ }
-function noResult() {
- document.getElementById("resultTable").style.visibility = 'hidden';
- document.getElementById("resultString").innerHTML = noResultText;
-}
+ function setButtons() {
+ var containerCapabilities = document.getElementById('container_capabilities');
+ var containerButtons = document.getElementById('container_buttons');
+ var optionButton = false;
-function setButtons() {
- //if only one is active load list imidiately
- if(parseInt(option_all)+parseInt(option_group)
- +parseInt(option_gui)+parseInt(option_dbgui)+
- parseInt(option_dbgroup)+parseInt(option_dball)===1){
- var child;
- if(option_all=='1')
- child = document.getElementById("button_all");
- else if(option_group=='1')
- child = document.getElementById("button_group");
- else if(option_gui=='1')
- child = document.getElementById("button_gui");
- else if(option_dbgui=='1')
- child = document.getElementById("button_dbGui");
- else if(option_dbgroup=='1')
- child = document.getElementById("button_dbGroup");
- else//if(option_dball=='1')
- child = document.getElementById("button_dbAll");
+ // If only one is active load list imidiately
+ if(
+ parseInt(option_all) +
+ parseInt(option_group) +
+ parseInt(option_gui) +
+ parseInt(option_dbgui) +
+ parseInt(option_dbgroup) +
+ parseInt(option_dball)
+ === 1) {
+ if(option_all === '1') {
+ optionButton = document.getElementById('button_all');
+ }
+ if(option_group === '1') {
+ optionButton = document.getElementById('button_group');
+ }
+ if(option_gui === '1') {
+ optionButton = document.getElementById('button_gui');
+ }
+ if(option_dball === '1'){
+ optionButton = document.getElementById('button_dbAll');
+ }
+ if(option_dbgroup === '1') {
+ optionButton = document.getElementById('button_dbGroup');
+ }
+ if(option_dbgui === '1') {
+ optionButton = document.getElementById('button_dbGui');
+ }
- child.onclick();
- child.parentNode.removeChild(child);
- }
-
- if (option_all == '0') {
- var child = document.getElementById("button_all");
- child.parentNode.removeChild(child);
- }
- if (option_group == '0') {
- var child = document.getElementById("button_group");
- child.parentNode.removeChild(child);
- }
- if (option_gui == '0') {
- var child = document.getElementById("button_gui");
- child.parentNode.removeChild(child);
- }
- if (option_dbgui == '0') {
- var child = document.getElementById("button_dbGui");
- child.parentNode.removeChild(child);
- }
- if (option_dbgroup == '0') {
- var child = document.getElementById("button_dbGroup");
- child.parentNode.removeChild(child);
- }
- if (option_dball == '0') {
- var child = document.getElementById("button_dbAll");
- child.parentNode.removeChild(child);
- }
- if (capabilitiesInput == '0') {
- var child = document.getElementById("capabilitiesForm");
- child.parentNode.removeChild(child);
- }
-}
+ if(optionButton) {
+ optionButton.onclick();
+ containerButtons.parentNode.removeChild(containerButtons);
+
+ return;
+ }
+ }
-function displayGroups (groupArray) {
- if (groupArray.length > 0) {
- setTableHeader(selectGroupText, groupNameText, groupAbstractText);
+ if(typeof(option_all) !== 'undefined' && option_all === '0') {
+ optionButton = document.getElementById('button_all');
+ optionButton.parentNode.removeChild(optionButton);
+ }
+ if(typeof(option_group) !== 'undefined' && option_group === '0') {
+ optionButton = document.getElementById('button_group');
+ optionButton.parentNode.removeChild(optionButton);
+ }
+ if(typeof(option_gui) !== 'undefined' && option_gui === '0') {
+ optionButton = document.getElementById('button_gui');
+ optionButton.parentNode.removeChild(optionButton);
+ }
+ if(option_dball === '0') {
+ optionButton = document.getElementById('button_dbAll');
+ optionButton.parentNode.removeChild(optionButton);
+ }
+ if(option_dbgroup === '0') {
+ optionButton = document.getElementById('button_dbGroup');
+ optionButton.parentNode.removeChild(optionButton);
+ }
+ if(option_dbgui === '0') {
+ optionButton = document.getElementById('button_dbGui');
+ optionButton.parentNode.removeChild(optionButton);
+ }
- for (var i = 0; i < groupArray.length; i++) {
- var onClick = "getWMSByGroup('" + groupArray[i].id + "')";
- addRow("resultTableBody", groupArray[i].name, groupArray[i].description, onClick);
+ if(capabilitiesInput === '0') {
+ optionButton = document.getElementById('capabilitiesForm');
+ optionButton.parentNode.removeChild(optionButton);
+ containerCapabilities.parentNode.removeChild(containerCapabilities);
}
}
- else {
- noResult();
+
+ function displayGroups (groupArray) {
+ if (groupArray.length > 0) {
+ setTableHeader(selectGroupText, groupNameText, groupAbstractText);
+
+ for (var i = 0; i < groupArray.length; i++) {
+ var onClick = "getWMSByGroup('" + groupArray[i].id + "')";
+ addTableRow(groupArray[i].name, groupArray[i].description, onClick);
+ }
+ }
+ else {
+ noResult();
+ }
}
-}
-function displayGUIs (guiArray) {
- if (guiArray.length > 0) {
- setTableHeader(selectGuiText, guiNameText, guiAbstractText);
-
- for (var i = 0; i < guiArray.length; i++) {
- var onClick = "getWMSByGUI('" + guiArray[i].id + "')";
- if(guis.length>0){
- for(var j=0; j < guis.length; j++){
- if(guiArray[i].id==guis[j]){
- addRow("resultTableBody", guiArray[i].name, guiArray[i].description, onClick);
- break;
+ function displayGUIs (guiArray) {
+ if (guiArray.length > 0) {
+ setTableHeader(selectGuiText, guiNameText, guiAbstractText);
+
+ for (var i = 0; i < guiArray.length; i++) {
+ var onClick = "getWMSByGUI('" + guiArray[i].id + "')";
+ if(guis.length>0){
+ for(var j=0; j < guis.length; j++){
+ if(guiArray[i].id==guis[j]){
+ addTableRow(guiArray[i].name, guiArray[i].description, onClick);
+ break;
+ }
}
}
+ else
+ addTableRow(guiArray[i].name, guiArray[i].description, onClick);
}
- else
- addRow("resultTableBody", guiArray[i].name, guiArray[i].description, onClick);
}
+ else {
+ noResult();
+ }
}
- else {
- noResult();
- }
-}
-function displayWMS (wmsArray) {
- if (wmsArray.length > 0) {
- setTableHeader(selectWmsText, wmsNameText, wmsAbstractText);
+ function displayWMS (wmsArray, guiId) {
+ if (wmsArray.length > 0) {
+ setTableHeader(selectWmsText, wmsNameText, wmsAbstractText);
- for (var i = 0; i < wmsArray.length; i++) {
+ for (var i = 0; i < wmsArray.length; i++) {
- if (global_source == "db" && typeof(wmsArray[i].guiId) !== "undefined" ) {
- var onClick = "mod_addWMSfromDB('" + wmsArray[i].guiId + "', '" + wmsArray[i].id + "')";
- }
- else {
- var onClick = "mod_addWMSfromDB('" + guiId + "', '" + wmsArray[i].id + "')";
-// var onClick = "mod_addWMSfromfilteredList('" + wmsArray[i].getCapabilitiesUrl + "', '" + wmsArray[i].version + "')";
+ if (global_source == "db" && typeof(guiId) !== "undefined" ) {
+ var onClick = "mod_addWMSfromDB('" + guiId + "', '" + wmsArray[i].id + "')";
+ }
+ else {
+ var onClick = "mod_addWMSfromfilteredList('" + wmsArray[i].getCapabilitiesUrl + "', '" + wmsArray[i].version + "')";
+ }
+ addTableRow(wmsArray[i].title, wmsArray[i].abstract, onClick);
}
- addRow("resultTableBody", wmsArray[i].title, wmsArray[i].abstract, onClick);
}
+ else {
+ noResult();
+ }
}
- else {
- noResult();
- }
-}
+ -->
+ </script>
+ <?php include("../include/dyn_css.php"); ?>
+ <script type="text/javascript">
+ var wmsNameText = '<?php echo _mb("WMS name");?>';
+ var wmsAbstractText = '<?php echo _mb("WMS abstract");?>';
+ var selectWmsText = '<?php echo _mb("Please select a WMS") . ":";?>';
+ var selectGuiText = '<?php echo _mb("Please select an application") . ":";?>';
+ var selectGroupText = '<?php echo _mb("Please select a group") . ":";?>';
+ var groupAbstractText = '<?php echo _mb("group abstract");?>';
+ var groupNameText = '<?php echo _mb("group name");?>';
+ var guiAbstractText = '<?php echo _mb("application abstract");?>';
+ var guiNameText = '<?php echo _mb("application name");?>';
+ var noResultText = '<?php echo _mb("no result");?>';
+ </script>
-// -->
-</script>
</head>
-<body onLoad="window.focus();setButtons();">
-<form name='addURLForm' id="capabilitiesForm">
- <table border='0' cellpadding='3' rules='rows'>
- <tr>
- <td>Capabilities - URL:</td>
- <td><input type="text" id="CapURL" name="CapURL"/></td>
- <td><input type="button" value="add" onclick="mod_addWmsfromURL();"></td>
- </tr>
- </table>
+<body onLoad="setButtons();">
+<h1><?php echo _mb("Add WMS"); ?></h1>
+<p><?php echo _mb("Enter a Capabilities-URL of a WMS or select one or more WMS from list."); ?></p>
+<p><em><?php echo _mb("Hint: Possibly you need to zoom in for showing layers from external map service. The operator of the external service is responsible for the display ranges. PortalU does not have a stake in this behaviour."); ?></em></p>
+
+<form id="capabilitiesForm" name="addURLForm" method="post" action="">
+<fieldset id="container_capabilities">
+<legend>Capabilities</legend>
+ <p>
+ <label for="CapURL"><?php echo _mb("Capabilities-URL"); ?>:</label>
+ <input type="text" id="CapURL" name="CapURL" />
+ <input type="button" id="addCapURL" name="addCapURL" value="<?php echo _mb("Add"); ?>" onclick="mod_addWmsfromURL();" />
+ </p>
+</fieldset>
</form>
-<form name='addWMSForm'>
- <table border='0' cellpadding='3' rules='rows'>
- <tr>
- <td><input type='button' class='wms_button' name='button_all' id='button_all' value='all wms' onclick='setSource("capabilities");getWMSByGUI(gui_list)'></td>
- <td><input type='button' class='wms_button' name='button_group' id='button_group' value='group' onclick = 'setSource("capabilities");getGroups()'></td>
- <td><input type='button' class='wms_button' name='button_gui' id='button_gui' value='gui' onclick = 'setSource("capabilities");getGUIs()'></td>
- <td><input type='button' class='wms_button' name='button_dbGui' id='button_dbGui' value='gui db' onclick = 'setSource("db");getGUIs()'></td>
- <td><input type='button' class='wms_button' name='button_dbGroup' id='button_dbGroup' value='group db' onclick = 'setSource("db");getGroups()'></td>
- <td><input type='button' class='wms_button' name='button_dbAll' id='button_dbAll' value='all wms db' onclick = 'setSource("db");getWMSByGUI(gui_list)'></td>
- </tr>
- </table>
+<form id="addWMSForm" name="addWMSForm" method="post" action="">
+<fieldset id="container_buttons">
+<legend>WMS list(s)</legend>
+ <p>
+ <label><?php echo _mb("Available WMS list(s)"); ?>:</label>
+ <input type="button" name="button_all" id="button_all" value="<?php echo _mb("All WMS"); ?>" onclick="setSource('capabilities');getWMSByGUI(gui_list)">
+ <input type="button" name="button_group" id="button_group" value="<?php echo _mb("WMS by Group"); ?>" onclick="setSource('capabilities');getGroups()">
+ <input type="button" name="button_gui" id="button_gui" value="<?php echo _mb("WMS by GUI"); ?>" onclick="setSource('capabilities');getGUIs()">
+ <input type="button" name="button_dbAll" id="button_dbAll" value="<?php echo _mb("Database (All WMS)"); ?>" onclick="setSource('db');getWMSByGUI(gui_list)">
+ <input type="button" name="button_dbGroup" id="button_dbGroup" value="<?php echo _mb("Database (Group)"); ?>" onclick="setSource('db');getGroups()">
+ <input type="button" name="button_dbGui" id="button_dbGui" value="<?php echo _mb("Database (GUI)"); ?>" onclick="setSource('db');getGUIs()">
+ </p>
+</fieldset>
</form>
-<div id='searchImage' name='searchImage' style='visibility:hidden'>
- <img src='../img/indicator_wheel.gif'>
-</div>
+<p id="progressIndicator" name="progressIndicator">
+ <img src="../img/indicator_wheel.gif" />
+ <?php echo _mb("Loading"); ?> ...
+</p>
-<div id='resultString' name='resultString'></div>
+<h2 id="resultString" name="resultString"></h2>
-<br>
-
-<table id='resultTable' name='resultTable' border=1 width="98%" cellpadding=3 rules='rows' style='visibility:hidden'>
- <thead bgcolor="#FAEBD7">
+<table id="resultTable" name="resultTable">
+ <thead>
<tr>
- <td id='titleLeft' name='titleLeft' width=200 height=10></td>
- <td id='titleRight' name='titleRight' align=left class=fieldnames_s></td>
+ <th id="titleLeft" name="titleLeft"></th>
+ <th id="titleRight" name="titleRight"></th>
</tr>
</thead>
- <tbody id='resultTableBody' name='resultTableBody'>
+ <tbody id="resultTableBody" name="resultTableBody">
</tbody>
</table>
-</div>
</body>
+
</html>
\ No newline at end of file
Modified: branches/nimix_dev/http/javascripts/mod_digitize_tab.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_digitize_tab.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_digitize_tab.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -49,6 +49,8 @@
buttonDig_y.push(y);
}
+//default definition of image directory for digitize buttons, might
+//be overwritten with digitize conf data
var buttonDig_imgdir = "../img/button_digitize/";
var buttonDig_id = [];
var buttonDig_on = [];
@@ -135,14 +137,7 @@
executeDigitizeSubFunctions();
}
-function mb_registerGML(frameName,obj){
- var ind = parent.getMapObjIndexByName(frameName);
- parent.mb_mapObj[ind].geom = obj;
-}
-
function mod_digitize_go(e){
- mb_registerGML(mod_digitize_target,d);
-
// ie workaround
if (e == undefined) {
e = parent.frames[mod_digitize_target].event;
@@ -802,8 +797,8 @@
var currentPoint = currentGeometry.get(k);
var currentPointMap = new Point(Math.round((currentPoint.x - minX)*cx), Math.round((maxY - currentPoint.y)*cy));
- var isTooCloseToPrevious = lastPaintedPoint && (k > 0) && Math.abs(currentPointMap.x-lastPaintedPoint.x) <= minDist && Math.abs(currentPointMap.y-lastPaintedPoint.y) <= minDist;
- if (!isTooCloseToPrevious) {
+// var isTooCloseToPrevious = lastPaintedPoint && (k > 0) && Math.abs(currentPointMap.x-lastPaintedPoint.x) <= minDist && Math.abs(currentPointMap.y-lastPaintedPoint.y) <= minDist;
+// if (!isTooCloseToPrevious) {
var currentPointIsVisible = currentPointMap.x > 0 && currentPointMap.x < width && currentPointMap.y > 0 && currentPointMap.y < height;
if (currentPointIsVisible) {
if (!isComplete && ((k == 0 && isPolygon) || (k == lenPoint-1 && isLine))) {
@@ -829,7 +824,7 @@
smPArray[smPArray.length] = evaluateDashes(points[0], points[1], i, j, k);
}
}
- }
+// }
var previousPointMap = currentPointMap;
}
}
@@ -947,7 +942,7 @@
if (isValidWfsConfIndex(wfsConf, d.get(i).wfs_conf)) {
listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_removeDb_src+"' title='"+msgObj.buttonDig_removeDb_title+"' onclick=\"var deltrans = confirm('"+msgObj.messageConfirmDeleteGeomFromDb+"');if (deltrans) dbGeom('delete', "+i+")\">\n";
}
- listOfGeom += "\t\t</td>\n\t\t<td style = 'color:blue;font-size:12px'>\n";
+ listOfGeom += "\t\t</td>\n\t\t<td class='searchResults'>\n";
listOfGeom += "\t\t\t<div onmouseover='parent.mb_wfs_perform(\"over\",d.get("+i+"));' ";
listOfGeom += " onmouseout='parent.mb_wfs_perform(\"out\",d.get("+i+"))' ";
listOfGeom += " onclick='parent.mb_wfs_perform(\"click\",d.get("+i+"));' ";
@@ -1293,9 +1288,9 @@
}
var formElementHtml = featureTypeElement['f_form_element_html'];
if (!formElementHtml || !formElementHtml.match(/<select/)) {
- str += "\t\t\t\t<input id = 'datatype_" + elementName + "' name='datatype' type='hidden' value = '" + elementType + "'>\n";
- str += "\t\t\t\t<input id = 'mandatory_" + elementName + "' name='mandatory' type='hidden' value = '" + isMandatory + "'>\n";
- str += "\t\t\t\t<input id = '" + elementName + "' name='" + elementLabel + "' type='text' class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
+ str += "\t\t\t\t<input id = 'datatype_mb_digitize_form_" + elementName + "' name='datatype' type='hidden' value = '" + elementType + "'>\n";
+ str += "\t\t\t\t<input id = 'mandatory_mb_digitize_form_" + elementName + "' name='mandatory' type='hidden' value = '" + isMandatory + "'>\n";
+ str += "\t\t\t\t<input id = 'mb_digitize_form_" + elementName + "' name='" + elementLabel + "' type='text' class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
}
else {
while (formElementHtml.match(/\\/)) {
@@ -1393,7 +1388,8 @@
}
else if (myform.elements[i].type == 'text' ){
if (myform.elements[i].id) {
- d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].value);
+ var elementId = String(myform.elements[i].id).replace(/mb_digitize_form_/, "");
+ d.get(m).e.setElement(elementId, myform.elements[i].value);
}
else {
errorMessage = msgObj.messageErrorFormEvaluation;
@@ -1402,7 +1398,8 @@
// selectbox
else if (typeof(myform.elements[i].selectedIndex) == 'number') {
if (myform.elements[i].id) {
- d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].options[myform.elements[i].selectedIndex].value);
+ var elementId = String(myform.elements[i].id).replace(/mb_digitize_form_/, "");
+ d.get(m).e.setElement(elementId, myform.elements[i].options[myform.elements[i].selectedIndex].value);
}
else {
errorMessage = msgObj.messageErrorFormEvaluation;
Modified: branches/nimix_dev/http/javascripts/mod_dragMapSize.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_dragMapSize.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_dragMapSize.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -101,6 +101,7 @@
var mybbox = mb_mapObj[ind].extent.split(",");
mb_mapObj[ind].extent = mybbox[0] + "," + pos[1] + "," + pos[0] + "," + mybbox[3];
setMapRequest(mod_dragMapSize_target);
+ eventResizeMap.trigger();
}
function mod_dragMapSize_drag(e){
Deleted: branches/nimix_dev/http/javascripts/mod_gazetteerSQL_client.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_gazetteerSQL_client.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_gazetteerSQL_client.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -1,391 +0,0 @@
-<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
-<title>Gazetteer</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<script type="text/javascript">
-
-var targetFrameArray = [];
-<?php
-echo "var e_id = '". $e_id . "';";
-for ($i = 0; $i < count($e_target); $i++) {
- echo "targetFrameArray.push('".$e_target[$i]."');";
-}
-?>
-<!--
-// --- begin: expected element vars ---
-// var scale
-// var numberOfResults
-// var profile = "adresse" | "alk" | "alb" | "adresse2"
-
-if (typeof(scale) == 'undefined') {
- var scale = 2000;
- var e = new parent.Mb_warning("mod_gazetteerSQL: element var scale is missing.");
-}
-if (typeof(numberOfResults) == 'undefined') {
- var numberOfResults = 0;
- var e = new parent.Mb_warning("mod_gazetteerSQL: element var numberOfResults is missing.");
-}
-if (typeof(tooManyResultsString) == 'undefined') {
- var tooManyResultsString = "Too many results. Please specify your query.";
- var e = new parent.Mb_warning("mod_gazetteerSQL: element var tooManyResultsString is missing.");
-}
-if (typeof(profile) == 'undefined' || (profile != "alb" && profile != "alk" && profile != "adresse" && profile != "adresse2")) {
- profile = "adresse"
- var e = new parent.Mb_exception("mod_gazetteerSQL: element var profile is missing.");
-}
-
-// --- end: expected element vars ---
-
-
-var generalPreFunctions = [];
-var generalSubFunctions = [];
-var onloadSubFunctions = [];
-var communesSubFunctions = [];
-var streetSubFunctions = [];
-var numberSubFunctions = [];
-var districtSubFunctions = [];
-var parcelSubFunctions = [];
-var ownerSubFunctions = [];
-
-registerFunction(generalPreFunctions, "disableForm();");
-registerFunction(generalSubFunctions, "enableForm();");
-if (profile == "alb") {
- registerFunction(onloadSubFunctions, "updateCommunes();");
- registerFunction(communesSubFunctions, "updateOwner();");
- registerFunction(ownerSubFunctions, "updateOwner();");
-}
-else if (profile == "alk") {
- registerFunction(onloadSubFunctions, "updateCommunes();");
- registerFunction(communesSubFunctions, "updateDistricts();");
- registerFunction(parcelSubFunctions, "updateParcels();");
-}
-else if (profile == "adresse") {
- registerFunction(onloadSubFunctions, "updateCommunes();");
- registerFunction(communesSubFunctions, "updateStreets();");
- registerFunction(streetSubFunctions, "updateNumbers();");
-}
-else if (profile == "adresse2") {
- registerFunction(onloadSubFunctions, "updateStreets();");
- registerFunction(streetSubFunctions, "updateNumbers();");
-}
-
-function executeFunctions(arrayOfFunctionStrings) {
- for (var i = 0; i < arrayOfFunctionStrings.length; i++) {
- eval(arrayOfFunctionStrings[i]);
- }
-}
-
-function registerFunction(functionStringArray, functionString) {
- functionStringArray.push(functionString);
-}
-
-function disableForm() {
- document.getElementById('selectCommune').disabled = true;
- document.getElementById('selectStreet').disabled = true;
- document.getElementById('selectDistrict').disabled = true;
- document.getElementById('inputParcel1').disabled = true;
- document.getElementById('inputParcel2').disabled = true;
- document.getElementById('inputParcelButton').disabled = true;
- document.getElementById('inputOwner').disabled = true;
- document.getElementById('inputOwnerButton').disabled = true;
- document.getElementById("divResults").innerHTML = searchImage;
-}
-
-function enableForm() {
- document.getElementById('selectCommune').removeAttribute("disabled");
- document.getElementById('selectStreet').removeAttribute("disabled");
- document.getElementById('selectDistrict').removeAttribute("disabled");
- document.getElementById('inputParcel1').removeAttribute("disabled");
- document.getElementById('inputParcel2').removeAttribute("disabled");
- document.getElementById('inputParcelButton').removeAttribute("disabled");
- document.getElementById('inputOwner').removeAttribute("disabled");
- document.getElementById('inputOwnerButton').removeAttribute("disabled");
- document.getElementById("divResults").innerHTML = "";
-}
-
-var highlight;
-var houseLocation;
-var parcelLocation;
-var searchImage = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
-var phpUrl = "../php/mod_gazetteerSQL_server.php";
-
-parent.mb_registerInitFunctions("window.frames['"+e_id+"'].initHighlight()");
-parent.mb_registerInitFunctions("window.frames['"+e_id+"'].executeFunctions(window.frames['"+e_id+"'].onloadSubFunctions)");
-
-
-// - BEGIN -------- HIGHLIGHTING AND ZOOMING ------------------------------------------
-
-function zoomToLocation(aPoint) {
- parent.mb_repaintScale(targetFrameArray[0], aPoint.x, aPoint.y, scale)
-}
-
-function initHighlight() {
- var generalHighlightZIndex = 100;
- var generalHighlightLineWidth = 3;
- var styleObj = {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex};
- highlight = new parent.Highlight(targetFrameArray, e_id, styleObj, generalHighlightLineWidth);
-}
-
-function zoomToHouseNumber(houseNumber) {
- zoomToLocation(houseLocation[houseNumber]);
- removeHighlight();
- highlightHouseNumber(houseNumber);
-}
-
-function zoomToParcel(parcelId) {
- zoomToLocation(parcelLocation[parcelId]);
- removeHighlight();
- highlightParcel(parcelId);
-}
-
-function highlightHouseNumber(houseNumber) {
- var mG = new parent.MultiGeometry(parent.geomType.point);
- mG.addGeometry();
- mG.get(-1).addPoint(houseLocation[houseNumber]);
- highlight.add(mG);
- highlight.paint();
-}
-
-function highlightParcel(parcelId) {
- var mG = new parent.MultiGeometry(parent.geomType.point);
- mG.addGeometry();
- mG.get(-1).addPoint(parcelLocation[parcelId]);
- highlight.add(mG);
- highlight.paint();
-}
-
-function removeHighlight() {
- highlight.clean();
-}
-
-// - END -------- HIGHLIGHTING AND ZOOMING ------------------------------------------
-
-
-
-function removeChildNodes(node) {
- while (node.childNodes.length > 0) {
- var childNode = node.firstChild;
- node.removeChild(childNode);
- }
-}
-
-function getSize(result) {
- if (typeof(result) == "array") {
- return result.length;
- }
- else if (typeof(result) == "object") {
- var c = 0;
- for (var attr in result) {
- c++;
- }
- return c;
- }
- return 1;
-}
-
-function updateCommunes() {
- executeFunctions(generalPreFunctions);
- parent.mb_ajax_json(phpUrl, {"command":"getCommunes"}, function (json, status) {
- executeFunctions(generalSubFunctions);
-
- removeChildNodes(document.getElementById('selectCommune'));
-
- for (var communeId in json.communes) {
- if (typeof(json.communes[communeId]) != 'function') {
- var currentNode = document.createElement("option");
-
- if (document.getElementById('selectCommune').childNodes.length == 0) {
- currentNode.selected = "selected";
- }
- currentNode.value = communeId;
- currentNode.innerHTML = json.communes[communeId];
- document.getElementById('selectCommune').appendChild(currentNode);
- }
- }
- executeFunctions(communesSubFunctions);
- });
-}
-
-function updateStreets() {
- executeFunctions(generalPreFunctions);
- var communeId = document.getElementById('selectCommune').value;
-
- parent.mb_ajax_json(phpUrl, {"command":"getStreets", "communeId":communeId}, function (json, status) {
- executeFunctions(generalSubFunctions);
-
- removeChildNodes(document.getElementById('selectStreet'));
-
- for (var streetId in json.streets) {
- if (typeof(json.streets[streetId]) != 'function') {
- var currentNode = document.createElement("option");
-
- if (document.getElementById('selectStreet').childNodes.length == 0) {
- currentNode.selected = "selected";
- }
-
- currentNode.value = json.streets[streetId];
- currentNode.innerHTML = json.streets[streetId];
- document.getElementById('selectStreet').appendChild(currentNode);
- }
- }
- executeFunctions(streetSubFunctions);
- });
-}
-
-function updateDistricts() {
- executeFunctions(generalPreFunctions);
-
- var communeId = document.getElementById('selectCommune').value;
-
- parent.mb_ajax_json(phpUrl, {"command":"getDistricts", "communeId":communeId}, function (districtObject, status) {
- executeFunctions(generalSubFunctions);
-
- removeChildNodes(document.getElementById('selectDistrict'));
-
- for (var districtId in districtObject.districts) {
- if (typeof(districtObject.districts[districtId]) != 'function') {
- var currentNode = document.createElement("option");
-
- currentNode.value = districtId;
-
- if (document.getElementById('selectDistrict').childNodes.length == 0) {
- currentNode.selected = "selected";
- }
-
- currentNode.value = districtObject.districts[districtId];
- currentNode.innerHTML = districtObject.districts[districtId];
- document.getElementById('selectDistrict').appendChild(currentNode);
- }
- }
- executeFunctions(districtSubFunctions);
- });
-}
-
-function updateNumbers() {
- executeFunctions(generalPreFunctions);
-
- var streetName = document.getElementById('selectStreet').value;
- var communeId = document.getElementById('selectCommune').value;
-
- parent.mb_ajax_json(phpUrl, {"command":"getNumbers", "communeId":communeId, "streetName":streetName, "numberOfResults":numberOfResults}, function (json, status) {
- executeFunctions(generalSubFunctions);
- houseLocation = {};
- var resultString = "";
- if (getSize(json.houseNumbers) > 0) {
- if (json.limited === true) {
- resultString += tooManyResultsString;
- }
- for (var houseNumber in json.houseNumbers) {
- if (typeof(json.houseNumbers[houseNumber]) != 'function') {
- houseLocation[houseNumber] = new parent.Point(json.houseNumbers[houseNumber].x, json.houseNumbers[houseNumber].y);
- resultString += "<b style=\"cursor:pointer\" onclick=\"zoomToHouseNumber('"+houseNumber+"')\" onmouseover=\"highlightHouseNumber('"+houseNumber+"')\" onmouseout=\"removeHighlight()\">"+houseNumber+"</b> ";
- }
- }
- }
- else {
- resultString += noResultsString;
- }
- document.getElementById("divResults").innerHTML = resultString;
- executeFunctions(numberSubFunctions);
- });
-}
-
-function updateParcels() {
- executeFunctions(generalPreFunctions);
-
- var districtId = document.getElementById('selectDistrict').value;
- var inputParcel1 = document.getElementById('inputParcel1').value;
- var inputParcel2 = document.getElementById('inputParcel2').value;
-
-
- parent.mb_ajax_json(phpUrl, {"command":"getLandparcelsByDistrict", "districtId":districtId, "parcelNumber1":inputParcel1, "parcelNumber2":inputParcel2, "numberOfResults":numberOfResults}, function (json, status) {
- executeFunctions(generalSubFunctions);
-
- parcelLocation = {};
- var resultString = "";
- if (getSize(json.landparcels) > 0) {
- if (json.limited === true) {
- resultString += tooManyResultsString;
- }
- resultString += "<ol>";
- for (var parcelId in json.landparcels) {
- if (typeof(json.landparcels[parcelId]) != 'function') {
- parcelLocation[parcelId] = new parent.Point(json.landparcels[parcelId].x, json.landparcels[parcelId].y);
- resultString += "<li style=\"cursor:pointer\" onclick=\"zoomToParcel('"+parcelId+"')\" onmouseover=\"highlightParcel('"+parcelId+"')\" onmouseout=\"removeHighlight()\">"+parcelId+"</li>";
- }
- }
- resultString += "</ol>";
- }
- else {
- resultString += noResultsString;
- }
- document.getElementById("divResults").innerHTML = resultString;
- executeFunctions(numberSubFunctions);
- });
-}
-
-function updateOwner() {
- var ownerQueryString = document.getElementById('inputOwner').value;
- var communeId = document.getElementById('selectCommune').value;
-
- document.getElementById("divResults").innerHTML = "";
- document.getElementById('selectCommune').removeAttribute("disabled");
- document.getElementById('inputOwner').removeAttribute("disabled");
- document.getElementById('inputOwnerButton').removeAttribute("disabled");
-
- if (ownerQueryString != "") {
- executeFunctions(generalPreFunctions);
- parent.mb_ajax_json(phpUrl, {"command":"getLandparcelsByOwner", "communeId":communeId, "ownerQueryString":ownerQueryString, "numberOfResults":numberOfResults}, function (json, status) {
- executeFunctions(generalSubFunctions);
-
- parcelLocation = {};
- var resultString = "";
- if (getSize(json.landparcels) > 0) {
- if (json.limited === true) {
- resultString += tooManyResultsString;
- }
- resultString += "<ol>";
- for (var i=0; i < json.landparcels.length; i++) {
- var parcelId = json.landparcels[i].landparcelId;
- parcelLocation[parcelId] = new parent.Point(json.landparcels[i].x, json.landparcels[i].y);
- resultString += "<li style=\"cursor:pointer\" onclick=\"zoomToParcel('"+parcelId+"')\" onmouseover=\"highlightParcel('"+parcelId+"')\" onmouseout=\"removeHighlight()\">"+json.landparcels[i].owner+ " (" + parcelId+")</li>";
- }
- resultString += "</ol>";
- }
- else {
- resultString += noResultsString;
- }
- document.getElementById("divResults").innerHTML = resultString;
- executeFunctions(numberSubFunctions);
-
- });
- }
-}
-// -->
-</script>
-</head>
-<body>
-<form>
-<select class='selectCommune' id='selectCommune' onchange='executeFunctions(communesSubFunctions)'></select>
-<select class='selectStreet' id='selectStreet' onchange='executeFunctions(streetSubFunctions);' size=5 disabled></select>
-<select class='selectDistrict' id='selectDistrict' onchange='executeFunctions(districtSubFunctions);' size=5 disabled></select>
-<div id='divParcel' class='divParcel'>
-Flur: <input type='input' class='inputParcel1' id='inputParcel1' disabled></select>
-Flstz: <input type='input' class='inputParcel2' id='inputParcel2' disabled></select>
-<input type='button' id='inputParcelButton' value='?' onclick='executeFunctions(parcelSubFunctions);'>
-</div>
-<div id='divOwner' class='divOwner'>
-Eigentümer: <input type='input' class='inputOwner' id='inputOwner' disabled></select>
-<input type='button' id='inputOwnerButton' value='?' onclick='executeFunctions(ownerSubFunctions);'>
-</div>
-</form>
-<div class='divResults' id='divResults'></div>
-</body>
-</html>
\ No newline at end of file
Modified: branches/nimix_dev/http/javascripts/mod_loadwmc.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_loadwmc.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_loadwmc.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -22,70 +22,75 @@
include(dirname(__FILE__) . "/../include/dyn_js.php");
-/*
-// this may be added at a later stage
-if ($new_wmc == 1) {
- include(dirname(__FILE__) . "/../generate_defaultWmc.php");
- $startup = true;
- $e = new mb_notice("loadwmc: new wmc");
-}
-else {
- $startup = false;
- $e = new mb_notice("loadwmc: old wmc");
-}
-if ($gui_changed == 0) {
- if ($_REQUEST['portal_services']) {
- $e = new mb_notice("loadwmc: merging layers");
- include(dirname(__FILE__) . "/../merge_layers.php");
+function createJs ($mergeWms) {
+ $jsString = "";
+ $wmc = new wmc();
+ if (!isset($_SESSION['mb_wmc'])) {
+ $e = new mb_notice("wmc not set, generating from app: " . $_SESSION["mb_user_gui"]);
+ $wmc->createFromApplication($_SESSION["mb_user_gui"]);
+ $_SESSION["mb_wmc"] = $wmc->toXml();
+ $e = new mb_exception("initial WMC: " . $_SESSION["mb_wmc"]);
}
- if ($_SESSION['GML']) {
- $e = new mb_notice("loadwmc: merging bbox");
- include(dirname(__FILE__) . "/../merge_bbox.php");
+
+ if (isset($_SESSION['mb_wmc'])) {
+ $e = new mb_notice("merging with WMC.");
+
+ if ($wmc->createFromXml($_SESSION['mb_wmc'])) {
+
+ if ($mergeWms) {
+ $wmsArray = array();
+ for ($i = 0; $i < count($_SESSION["wms"]); $i++) {
+ $currentWms = new wms();
+ $currentWms->createObjFromXML($_SESSION["wms"][$i]);
+ array_push($wmsArray, $currentWms);
+ }
+ $wmc->mergeWmsArray($wmsArray);
+ $_SESSION["command"] = "";
+ $_SESSION["wms"] = array();
+ }
+
+ $javaScriptArray = array();
+ $javaScriptArray = $wmc->toJavaScript();
+
+ $jsString .= implode("", $javaScriptArray);
+ }
+ else {
+ $jsString .= "var e = new Mb_notice('mod_loadwmc: load_wmc_session: error parsing wmc');";
+ }
}
+ else {
+ $e = new mb_notice("not merging WMC");
+ $jsString .= "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
+ }
+ return $jsString;
}
-*/
//
// Creates the function load_wmc_session.
// This function loads a WMC from the session, if the element var
// "loadFromSession" is set to true.
//
-echo "function load_wmc_session() {";
-if (isset($_SESSION['mb_wmc'])) {
- $wmc = new wmc();
- if ($wmc->createFromXml($_SESSION['mb_wmc'])) {
- $jsArray = array();
-// if ($_SESSION['layer_preview']) {
-// $js = $wmc->createJsObjFromWMC("", $e_target, "load");
-// }
-// else if ($startup == true) {
-// $js = $wmc->createJsObjFromWMC("", $e_target, "merge");
-// $startup = false;
-// }
-// else {
- $jsArray = $wmc->toJavaScript();
-// }
- echo implode("", $jsArray);
-
- // test wmc from app
- $newWmc = new wmc();
- $newWmc->createFromApplication($_SESSION["mb_user_gui"]);
-
-
- }
- else {
- echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: error parsing wmc');";
- }
+?>
+function load_wmc_session() {
+<?php
+if ($_SESSION["command"] && $_SESSION["command"] == "ADDWMS") {
+ $e = new mb_notice("merging with WMS in Session...");
+ echo createJs(true);
}
else {
- echo "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
+ $e = new mb_notice("NOT merging with WMS in Session...");
+ echo createJs(false);
}
-echo "}";
+?>
+}
+<?php
+if ($e_src) {
+ sprintf("var mod_loadwmc_img = new Image();
+ mod_loadwmc_img.src = '%s'", $e_src);
+
+}
-echo "var mod_loadwmc_img = new Image(); mod_loadwmc_img.src = '" . $e_src . "';";
-
-
//
// Creates a pop up with a dialogue to load, view or delete WMC documents
//
Modified: branches/nimix_dev/http/javascripts/mod_log.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_log.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_log.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -1,5 +1,5 @@
<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require(dirname(__FILE__)."/../php/mb_validatePermission.php");
?>
mb_registerInitFunctions("mb_log_init()");
function mb_log_init(){
@@ -7,7 +7,7 @@
}
try{if(logtype){}}catch(e){logtype="";}
function mb_log_set(req, time_client){
- var url = '<?php echo $self; ?>&req=" + escape(req) + "&time_client=" + time_client;
+ var url = "../php/mod_log.php?<?php echo $urlParameters;?>&req=" + escape(req) + "&time_client=" + time_client;
mb_ajax_post(url, {req:req, time:time_client});
return true;
}
\ No newline at end of file
Modified: branches/nimix_dev/http/javascripts/mod_savewmc.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_savewmc.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_savewmc.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -40,8 +40,12 @@
mb_registerInitFunctions('setOnUnload()');
}
-var mod_savewmc_img = new Image();
-mod_savewmc_img.src = "<?php echo $e_src; ?>";
+<?php
+if ($e_src) {
+ sprintf("var mod_savewmc_img = new Image();
+ mod_savewmc_img.src = '%s';", $e_src);
+}
+?>
//var mod_savewmc_img_over = new Image(); mod_savewmc_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
function mod_savewmc_session(){
@@ -68,4 +72,4 @@
$.ajaxSetup({async:false}); //TODO: find out why async doesn't work onunload
}
$.post("../php/mod_savewmc_server.php", {"saveInSession":storeInSession, "generalTitle":generalTitle, "extensionData":extensionDataString, "mapObject":$.toJSON(mb_mapObj)}, callbackFunction);
-}
\ No newline at end of file
+}
Modified: branches/nimix_dev/http/javascripts/mod_setBackground.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_setBackground.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_setBackground.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -30,20 +30,18 @@
mb_registerInitFunctions("mod_setBackground_init()");
var mod_setBackground_active = false;
function mod_setBackground_init(){
- var ind = document.setBackground.mod_setBackground_list.options[0].value;
+ var setBackgroundSelectBox = document.setBackground.mod_setBackground_list;
+ var ind = setBackgroundSelectBox.options[0].value;
var cnt = 0;
var selInd;
- document.setBackground.mod_setBackground_list.options[document.setBackground.mod_setBackground_list.length - 1] = null;
+ setBackgroundSelectBox.options[setBackgroundSelectBox.length - 1] = null;
for(var i=0; i<wms.length; i++){
if(wms[i].gui_wms_visible == '0'){
- var title = decodeURIComponent(wms[i].wms_title);
- while (title.search(/\+/) != -1) {
- title = title.replace("\+", " ");
- }
+ var title = wms[i].wms_title;
var newO = new Option(title, i, false,false);
- document.setBackground.mod_setBackground_list.options[document.setBackground.mod_setBackground_list.length] = newO;
+ setBackgroundSelectBox.options[setBackgroundSelectBox.length] = newO;
if (ind == i) {
selInd = cnt;
}
@@ -52,7 +50,7 @@
}
if (cnt >0){
wms[ind].gui_wms_visible = 2;
- document.setBackground.mod_setBackground_list.selectedIndex = selInd;
+ setBackgroundSelectBox.selectedIndex = selInd;
}
mod_setBackground_active = ind;
}
Modified: branches/nimix_dev/http/javascripts/mod_tab.js
===================================================================
--- branches/nimix_dev/http/javascripts/mod_tab.js 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_tab.js 2008-08-18 16:12:00 UTC (rev 2870)
@@ -233,7 +233,7 @@
for (var i = 0; i < this.count(); i++) {
for(var j=0; j<obj.length; j++){
if (this.get(i).module == obj[j].id) {
- this.get(i).getNode().innerHTML = obj[j].title;
+ this.get(i).getNode().innerHTML = tabPrefix + obj[j].title;
}
}
}
@@ -488,9 +488,9 @@
var tabHeight = parseInt(rootNode.style.height, 10);
var tabStyle = cssString;
-
+ var tabPrefix = tab_prefix || '';
var styleObj = new StyleTag();
styleObj.addClass("verticalTabs", tabStyle);
};
-VerticalTabArray.prototype = new List();
\ No newline at end of file
+VerticalTabArray.prototype = new List();
Modified: branches/nimix_dev/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_wfs_SpatialRequest.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_wfs_SpatialRequest.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -1,7 +1,7 @@
<?php
#$Id$
#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
-# 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
@@ -118,9 +118,9 @@
function wfsInitFunction (j) {
var functionCall = "mb_regButton_frame('initWfsButton', null, "+j+")";
- var x = new Function ("", functionCall);
+ var x = new Function ("", functionCall);
x();
-}
+}
function displayButtons() {
for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
@@ -131,14 +131,14 @@
currentDiv.style.left = buttonWfs_x[i]
currentDiv.style.top = buttonWfs_y[i];
currentDiv.style.zIndex = buttonWfs_zIndex;
-
+
var currentImg = document.createElement("img");
currentImg.id = buttonWfs_id[i];
currentImg.name = buttonWfs_id[i];
currentImg.title = buttonWfs_title_off[i];
currentImg.src = buttonWfs_imgdir+buttonWfs_src[i];
currentImg.onmouseover = new Function("wfsInitFunction("+i+")");
-
+
currentDiv.appendChild(currentImg);
document.getElementsByTagName('body')[0].appendChild(currentDiv);
}
@@ -161,7 +161,7 @@
mod_wfs_spatialRequest_epsg = mb_mapObj[ind].epsg;
mb_registerSubFunctions("drawDashedLineExt()");
mb_registerPanSubElement("measuring");
-}
+}
function wfsEnable(obj) {
var el = window.frames[mod_wfs_spatialRequest_target].document;
@@ -169,14 +169,14 @@
el.onmousedown = null;
el.onmouseup = null;
el.onmousemove = null;
-
+
if (obj.id == button_point) {
if (activeButton == null) {
activeButton = obj;
}
mod_wfs_spatialRequest_geometry = new Geometry(geomType.point);
wfsAreaType_current = wfsAreaType_point;
- mod_wfs_spatialRequest_digitize_go(geomType.point);
+ mod_wfs_spatialRequest_digitize_go(geomType.point);
}
if (obj.id == button_polygon) {
if (activeButton == null) {
@@ -184,11 +184,11 @@
}
mod_wfs_spatialRequest_geometry = new Geometry(geomType.polygon);
wfsAreaType_current = wfsAreaType_polygon;
- mod_wfs_spatialRequest_digitize_go(geomType.polygon);
+ mod_wfs_spatialRequest_digitize_go(geomType.polygon);
var measureSub = "";
for(var i=0; i<mod_wfs_spatialRequestSubFunctions.length; i++){
measureSub += eval(mod_wfs_spatialRequestSubFunctions[i]);
- }
+ }
writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
}
else if (obj.id == button_rectangle){
@@ -197,7 +197,7 @@
}
mod_wfs_spatialRequest_geometry = new Geometry(geomType.line);
wfsAreaType_current = wfsAreaType_rectangle;
- mod_selAreaExt_click();
+ mod_selAreaExt_click();
}
else if (obj.id == button_extent){
if (activeButton == null) {
@@ -207,7 +207,7 @@
wfsAreaType_current = wfsAreaType_extent;
var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
var p0 = mapToReal(mod_wfs_spatialRequest_target, new Point(0,0));
- var p1 = mapToReal(mod_wfs_spatialRequest_target, new Point(mb_mapObj[ind].width,mb_mapObj[ind].height));
+ var p1 = mapToReal(mod_wfs_spatialRequest_target, new Point(mb_mapObj[ind].width,mb_mapObj[ind].height));
mod_wfs_spatialRequest_geometry.addPoint(p0);
mod_wfs_spatialRequest_geometry.addPoint(p1);
mod_getAreaExt_send();
@@ -219,7 +219,7 @@
}
function wfsDisable(obj) {
- var el = window.frames[mod_wfs_spatialRequest_target].document;
+ var el = window.frames[mod_wfs_spatialRequest_target].document;
el.onmousedown = null;
el.ondblclick = null;
el.onmousemove = null;
@@ -253,7 +253,7 @@
if (mod_wfs_spatialRequest_geometry != null) {
mod_wfs_spatialRequest_geometry.addPoint(new Point(coords[0],coords[1]));
mod_wfs_spatialRequest_geometry.addPoint(new Point(coords[2],coords[3]));
-
+
if(mod_wfs_spatialRequest_geometry.count() == 2){
mod_getAreaExt_send();
}
@@ -281,7 +281,7 @@
var measureSub = "";
for(var i=0; i<mod_wfs_spatialRequestSubFunctions.length; i++){
measureSub += eval(mod_wfs_spatialRequestSubFunctions[i]);
- }
+ }
writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
}
@@ -298,7 +298,7 @@
function mod_wfs_spatialRequest_start(e){
var realWorldPos;
if (s.isSnapped() == true) {
- realWorldPos = s.getSnappedPoint();
+ realWorldPos = s.getSnappedPoint();
s.clean();
}
else {
@@ -316,7 +316,7 @@
mod_getAreaExt_send();
return;
}
-
+
if(wfsAreaType_current == wfsAreaType_point){
mod_getAreaExt_send();
return;
@@ -347,7 +347,7 @@
var n = Math.round(d);
var s = p0.minus(p1).dividedBy(n);
for(var i=1; i<n; i++){
- var currPoint = p1.plus(s.times(i)).minus(new Point(2,2)).round(0);
+ var currPoint = p1.plus(s.times(i)).minus(new Point(2,2)).round(0);
if(currPoint.x >= 0 && currPoint.x <= mod_wfs_spatialRequest_width && currPoint.y >= 0 && currPoint.y <= mod_wfs_spatialRequest_height){
str_dashedLine += "<div style='font-size:1px;position:absolute;top:"+currPoint.y+"px;left:"+currPoint.x+"px;width:3px;height:3px;background-color:#ff0000'></div>";
}
@@ -367,7 +367,7 @@
mod_wfs_spatialRequestSubFunctions[mod_wfs_spatialRequestSubFunctions.length] = stringFunction;
}
-function mod_getAreaExt_send(){
+function mod_getAreaExt_send(){
mb_setwfsrequest(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry);
mod_wfs_spatialRequest_delete();
mb_disableThisButton(activeButton.id);
@@ -380,7 +380,7 @@
}
function mod_wfs_spatialRequest_timeout(){
- var el = window.frames[mod_wfs_spatialRequest_target].document;
+ var el = window.frames[mod_wfs_spatialRequest_target].document;
el.onmousedown = null;
el.ondblclick = null;
el.onmousemove = null;
@@ -396,16 +396,16 @@
return false;
}
-function mod_wfs_SpatialRequest_dialog(){
+function mod_wfs_SpatialRequest_dialog(){
if(!mod_wfs_spatialRequest_win || mod_wfs_spatialRequest_win == null || mod_wfs_spatialRequest_win.closed == true){
mod_wfs_spatialRequest_win = window.open("","mod_wfs_spatialRequest_win","width=200,height=150,resizable=yes");
mod_wfs_spatialRequest_win.document.open("text/html");
-
- mod_wfs_spatialRequest_win.document.writeln('<script language="JavaScript" type="text/javascript">');
+
+ mod_wfs_spatialRequest_win.document.writeln('<script language="JavaScript" type="text/javascript">');
mod_wfs_spatialRequest_win.document.writeln('function set(obj){');
mod_wfs_spatialRequest_win.document.writeln('for(var i=0; i< document.getElementsByName("geom").length; i++){');
mod_wfs_spatialRequest_win.document.writeln('if(document.getElementsByName("geom")[i].checked){');
- mod_wfs_spatialRequest_win.document.writeln('window.opener.mod_setExtRequest_geom = document.getElementsByName("geom")[i].value;');
+ mod_wfs_spatialRequest_win.document.writeln('window.opener.mod_setExtRequest_geom = document.getElementsByName("geom")[i].value;');
mod_wfs_spatialRequest_win.document.writeln('}');
mod_wfs_spatialRequest_win.document.writeln('}');
mod_wfs_spatialRequest_win.document.writeln('window.opener.wfsEnable(obj);');
@@ -413,7 +413,7 @@
mod_wfs_spatialRequest_win.document.writeln('return false; ');
mod_wfs_spatialRequest_win.document.writeln('}');
mod_wfs_spatialRequest_win.document.writeln('</script>');
-
+
mod_wfs_spatialRequest_win.document.writeln("<form>");
mod_wfs_spatialRequest_win.document.writeln("<input id='point' name='geom' type='radio' value='"+button_point+"' onclick='set(this)'> Punkt<br>");
mod_wfs_spatialRequest_win.document.writeln("<input id='rectangle' name='geom' type='radio' value='"+button_rectangle+"' onclick='set(this)'> Rechteck<br>");
@@ -425,56 +425,58 @@
}
else{
mod_wfs_spatialRequest_win.focus();
- }
+ }
}
function mb_setwfsrequest(target,queryGeom){
if (typeof(wfsPopup) != "undefined") {
wfsPopup.hide();
- }
+ }
//mb_wfs_reset();
var ind = getMapObjIndexByName(target);
var db_wfs_conf_id = [];
js_wfs_conf_id = [];
_geomArray = new GeometryArray();
-
+
if (typeof(resultGeometryPopup) != "undefined") {
resultGeometryPopup.hide();
}
-
+
wfs_config = window.frames["wfs_conf"].get_wfs_conf();
for (var i=0; i<mb_mapObj[ind].wms.length; i++){
for(var ii=0; ii<mb_mapObj[ind].wms[i].objLayer.length; ii++){
var o = mb_mapObj[ind].wms[i].objLayer[ii];
- if(o.gui_layer_wfs_featuretype != '' && o.gui_layer_querylayer == '1'){
+ if(o.gui_layer_wfs_featuretype != '' && o.gui_layer_querylayer == '1' && o.gui_layer_visible == '1'){
db_wfs_conf_id[db_wfs_conf_id.length] = o.gui_layer_wfs_featuretype;
- }
+ }
}
}
for(var i=0; i<db_wfs_conf_id.length; i++){
- for(var ii=0; ii<wfs_config.length; ii++){
+ for(var ii=0; ii<wfs_config.length; ii++){
if(wfs_config[ii]['wfs_conf_id'] == db_wfs_conf_id[i]) js_wfs_conf_id[js_wfs_conf_id.length] = ii;
}
}
-
+
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";
url += "&typename="+ wfs_config[js_wfs_conf_id[i]]['featuretype_name'];
url += "&filter=";
var filter = "<ogc:Filter xmlns:ogc=\"http://ogc.org\" xmlns:gml=\"http://www.opengis.net/gml\">";
-
- if(buttonPolygon.filteroption=='within'){
+
+ if(buttonPolygon.filteroption=='within'){
filter += "<Within><ogc:PropertyName>";
for(var j=0; j<wfs_config[js_wfs_conf_id[i]]['element'].length; j++){
if(wfs_config[js_wfs_conf_id[i]]['element'][j]['f_geom'] == 1){
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 += " ";
@@ -490,8 +492,8 @@
filter += wfs_config[js_wfs_conf_id[i]]['element'][j]['element_name'];
}
}
- filter += "</ogc:PropertyName><gml:Polygon srsName='4326'>";
- filter += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+ 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 += " ";
filter += queryGeom.get(k).x+","+queryGeom.get(k).y;
@@ -499,7 +501,7 @@
filter += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
filter += "</gml:Polygon></Intersects>";
}
-
+
filter += '</ogc:Filter>';
mb_get_geom(url, filter, i, wfs_config[js_wfs_conf_id[i]]['featuretype_name'], js_wfs_conf_id[i], db_wfs_conf_id[i]);
}
@@ -510,18 +512,20 @@
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=";
var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>";
-
- if(buttonRectangle.filteroption=='within'){
+
+ if(buttonRectangle.filteroption=='within'){
filter += "<Within><ogc:PropertyName>";
for(var j=0; j<wfs_config[js_wfs_conf_id[i]]['element'].length; j++){
if(wfs_config[js_wfs_conf_id[i]]['element'][j]['f_geom'] == 1){
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 += " ";
@@ -542,8 +546,8 @@
filter += wfs_config[js_wfs_conf_id[i]]['element'][j]['element_name'];
}
}
- filter += "</ogc:PropertyName><gml:Polygon srsName='4326'>";
- filter += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+ filter += "</ogc:PropertyName><gml:Polygon srsName='"+srs+"'>";
+ filter += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
filter += rectangle[0].x+","+rectangle[0].y;
filter += " ";
filter += rectangle[0].x+","+rectangle[1].y;
@@ -555,8 +559,8 @@
filter += rectangle[0].x+","+rectangle[0].y;
filter += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
filter += "</gml:Polygon></Intersects>";
- }
-
+ }
+
filter += "</ogc:Filter>";
url += param;
mb_get_geom(url, filter, i, wfs_config[js_wfs_conf_id[i]]['featuretype_name'], js_wfs_conf_id[i], db_wfs_conf_id[i]);
@@ -566,7 +570,7 @@
var tmp = queryGeom.get(0);
var mapPos = 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;
@@ -575,7 +579,9 @@
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=";
var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>";
filter += "<Intersects><ogc:PropertyName>";
@@ -584,9 +590,9 @@
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 += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1];
filter += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></ogc:Filter>";
url += param;
mb_get_geom(url, filter, i, wfs_config[js_wfs_conf_id[i]]['featuretype_name'], js_wfs_conf_id[i], db_wfs_conf_id[i]);
@@ -597,7 +603,7 @@
}
function mb_get_geom(url, filter, index, typename, js_wfs_conf_id, db_wfs_conf_id) {
-
+
mb_ajax_post("../" + wfsResultModulePath + wfsResultModuleFilename,{'url':url,'filter':filter,'typename':typename,'js_wfs_conf_id':js_wfs_conf_id, 'db_wfs_conf_id':db_wfs_conf_id},function(js_code,status){
if (js_code) {
eval(js_code);
@@ -618,7 +624,7 @@
if (numberOfFinishedAjaxCalls == numberOfAjaxCalls) {
numberOfFinishedAjaxCalls = 0;
mb_execWfsReadSubFunctions(_geomArray);
-
+
}
}
@@ -648,7 +654,7 @@
}
else {
resultArray[pos] = geom.e.getElementValueByName(wfsConf[wfsConfId]['element'][i]['element_name']);
- }
+ }
resultName += geom.e.getElementValueByName(wfsConf[wfsConfId]['element'][i]['element_name']) + " ";
}
}
@@ -683,7 +689,7 @@
listOfGeom += "<tr><td style='color:black;font-size:12px;'>edit all</td>\n";
listOfGeom += "<td><img title='edit all' src='"+buttonWfs_toDigitize_src+"' style='cursor:pointer' onclick='appendGeometryArrayToDigitize(_geomArray);'></img>";
listOfGeom += "</td>\n</tr>\n";
- listOfGeom += "<tr>\n<td> </td>\n</tr>\n";
+ listOfGeom += "<tr>\n<td> </td>\n</tr>\n";
}
for (var i = 0 ; i < _geomArray.count(); i ++) {
if (_geomArray.get(i).get(-1).isComplete()) {
@@ -691,7 +697,7 @@
listOfGeom += "\t\t\t onmouseover='mb_wfs_perform(\"over\",_geomArray.get("+i+"));' ";
listOfGeom += " onmouseout='mb_wfs_perform(\"out\",_geomArray.get("+i+"))' ";
listOfGeom += " onclick='mb_wfs_perform(\"click\",_geomArray.get("+i+")); showWfs("+i+");' ";
- var geomName = getListTitle(_geomArray.get(i));
+ var geomName = getListTitle(_geomArray.get(i));
//if (_geomArray.get(i).geomType == geomType.polygon) {geomName += "(polygon)";}
//else if (_geomArray.get(i).geomType == geomType.line) {geomName += "(line)";}
//else if (_geomArray.get(i).geomType == geomType.point) {geomName += "(point)";}
@@ -699,12 +705,12 @@
if(buttonWfs_toDigitize_on==1){
listOfGeom += "<td><img title='edit geometry object' src='"+buttonWfs_toDigitize_src+"' style='cursor:pointer' onclick='appendGeometryToDigitize("+i+");'></img></td>";
}
- listOfGeom += "\t\t</tr>\n";
+ listOfGeom += "\t\t</tr>\n";
}
}
}
listOfGeom += "</table>\n";
- return listOfGeom;
+ return listOfGeom;
}
function displayPopup(geom){
@@ -722,18 +728,18 @@
function showWfs(geometryIndex) {
var wfsConfIndex = _geomArray.get(geometryIndex).wfs_conf;
var currentWfsConf = wfsConf[wfsConfIndex];
-
+
var resultHtml = "";
resultHtml += "<table style='background-color:#EEEEEE;'>\n";
for (var i = 0 ; i <currentWfsConf.element.length; i ++) {
if(currentWfsConf.element[i].f_show_detail==1){
if( _geomArray.get(geometryIndex).e.getElementValueByName(currentWfsConf.element[i].element_name)!=false){
//console.log(currentWfsConf.element[i].element_name+"---"+currentWfsConf.element[i].f_respos);
- resultHtml +="<tr><td>\n";
+ resultHtml +="<tr><td>\n";
resultHtml += currentWfsConf.element[i].f_label;
- resultHtml +="</td>\n";
+ resultHtml +="</td>\n";
resultHtml += "<td>\n";
- var elementVal = _geomArray.get(geometryIndex).e.getElementValueByName(currentWfsConf.element[i].element_name);
+ var elementVal = _geomArray.get(geometryIndex).e.getElementValueByName(currentWfsConf.element[i].element_name);
if(currentWfsConf.element[i].f_form_element_html.indexOf("href")!=-1){
var setUrl = currentWfsConf.element[i].f_form_element_html.replace(/href\s*=\s*['|"]\s*['|"]/, "href='"+elementVal+"' target='_blank'");
if(setUrl.match(/><\/a>/)){
@@ -744,18 +750,18 @@
}
if(openLinkFromSearch=='1'){
window.open(elementVal, elementVal,"width=500, height=400,left=100,top=100,scrollbars=yes");
- }
+ }
resultHtml += newLink;
}
else{
resultHtml += elementVal;
}
- resultHtml += "</td></tr>\n";
+ resultHtml += "</td></tr>\n";
}
}
}
resultHtml += "</table>\n";
-
+
var getCenter = _geomArray.get(geometryIndex).getCenter();
// getMapPos for positioning of new PopupDiv near object in mapframe1
//var getMapPos = makeRealWorld2mapPos("mapframe1",getCenter.x, getCenter.y);
@@ -776,4 +782,4 @@
}
if(wfsResultToPopupDiv==1){
mb_registerWfsReadSubFunctions(function(geom){displayPopup(geom);});
-}
+}
\ No newline at end of file
Modified: branches/nimix_dev/http/javascripts/mod_wfs_client.html
===================================================================
--- branches/nimix_dev/http/javascripts/mod_wfs_client.html 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_wfs_client.html 2008-08-18 16:12:00 UTC (rev 2870)
@@ -7,7 +7,7 @@
<script type='text/javascript'>
-/*
+/*
* services['action']: instructs the servercomponent
* services['services']: infos about the services (wfs)
* services['services']['id']: a list of ids
@@ -17,7 +17,7 @@
var services = {};
/*
* wfsConf['action']: instructs the servercomponent
- * wfsConf['wfs']: the ID of the selected wfs
+ * wfsConf['wfs']: the ID of the selected wfs
* wfsConf['wfsConf']: infos about the wfs configurations
* wfsConf['wfsConf']['id']: a list of ids
* wfsConf['wfsConf']['abstract']: a corresponding list of descriptions
@@ -33,31 +33,31 @@
/*
* handleAssignment['action']: instructs the servercomponent
- * handleAssignment['selectedConf']: a list of wfs-conf Ids
+ * handleAssignment['selectedConf']: a list of wfs-conf Ids
* handleAssignment['selectedGui']: the selected Gui
*/
-var handleAssignment = {}
-
-/*
- * vupdateWfs['action']: instructs the servercomponent
- * vupdateWfs['wfs']: id of wfs to update
- * vupdateWfs['url']: capabilities url
- */
-var vupdateWfs = {};
-
-/*
- * deleteWfs_['action']: instructs the servercomponent
- * deleteWfs_['wfs']: id of wfs to update
- */
-var deleteWfs_ = {};
-
-/*
- * geturl['action']: instructs the servercomponent
- * geturl['wfs']: id of wfs to get the url for
- * geturl['column']: column of the url to get in table wfs
- */
-var geturl = {}
+var handleAssignment = {}
+/*
+ * vupdateWfs['action']: instructs the servercomponent
+ * vupdateWfs['wfs']: id of wfs to update
+ * vupdateWfs['url']: capabilities url
+ */
+var vupdateWfs = {};
+
+/*
+ * deleteWfs_['action']: instructs the servercomponent
+ * deleteWfs_['wfs']: id of wfs to update
+ */
+var deleteWfs_ = {};
+
+/*
+ * geturl['action']: instructs the servercomponent
+ * geturl['wfs']: id of wfs to get the url for
+ * geturl['column']: column of the url to get in table wfs
+ */
+var geturl = {}
+
var owsproxy = {}
@@ -80,41 +80,42 @@
var w = document.wfsForm.wfsList;
var ind = w.selectedIndex;
if(ind == -1){
- return false;
- }
- if(ind == w.options.length-1)
+ return false;
+ }
+ if(ind == w.options.length-1)
return "gui_confs";
- return w.options[ind].value;
+ return w.options[ind].value;
}
function getGuiConfs(){
guis['action'] = 'getAssignedConfs';
var g = document.wfsForm.guiList;
var ind = g.selectedIndex;
if(ind == -1){
- return false;
+ return false;
}
guis['selectedGui'] = g.options[ind].value;
- guis['selectedWfs'] = wfsConf['wfs'];
+ guis['selectedWfs'] = wfsConf['wfs'];
getData(guis);
-}
-/**
- * Sends an request to get the url to the capabilities doc of selected wfs
- *
- */
-
-function getUpdateUrl(column){
- geturl['action'] = 'getUpdateUrl';
- var w = document.wfsForm.wfsList;
- var ind = w.selectedIndex;
- if(ind == -1){
- alert("please select an WFS");
- return;
- }
- geturl['wfs'] = w.options[ind].value;
- geturl['column'] = column;
- getData(geturl);
-}
+}
+/**
+ * Sends an request to get the url to the capabilities doc of selected wfs
+ *
+ */
+function getUpdateUrl(column){
+ geturl['action'] = 'getUpdateUrl';
+ var w = document.wfsForm.wfsList;
+ var ind = w.selectedIndex;
+ if(ind == -1){
+ alert("please select an WFS");
+ return;
+ }
+ geturl['wfs'] = w.options[ind].value;
+ geturl['column'] = column;
+ geturl['wfs_version'] = '';
+ getData(geturl);
+}
+
function addConfsToGui(){
handleAssignment['action'] = 'add';
handleAssignment['confs'] = getSelectedConfs();
@@ -126,43 +127,48 @@
handleAssignment['confs'] = getSelectedAssignedConfs();
handleAssignment['gui'] = getSelectedGui();
getData(handleAssignment);
-}
-/**
- * Sends an update request to update the capabilities of selected wfs
- *
- * @return success
- * @type boolean
- */
-
-function updateWfs(){
- vupdateWfs['action'] = 'updateWfs';
- var w = document.wfsForm.wfsList;
- var ind = w.selectedIndex;
- if(ind == -1){
- alert("please select an WFS");
- return false;
- }
- vupdateWfs['wfs'] = w.options[ind].value;
- vupdateWfs['url'] = document.getElementById("updateUrl").value;
- getData(vupdateWfs);
- return true;
-}
-
-function deleteWfs(){
- deleteWfs_['action'] = 'deleteWfs';
- deleteWfs_['wfs'] = getSelectedWfs();
- if(deleteWfs_['wfs']&&deleteWfs_['wfs']!="gui_confs"){
- if(confirm("Do you really want to delete the Wfs with Wfs-id:"+deleteWfs_['wfs']+"?")){
- getData(deleteWfs_);
- }
- return true;
- }
- return false;
-}
+}
+/**
+ * Sends an update request to update the capabilities of selected wfs
+ *
+ * @return success
+ * @type boolean
+ */
+function updateWfs(){
+ vupdateWfs['action'] = 'updateWfs';
+ var w = document.wfsForm.wfsList;
+ var ind = w.selectedIndex;
+ if(ind == -1){
+ alert("please select an WFS");
+ return false;
+ }
+ vupdateWfs['wfs'] = w.options[ind].value;
+ if(document.getElementById("updateUrl").value == ''){
+ alert("Please choose the link to the new WFS Capabilities URL.");
+ return false;
+ }
+
+ vupdateWfs['url'] = document.getElementById("updateUrl").value;
+ getData(vupdateWfs);
+ return true;
+}
+
+function deleteWfs(){
+ deleteWfs_['action'] = 'deleteWfs';
+ deleteWfs_['wfs'] = getSelectedWfs();
+ if(deleteWfs_['wfs']&&deleteWfs_['wfs']!="gui_confs"){
+ if(confirm("Do you really want to delete the Wfs with Wfs-id:"+deleteWfs_['wfs']+"?")){
+ getData(deleteWfs_);
+ }
+ return true;
+ }
+ return false;
+}
+
function setIndicator(){
var str = "<img src='../img/indicator_wheel.gif'>";
- document.getElementById("indicator").innerHTML = str;
+ document.getElementById("indicator").innerHTML = str;
}
function removeIndicator(){
document.getElementById("indicator").innerHTML = "";
@@ -202,38 +208,38 @@
break;
case "getWfsConfData":
getOwsproxy();
- appendWfsConfData(dsJson);
+ appendWfsConfData(dsJson);
break;
case "getGuis":
appendGuis(dsJson);
break;
case "getAssignedConfs":
- appendGuiConfs(dsJson);
- break;
- case "getUpdateUrl":
+ appendGuiConfs(dsJson);
+ break;
+ case "getUpdateUrl":
setUpdateUrl(dsJson)
break;
case "add":
getGuiConfs();
break;
case "remove":
- getGuiConfs();
- break;
- case "updateWfs":
- if(dsJson['success'])
- alert("Update performed.");
- else
+ getGuiConfs();
+ break;
+ case "updateWfs":
+ if(dsJson['success'])
+ alert("Update performed.");
+ else
alert("An error occured, see log for details.");
- break;
- case "deleteWfs":
- if(dsJson['success']){
- clearList(document.forms[0].wfsList);
- clearList(document.forms[0].guiList);
- getWfsList();
- getGuis();
- alert("WFS deleted.");
- }
break;
+ case "deleteWfs":
+ if(dsJson['success']){
+ clearList(document.forms[0].wfsList);
+ clearList(document.forms[0].guiList);
+ getWfsList();
+ getGuis();
+ alert("WFS deleted.");
+ }
+ break;
case "setOwsproxy":
displayOwsproxy(dsJson);
break;
@@ -247,23 +253,27 @@
alert("No action specified.....");
break;
}
- }
+ }
else{
alert("An error occured!");
}
removeIndicator();
});
-}
+}
-/**
- * Sets the update url comming from db in the html form
- *
- */
-
-function setUpdateUrl(dsJson){
- document.getElementById("updateUrl").value = dsJson['url'];
-}
+/**
+ * Sets the update url comming from db in the html form
+ *
+ */
+function setUpdateUrl(dsJson){
+ document.getElementById("updateUrl").value = dsJson['url'];
+}
+
+function clearUpdateUrl(){
+ document.getElementById("updateUrl").value = '';
+}
+
/*
*
*/
@@ -274,23 +284,23 @@
else{
document.wfsForm.owsproxy.checked = true;
}
-}
+}
function appendServices(dsJson){
services['services'] = dsJson.services;
- var o = services['services'];
+ var o = services['services'];
for(var i=0; i<o.id.length; i++){
appendOption(document.forms[0].wfsList, o.title[i], o.id[i], false);
- }
- appendOption(document.forms[0].wfsList, "WFS Configurations", "-1", false);
+ }
+ appendOption(document.forms[0].wfsList, "all WFS Configurations", "-1", false);
}
function appendWfsConfData(dsJson){
wfsConf['wfsConf'] = {};
wfsConf['wfsConf'] = dsJson.wfsConf;
- var o = wfsConf['wfsConf'];
- document.forms[0].wfsConfList.innerHTML = '';
- if(typeof(o.id)=="undefined")
+ var o = wfsConf['wfsConf'];
+ document.forms[0].wfsConfList.innerHTML = '';
+ if(typeof(o.id)=="undefined")
return;
for(var i=0; i<o.id.length; i++){
appendOption(document.forms[0].wfsConfList, o.abstract[i], o.id[i], false);
@@ -300,10 +310,10 @@
function appendGuis(dsJson){
guis['id'] = {};
guis['id'] = dsJson.id;
- var o = guis['id'];
+ var o = guis['id'];
for(var i=0; i<o.length; i++){
appendOption(document.forms[0].guiList, o[i], o[i], false);
- }
+ }
}
function appendGuiConfs(dsJson){
var list = document.forms[0].guiConfList;
@@ -311,18 +321,18 @@
for(var i=0; i<dsJson.assignedConfs.length; i++){
var confAbstract = getConfAbstract(dsJson.assignedConfs[i]);
appendOption(list, confAbstract, dsJson.assignedConfs[i], false);
- }
+ }
}
function appendOption(boxObject, optionText, optionValue, selected){
var newOption = new Option(optionText,optionValue,false,selected);
boxObject.options[boxObject.length] = newOption;
-}
-function clearList(boxObject){
- boxObject.length = 0;
-}
+}
+function clearList(boxObject){
+ boxObject.length = 0;
+}
/*
- * returns id and abstract from a wfs configuration
+ * returns id and abstract from a wfs configuration
*/
function getConfAbstract(confId){
var c = wfsConf['wfsConf'];
@@ -356,6 +366,15 @@
var ind = document.forms[0].guiList.selectedIndex;
return document.forms[0].guiList.options[ind].value;
}
+
+function previewWfsUrl(){
+ var previewUrl = document.forms[0].updateUrl.value;
+ if(previewUrl !=''){
+ capabilitiesWin = window.open(previewUrl);
+ }else{
+ alert("Please select a WFS first");
+ }
+}
</script>
</head>
<body onload='getWfsList();getGuis();'>
@@ -367,43 +386,48 @@
<fieldset class="leftContainer">
<legend>WFS List</legend>
<p>
- <select size='4' name='wfsList' class='wfsList' onchange='getWfsConfData();getGuiConfs();'></select>
+ <select size='10' name='wfsList' class='wfsList' onchange='getWfsConfData();getGuiConfs();clearUpdateUrl();'></select>
</p>
</fieldset>
-
+
<fieldset class="rightContainer">
<legend>Options</legend>
<p>
- <input type='checkbox' name='owsproxy' id='owsproxy' onclick='setOwsproxy(this)' />
- <label for="owsproxy">OWSProxy</label>
+ <input type='checkbox' name='owsproxy' id='owsproxy' onclick='setOwsproxy(this)' />
+ <label for="owsproxy">enable OWSProxy for the selected WFS</label>
+ <br><br>
+ <input type='button' value='Delete WFS' name='delete' id='deleteButton' onclick='deleteWfs()' />
+ </p>
+ </fieldset>
+
+ <fieldset class="rightContainer">
+ <legend>Update WFS</legend>
+ <p>
+ Please choose the Link to the WFS Capabilities URL:
+ <br />
+ <a href='javascript:getUpdateUrl("wfs_getcapabilities")'>wfs_getcapabilities</a> or <a href='javascript:getUpdateUrl("wfs_upload_url")'>wfs_upload_url</a>
+ </label>
+ <input id='updateUrl' type='text' value='' name='updateUrl' class='updateUrl' />
<br />
- <label for="updateUrl">
- Link to new WFS Capabilities URL:
- <br />
- (<a href='javascript:getUpdateUrl("wfs_getcapabilities")'>wfs_getcapabilities</a>, <a href='javascript:getUpdateUrl("wfs_upload_url")'>wfs_upload_url</a>)
- </label>
- <input id='updateUrl' type='text' value='' name='updateUrl' class='updateUrl' />
- <br />
- <input type='button' value='Update WFS' name='update' id='updateButton' onclick='updateWfs()' />
- <input type='button' value='Delete WFS' name='delete' id='deleteButton' onclick='deleteWfs()' />
+ <input type='button' value='Update WFS' name='update' id='updateButton' onclick='updateWfs()' />
+ <input type='button' value='Preview WFS Capabilities' name='preview' id='previewButton' onclick='previewWfsUrl();' />
</p>
</fieldset>
+<hr />
- <hr />
-
<fieldset class="rightContainer">
<legend>GUI List</legend>
<p>
- <select size='4' name='guiList' class='guiList' onchange='getGuiConfs()'></select>
+ <select size='6' name='guiList' class='guiList' onchange='getGuiConfs()'></select>
</p>
</fieldset>
- <hr />
+<hr />
<fieldset class="leftContainer">
<legend>WFS Configuration List</legend>
<p>
- <select size='4' name='wfsConfList' class='wfsConfList' onchange='' multiple="multiple"></select>
+ <select size='6' name='wfsConfList' class='wfsConfList' onchange='' multiple="multiple"></select>
</p>
</fieldset>
@@ -418,11 +442,11 @@
<fieldset class="rightContainer">
<legend>GUI Configuration List</legend>
<p>
- <select size='4' name='guiConfList' class='guiConfList' onchange='' multiple="multiple"></select>
+ <select size='6' name='guiConfList' class='guiConfList' onchange='' multiple="multiple"></select>
</p>
- </fieldset>
-
- <hr />
+ </fieldset>
+
+<hr />
</form>
</body>
Deleted: branches/nimix_dev/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_wfs_gazetteer_client.php 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/mod_wfs_gazetteer_client.php 2008-08-18 16:12:00 UTC (rev 2870)
@@ -1,477 +0,0 @@
-<?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
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
-
-$gui_id = $_SESSION["mb_user_gui"];
-$target = $_REQUEST["e_target"];
-$isLoaded = $_REQUEST["isLoaded"];
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<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
- include '../include/dyn_js.php';
- include '../include/dyn_php.php';
-
- echo "var targetString = '" . $target . "';";
- echo "var wfsConfIdString = '" . $wfsConfIdString . "';";
- echo "var e_id_css = '" . $e_id_css . "';";
-?>
-
-// Element var maxHighlightedPoints
-try{
- if (maxHighlightedPoints){
- maxHighlightedPoints = Number(maxHighlightedPoints);
-
- if (isNaN(maxHighlightedPoints)) {
-// var e = new parent.Mb_warning("mod_wfs_gazetteer_client.php: Element var maxHighlightedPoints must be a number.");
- }
- }
-}
-catch(e){
- maxHighlightedPoints = 0;
-// var e = new parent.Mb_warning("mod_wfs_gazetteer_client.php: Element var maxHighlightedPoints is not set, see 'edit element vars'.");
-}
-
-var targetArray = targetString.split(",");
-var global_wfsConfObj;
-var global_selectedWfsConfId;
-var point_px = 10;
-var resultGeom = null;
-var cw_fillcolor = "#cc33cc";
-
-
-parent.mb_registerInitFunctions("window.frames['"+this.name+"'].initModWfsGazetteer()");
-
-function openwindow(Adresse) {
- Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
- Fenster1.focus();
-}
-//----------------------------------------------------------------------------------
-
-function appendWfsConf(newWfsConfIdString) {
- // merge with existing wfs conf ids
- if (wfsConfIdString !== "") {
- if (newWfsConfIdString !== "") {
- wfsConfIdString += "," + newWfsConfIdString;
-
- // rebuild form
- initModWfsGazetteer();
- }
- }
- else {
- wfsConfIdString = newWfsConfIdString;
-
- // rebuild form
- initModWfsGazetteer();
- }
-
-}
-
-function removeChildNodes(node) {
- while (node.childNodes.length > 0) {
- var childNode = node.firstChild;
- node.removeChild(childNode);
- }
-}
-
-/**
- * removes whitespaces and endlines before and after a string
- *
- */
-function trimString (str) {
- return str.replace(/^\s+|\s+|\n+$/g, '');
-}
-
-function appendStyles() {
- var styleObj;
- var rule = global_wfsConfObj[global_selectedWfsConfId].g_style + global_wfsConfObj[global_selectedWfsConfId].g_res_style;
- if (parent.ie) {
- var styleSheetObj=document.createStyleSheet();
- styleObj=styleSheetObj.owningElement || styleSheetObj.ownerNode;
- styleObj.setAttribute("type","text/css");
- ruleArray = rule.split("}");
- for (var i=0; i < ruleArray.length - 1; i++) {
- var currentRule = trimString(ruleArray[i]);
- var nameValueArray = currentRule.split("{");
- var name = nameValueArray[0];
- var value = nameValueArray[1];
- styleSheetObj.addRule(name,value);
- }
- }
- else {
- styleObj=document.createElement("style");
- styleObj.setAttribute("type","text/css");
- document.getElementsByTagName("head")[0].appendChild(styleObj);
- styleObj.appendChild(document.createTextNode(rule+"\n"));
- }
-}
-
-//----------------------------------------------------------------------------------
-
-
-function initModWfsGazetteer() {
- // empty nodes
- var nodesToEmpty = ["selectWfsConfForm", "wfsForm", "res", "wfsInfo"];
- while (nodesToEmpty.length > 0) {
- var currentId = nodesToEmpty.pop();
- var currentNode = document.getElementById(currentId);
- removeChildNodes(currentNode);
- }
- document.getElementById("wfsGeomType").style.visibility = "hidden";
- document.getElementById("wfsRemove").style.visibility = "hidden";
-
- 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;
- if (typeof(global_wfsConfObj[wfsConfId] != 'function')) {
- wfsCount++;
- }
- }
- if (wfsCount === 0) {
- var e = new parent.Mb_exception("no wfs conf id available.");
- }
- else if (wfsCount === 1) {
- appendStyles();
- appendWfsForm();
- setWfsInfo();
- }
- else {
- appendWfsConfSelectBox();
- setWfsInfo();
- }
- parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
- });
-}
-
-function setWfsInfo() {
- var bulbNode = document.getElementById("wfsInfo");
-
- // append bulb image
- removeChildNodes(bulbNode);
- var imgNode = document.createElement("img");
- imgNode.id = "wfsInfoImg";
- //imgNode.src = "../img/button_digitize/geomInfo.png";
- imgNode.src = "../img/tree_new/info.png";
- imgNode.border = 0;
- bulbNode.appendChild(imgNode);
- bulbNode.href = "javascript:openwindow('../php/mod_featuretypeMetadata.php?wfs_conf_id=" + global_selectedWfsConfId.toString() + "');";
- bulbNode.style.visibility = "visible";
-
- // set wfsGeomType image
- var wfsGeomTypeNode = document.getElementById("wfsGeomType");
- var wfsGeomType = "";
- for (var i=0; i < global_wfsConfObj[global_selectedWfsConfId].element.length; i++) {
- if (parseInt(global_wfsConfObj[global_selectedWfsConfId].element[i].f_geom)) {
- wfsGeomType = global_wfsConfObj[global_selectedWfsConfId].element[i].element_type;
- }
- }
- if (wfsGeomType.match(/Point/)) {
- wfsGeomTypeNode.src = "../img/button_digitize/point.png";
- wfsGeomTypeNode.style.visibility = 'visible';
- }
- else if (wfsGeomType.match(/Line/)) {
- wfsGeomTypeNode.src = "../img/button_digitize/line.png";
- wfsGeomTypeNode.style.visibility = 'visible';
- }
- else if (wfsGeomType.match(/Polygon/)) {
- wfsGeomTypeNode.src = "../img/button_digitize/polygon.png";
- wfsGeomTypeNode.style.visibility = 'visible';
- }
- else {
- var e = new parent.Mb_exception("WFS gazetteer: geometry type unknown.");
- }
-
- // set image: remove this WFS
- var wfsRemoveNode = document.getElementById("wfsRemove");
- //wfsRemoveNode.src = "../img/button_digitize/geomRemove.png";
- wfsRemoveNode.src = "../img/tree_new/delete_wms.png";
- wfsRemoveNode.style.visibility = 'visible';
- // 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();
- };
- }
- // Firefox
- else {
- wfsRemoveNode.onclick = function () {
- delete global_wfsConfObj[global_selectedWfsConfId];
- setWfsConfIdString();
- initModWfsGazetteer();
- parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
- }
- }
-}
-
-function setWfsConfIdString() {
- var str = [];
- for (var wfsConfId in global_wfsConfObj) {
- global_selectedWfsConfId = wfsConfId;
- if (typeof(global_wfsConfObj[wfsConfId] != 'function')) {
- str.push(wfsConfId);
- }
- }
- wfsConfIdString = str.join(",");
-}
-
-function appendWfsConfSelectBox() {
- var selectNode = document.createElement("select");
- selectNode.name = "wfs_conf_sel";
- var wfsFormNode = document.getElementById("selectWfsConfForm");
- selectNode.onchange = function() {
- global_selectedWfsConfId = this.value;
- setWfsInfo();
- appendStyles();
- appendWfsForm();
- };
- var isSelected = false;
- for (var wfsConfId in global_wfsConfObj) {
- var optionNode = document.createElement("option");
-
- optionNode.value = wfsConfId;
- optionNode.innerHTML = global_wfsConfObj[wfsConfId].g_label;
-
- if (!isSelected) {
- optionNode.selected = true;
- isSelected = true;
- global_selectedWfsConfId = wfsConfId;
- }
- selectNode.appendChild(optionNode);
- }
-
- var form = document.getElementById('selectWfsConfForm');
- form.appendChild(selectNode);
-
- appendStyles();
- appendWfsForm();
-}
-
-function appendWfsForm() {
- var form = document.getElementById("wfsForm");
- 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;
-
- for (var i = 0; i < wfsConfElementArray.length; i++){
- if (parseInt(wfsConfElementArray[i].f_search)) {
- var spanNode = document.createElement("span");
- spanNode.setAttribute("id", "ttttt");
- spanNode.className = wfsConfElementArray[i].f_label_id;
- spanNode.innerHTML = wfsConfElementArray[i].f_label;
- var inputNode = document.createElement("input");
- inputNode.type = "text";
- inputNode.className = wfsConfElementArray[i].f_style_id;
- inputNode.id = wfsConfElementArray[i].element_name;
-
- form.appendChild(spanNode);
- form.appendChild(inputNode);
- form.appendChild(document.createElement("br"));
- }
- }
- var submitButton = document.createElement("input");
- submitButton.type = "submit";
- submitButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
- submitButton.value = global_wfsConfObj[global_selectedWfsConfId].g_button;
-
- form.appendChild(submitButton);
-}
-
-function validate(){
- 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){
- return false;
- }
- else{
- var andConditions = "";
-
- var el = global_wfsConfObj[global_selectedWfsConfId].element;
-
- for (var i = 0; i < el.length; i++) {
- if (el[i]['f_search'] == 1 && document.getElementById(el[i]['element_name']).value != '') {
-
- var a = new Array();
- a = document.getElementById(el[i]['element_name']).value.split(",");
- var orConditions = "";
- for (var j=0; j < a.length; j++) {
-
- orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
- orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
- orConditions += "<ogc:Literal>*";
- if(el[i]['f_toupper'] == 1){
- orConditions += a[j].toUpperCase();
- }
- else{
- orConditions += a[j];
- }
- orConditions += "*</ogc:Literal>";
- orConditions += "</ogc:PropertyIsLike>";
- }
- if(a.length > 1){
- andConditions += "<Or>" + orConditions + "</Or>";
- }
- else {
- andConditions += orConditions;
- }
- }
- }
-
- var u = global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature + parent.mb_getConjunctionCharacter(global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature);
- u += "REQUEST=getFeature&Typename="+global_wfsConfObj[global_selectedWfsConfId].featuretype_name+"&Version=1.0.0&service=WFS";
- u += "&filter=";
-
- if (filterParameterCount > 1) {
- 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='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
- var parameters = {command:"getSearchResults", "wfs_conf_id":global_selectedWfsConfId, "frame":this.name, "url":u, "filter":filter, "backlink":""};
- parent.mb_ajax_get("../php/mod_wfs_gazetteer_server.php", parameters, function (jsCode, status) {
- document.getElementById("res").innerHTML = "<table><tr><td>Arranging search results...</td></tr></table>";
-
- eval(jsCode);
-
- 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;
-
- 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 body = "";
- if (typeof(geom) == 'object') {
- resultGeom = geom; // set the global variable
- for (var i=0; i < geom.count(); i++) {
- body += "<div id='geom"+i+"'style='cursor:pointer;' ";
- if ((i % 2) === 0) {
- body += "class='even'";
- }
- else {
- body += "class='uneven'";
- }
- body += " onmouseover=\"setResult('over', this.id)\" ";
- body += " onmouseout=\"setResult('out', this.id)\" ";
- body += " onclick=\"setResult('click', this.id)\">";
- for (var j=0; j < geom.get(i).e.count(); j++) {
- body += geom.get(i).e.getValue(j) + " ";
- }
- body += "</div>";
- }
- }
- else {
- body = "Kein Ergebnis.";
- }
- document.getElementById('res').innerHTML = body;
- });
- }
- return false;
-}
-
-function getNumberOfFilterParameters(){
- var cnt = 0;
- var el = global_wfsConfObj[global_selectedWfsConfId].element;
-
- for (var i = 0; i < el.length; i++){
- if( el[i]['f_search'] == 1){
- if (document.getElementById(el[i]['element_name']).value != '') {
- cnt++;
- }
- }
- }
- return cnt;
-}
-/*
-* event -> {over || out || click}
-* geom -> commaseparated coordinates x1,y1,x2,y2 ...
-*/
-function setResult(event, id){
- var index = parseInt(id.slice(4));
-
- var currentGeom = resultGeom.get(index);
- if (maxHighlightedPoints > 0 && currentGeom.getTotalPointCount() > maxHighlightedPoints) {
- currentGeom = currentGeom.getBBox4();
- }
- if (event == "over") {
- global_resultHighlight.add(currentGeom, cw_fillcolor);
- global_resultHighlight.paint();
- }
- else if (event == "out"){
- global_resultHighlight.del(currentGeom, cw_fillcolor);
- global_resultHighlight.paint();
- }
- else if (event == "click"){
- global_resultHighlight.del(currentGeom, cw_fillcolor);
- var bbox = currentGeom.getBBox();
- var bufferFloat = parseFloat(global_wfsConfObj[global_selectedWfsConfId].g_buffer);
- var buffer = new parent.Point(bufferFloat,bufferFloat);
- bbox[0] = bbox[0].minus(buffer);
- bbox[1] = bbox[1].plus(buffer);
- parent.mb_calculateExtent(targetArray[0], bbox[0].x, bbox[0].y, bbox[1].x, bbox[1].y);
- parent.zoom(targetArray[0], 'true', 1.0);
- global_resultHighlight.add(currentGeom, cw_fillcolor);
- global_resultHighlight.paint();
- }
- global_resultHighlight.paint();
- return true;
-}
-</script>
-</head>
-<body leftmargin='0' topmargin='10' bgcolor='#ffffff'>
-<form name='selectWfsConfForm' id='selectWfsConfForm'></form>
-<img src = "" name='wfsGeomType' id='wfsGeomType'>
-<img src = "" name='wfsRemove' id='wfsRemove'>
-<a name='wfsInfo' id='wfsInfo'></a>
-<form name='wfsForm' id='wfsForm' onsubmit='return validate()'></form>
-<div name='res' id='res' style='width:180px'></div>
-</body>
-</html>
\ No newline at end of file
Modified: branches/nimix_dev/http/javascripts/wfs.js
===================================================================
--- branches/nimix_dev/http/javascripts/wfs.js 2008-08-18 16:10:50 UTC (rev 2869)
+++ branches/nimix_dev/http/javascripts/wfs.js 2008-08-18 16:12:00 UTC (rev 2870)
@@ -44,7 +44,7 @@
var usemap = "";
var mod_usemap_radius = 10;
var mod_usemap_line_tolerance = 5;
-var useCheckboxForHighlighting = true;
+var useCheckboxForHighlighting = false;
var mb_wfs_fetch = new GeometryArray();
@@ -71,8 +71,10 @@
mb_registerSubFunctions('mod_usemap("")');
}
-if (useCheckboxForHighlighting) {
- mb_registerSubFunctions('highlight.paint()');
+if (useCheckboxForHighlighting) {
+ eventInit.register(function() {
+ mb_registerSubFunctions('highlight.paint()');
+ });
}
/*
@@ -228,8 +230,9 @@
str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
} else if (myconf['namespaces'][q]['name'] == featureNS) {
ns_featureNS = true;
- str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
- }
+ str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" '
+ strForSchemaLocation = myconf['namespaces'][q]['location'];
+ }
}
if (ns_gml == false) str += 'xmlns:gml="http://www.opengis.net/gml" ';
@@ -238,9 +241,14 @@
if (ns_featureNS == false) str += 'xmlns:"+featureNS+"="http://www.someserver.com/"+featureNS+"" ';
if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
- str += 'xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd">';
+ str += 'xsi:schemaLocation="http://www.opengis.net/wfs';
+ str += ' http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd';
+ str += ' ' + strForSchemaLocation;
+ str += ' '+ myconf['wfs_describefeaturetype'];
+ //str += mb_getConjunctionCharacter(myconf['wfs_describefeaturetype']);
+ //str += 'typename=' + myconf['featuretype_name'];
+ str += '">';
-
//
// ---------------------------------------- SAVE -------------------------------------------------
//
More information about the Mapbender_commits
mailing list