svn commit: r38 - trunk/mapbender/http/javascripts
uli at osgeo.org
uli at osgeo.org
Thu Apr 13 16:20:00 EDT 2006
Author: uli
Date: 2006-04-13 20:20:00+0000
New Revision: 38
Added:
trunk/mapbender/http/javascripts/map.php
trunk/mapbender/http/javascripts/map_obj.js
trunk/mapbender/http/javascripts/map_obj.js_bak
trunk/mapbender/http/javascripts/mod_addWMS.php
trunk/mapbender/http/javascripts/mod_addWMSfromList.php
trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php
trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js
trunk/mapbender/http/javascripts/mod_adminNavigation.js
trunk/mapbender/http/javascripts/mod_back.php
trunk/mapbender/http/javascripts/mod_box.js
trunk/mapbender/http/javascripts/mod_box1.js
trunk/mapbender/http/javascripts/mod_cardindex.js
trunk/mapbender/http/javascripts/mod_center1.php
trunk/mapbender/http/javascripts/mod_closePolygon.js
trunk/mapbender/http/javascripts/mod_closePolygonExt.js
trunk/mapbender/http/javascripts/mod_coords.php
trunk/mapbender/http/javascripts/mod_coords_div.php
trunk/mapbender/http/javascripts/mod_copyright.php
trunk/mapbender/http/javascripts/mod_dependentDiv.php
trunk/mapbender/http/javascripts/mod_dependentIframe.php
trunk/mapbender/http/javascripts/mod_digitize_js.php
trunk/mapbender/http/javascripts/mod_digitize_tab.php
trunk/mapbender/http/javascripts/mod_digitize_tab_gml2java_beta.php
trunk/mapbender/http/javascripts/mod_displayObj.js
trunk/mapbender/http/javascripts/mod_displayWmc.php
trunk/mapbender/http/javascripts/mod_dragMapSize.php
trunk/mapbender/http/javascripts/mod_embedded_legend.php
trunk/mapbender/http/javascripts/mod_export_image.php
trunk/mapbender/http/javascripts/mod_featureInfo.php
trunk/mapbender/http/javascripts/mod_featureInfoRedirect.php
trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php
trunk/mapbender/http/javascripts/mod_forward.php
trunk/mapbender/http/javascripts/mod_getArea.php
trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php
trunk/mapbender/http/javascripts/mod_key.php
trunk/mapbender/http/javascripts/mod_legend.php
trunk/mapbender/http/javascripts/mod_legend_tab.php
trunk/mapbender/http/javascripts/mod_loadwmc.php
trunk/mapbender/http/javascripts/mod_log.js
trunk/mapbender/http/javascripts/mod_measure.php
trunk/mapbender/http/javascripts/mod_navFrame.php
trunk/mapbender/http/javascripts/mod_pan.php
trunk/mapbender/http/javascripts/mod_permanentHighlight.js
trunk/mapbender/http/javascripts/mod_print1.php
trunk/mapbender/http/javascripts/mod_repaint.php
trunk/mapbender/http/javascripts/mod_rubber.js
trunk/mapbender/http/javascripts/mod_rubberExt.js
trunk/mapbender/http/javascripts/mod_sandclock.php
trunk/mapbender/http/javascripts/mod_sandclock2.php
trunk/mapbender/http/javascripts/mod_saveWKT.js
trunk/mapbender/http/javascripts/mod_savewmc.php
trunk/mapbender/http/javascripts/mod_scaleHint.php
trunk/mapbender/http/javascripts/mod_scaleSel.php
trunk/mapbender/http/javascripts/mod_scaleText.php
trunk/mapbender/http/javascripts/mod_scalebar.php
trunk/mapbender/http/javascripts/mod_selArea.php
trunk/mapbender/http/javascripts/mod_selArea1.php
trunk/mapbender/http/javascripts/mod_selectMapsize.php
trunk/mapbender/http/javascripts/mod_setBBOX1.php
trunk/mapbender/http/javascripts/mod_setBackground.php
trunk/mapbender/http/javascripts/mod_setBackground_all.php
trunk/mapbender/http/javascripts/mod_setTimeout.php
trunk/mapbender/http/javascripts/mod_state.php
trunk/mapbender/http/javascripts/mod_tab.js
trunk/mapbender/http/javascripts/mod_tab.php
trunk/mapbender/http/javascripts/mod_tab_gui.js
trunk/mapbender/http/javascripts/mod_tab_gui_cb.js
trunk/mapbender/http/javascripts/mod_tab_gui_de.js
trunk/mapbender/http/javascripts/mod_toggleModule.php
trunk/mapbender/http/javascripts/mod_treeConf.js
trunk/mapbender/http/javascripts/mod_usemap.php
trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
trunk/mapbender/http/javascripts/mod_zoomCoords.php
trunk/mapbender/http/javascripts/mod_zoomFull.php
trunk/mapbender/http/javascripts/mod_zoomIn1.php
trunk/mapbender/http/javascripts/mod_zoomOut1.php
trunk/mapbender/http/javascripts/wfs.js
trunk/mapbender/http/javascripts/wfs_obj.js
Log:
import Mapbender source without history
Added: trunk/mapbender/http/javascripts/map.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/map.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/map.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,1312 @@
+<?php
+# $Id: map.php,v 1.38 2006/03/20 10:01:58 astrid_emde Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/javascripts/map.php,v 1.38 2006/03/20 10:01:58 astrid_emde Exp $
+# 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.
+
+ob_start();
+include('../../conf/mapbender.conf');
+session_start();
+header('Content-type: application/x-javascript');
+
+?>
+/*GLOBALS*/
+var ie = document.all?1:0;
+var n6 = document.getElementById&&!document.all?1:0;
+var n4 = document.layers?1:0;
+
+var mb_feature_count = 100;
+
+var mb_resolution = 28.35;
+var mb_mapObj = new Array();
+var mb_fiWin = null;
+var mb_panActive = false;
+var clickX;
+var clickY;
+var mb_start_x = 0;
+var mb_start_y = 0;
+var mb_end_x = 0;
+var mb_end_y = 0;
+var mb_offset_top = 0;
+var mb_offset_right = 0;
+var mb_offset_bottom = 0;
+var mb_offset_left = 0;
+var mb_log = null;
+
+var mb_MapRequestSubFunctions = new Array();
+var mb_MapRequestPreFunctions = new Array();
+var mb_FeatureInfoPreFunctions = new Array();
+var mb_PanSubElements = new Array();
+var mb_InitFunctions = new Array();
+var mb_MapObjectSubFunctions = new Array();
+var mb_GetScalePreFunctions = new Array();
+var mb_vendorSpecific = new Array();
+var mb_loadWmsSubFunctions = new Array();
+var mb_security_proxy = "http://wms1.ccgis.de/mapbender/tools/security_proxy.php?mb_ows_security_proxy=";
+
+<?php
+echo "var mb_nr = '".SID."';";
+echo "var mb_myLogin = '".$_SESSION["mb_login"]."';";
+echo "var mb_styleID = '".md5($_SESSION["mb_user_name"])."';";
+echo "var mb_myBBOX = '".$_SESSION["mb_myBBOX"]."';";
+?>
+
+var mb_trans = new Image;
+mb_trans.src = "../img/transparent.gif";
+/*END OF GLOBALS*/
+
+
+function init(){
+ for(var i=0; i<mb_InitFunctions.length; i++){
+ eval(mb_InitFunctions[i]);
+ }
+ for(var i=0; i<mb_mapObj.length; i++){
+ setMapRequest(mb_mapObj[i].frameName);
+ }
+}
+/*registerFunctions*/
+function mb_registerInitFunctions(stringFunction){
+ mb_InitFunctions[mb_InitFunctions.length] = stringFunction;
+}
+function mb_registerPanSubElement(elName){
+ var ind = mb_PanSubElements.length;
+ mb_PanSubElements[ind] = elName;
+}
+function mb_registerPreFunctions(stringFunction){
+ mb_MapRequestPreFunctions[mb_MapRequestPreFunctions.length] = stringFunction;
+}
+function mb_registerFeatureInfoPreFunctions(stringFunction){
+ mb_FeatureInfoPreFunctions[mb_FeatureInfoPreFunctions.length] = stringFunction;
+}
+function mb_registerSubFunctions(stringFunction){
+ mb_MapRequestSubFunctions[mb_MapRequestSubFunctions.length] = stringFunction;
+}
+function mb_registerMapObj(frameName, elementName,wms_index,width, height){
+ mb_mapObj[mb_mapObj.length] = new mb_mapObj_const(frameName, elementName, width, height, wms_index);
+}
+function mb_registerMapObjectSubFunctions(stringFunction){
+ mb_MapObjectSubFunctions[mb_MapObjectSubFunctions.length] = stringFunction;
+}
+function mb_registerGetScalePreFunctions(stringFunction){
+ mb_GetScalePreFunctions[mb_GetScalePreFunctions.length] = stringFunction;
+}
+function mb_registerVendorSpecific(stringFunction){
+ mb_vendorSpecific[mb_vendorSpecific.length] = stringFunction;
+}
+function mb_registerloadWmsSubFunctions(stringFunction){
+ mb_loadWmsSubFunctions[mb_loadWmsSubFunctions.length] = stringFunction;
+}
+
+function deleteWmsObject() {
+ wms = new Array();
+ wms_layer_count = 0;
+}
+
+function mb_mapObj_const(frameName, elementName, width, height, wms_index){
+ this.width = width;
+ this.height = height;
+ this.frameName = frameName;
+ this.elementName = elementName;
+ this.layers = new Array();
+ this.styles = new Array();
+ this.querylayers = new Array();
+ this.geom = "";
+ this.gml = "";
+ if(wms_index != null){
+ this.wms = new Array();
+ this.wms[0] = wms[wms_index];
+ this.wms[0].mapURL = false;
+ var cnt_layers = 0;
+ var cnt_querylayers = 0;
+ var styles = "";
+ var layers = "";
+ var querylayers = "";
+ for(var ii=0; ii<this.wms[0].objLayer.length; ii++){
+ if(this.wms[0].objLayer[ii].gui_layer_visible == 1 && ii>0){
+ if(cnt_layers > 0){layers += ","; styles += ","; }
+ layers += this.wms[0].objLayer[ii].layer_name;
+ styles += "";
+ cnt_layers++;
+ }
+ if(this.wms[0].objLayer[ii].gui_layer_querylayer == 1 && ii>0){
+ if(cnt_querylayers > 0){querylayers += ",";}
+ querylayers += this.wms[0].objLayer[ii].layer_name;
+ cnt_querylayers++;
+ }
+ }
+ this.layers[0] = layers;
+ this.styles[0] = styles;
+ this.querylayers[0] = querylayers;
+ }
+ else{
+ this.wms = new Array();
+ for(i=0; i<wms.length; i++){
+ this.wms[i] = wms[i];
+ this.wms[i].mapURL = false;
+ }
+ for(var i=0; i< this.wms.length; i++){
+ var cnt_layers = 0;
+ var cnt_querylayers = 0;
+ var styles = "";
+ var layers = "";
+ var querylayers = "";
+ for(var ii=0; ii<this.wms[i].objLayer.length; ii++){
+ if(this.wms[i].objLayer[ii].gui_layer_visible == 1 && ii>0){
+ if(cnt_layers > 0){layers += ","; styles += ","; }
+ layers += wms[i].objLayer[ii].layer_name;
+ styles += "";
+ cnt_layers++;
+ }
+ if(this.wms[i].objLayer[ii].gui_layer_querylayer == 1 && ii>0){
+ if(cnt_querylayers > 0){querylayers += ",";}
+ querylayers += wms[i].objLayer[ii].layer_name;
+ cnt_querylayers++;
+ }
+ }
+ this.layers[i] = layers;
+ this.styles[i] = styles;
+ this.querylayers[i] = querylayers;
+ }
+ }
+ this.epsg = wms[0].gui_wms_epsg;
+ this.extent = setExtent(this.width,this.height,this.epsg);
+ this.mapURL = new Array();
+ for(var i=0; i<mb_MapObjectSubFunctions.length; i++){
+ eval(mb_MapObjectSubFunctions[i]);
+ }
+}
+function mb_mapObjaddWMS(obj){
+ var cnt_layers = 0;
+ var cnt_querylayers = 0;
+ var styles = "";
+ var layers = "";
+ var querylayers = "";
+ var ind = getMapObjIndexByName(obj);
+ //is the id valid?
+ for( var i=0; i<(wms.length-1); i++){
+ if(parseInt(wms[i].wms_id) >= parseInt(wms[wms.length-1].wms_id)){
+ wms[wms.length-1].wms_id = parseInt(mb_mapObj[ind].wms[i].wms_id) + 1;
+ }
+ }
+ mb_mapObj[ind].wms[mb_mapObj[ind].wms.length] = wms[wms.length-1];
+ mb_mapObj[ind].layers[mb_mapObj[ind].layers.length] = layers;
+ mb_mapObj[ind].styles[mb_mapObj[ind].styles.length] = styles;
+ mb_mapObj[ind].querylayers[mb_mapObj[ind].querylayers.length] = querylayers;
+}
+//CB
+function mb_mapObjaddWMSwithLayers(obj,layers,querylayers){
+ var cnt_layers = 0;
+ var cnt_querylayers = 0;
+ var styles = "";
+ var ind = getMapObjIndexByName(obj);
+ //is the id valid?
+ //for( var i=0; i<(wms.length-1); i++){
+ // if(parseInt(wms[i].wms_id) >= parseInt(wms[wms.length-1].wms_id)){
+ // wms[wms.length-1].wms_id = parseInt(mb_mapObj[ind].wms[i].wms_id) + 1;
+ // }
+ //}
+ mb_mapObj[ind].wms[mb_mapObj[ind].wms.length] = wms[wms.length-1];
+ mb_mapObj[ind].layers[mb_mapObj[ind].layers.length] = layers;
+ mb_mapObj[ind].styles[mb_mapObj[ind].styles.length] = styles;
+ mb_mapObj[ind].querylayers[mb_mapObj[ind].querylayers.length] = querylayers;
+}
+function mb_mapObjremoveWMS(objind,wmsind){
+ var wms_ID = null;
+
+ var new_wmsarray = new Array();
+ var new_layerarray = new Array();
+ var new_querylayerarray = new Array();
+ var new_stylesarray = new Array();
+ var new_mapURLarray = new Array();
+
+ for (var i=0;i<mb_mapObj[objind].wms.length; i++){
+ if(i != wmsind){
+ new_wmsarray[new_wmsarray.length] = mb_mapObj[objind].wms[i];
+ new_layerarray[new_layerarray.length] = mb_mapObj[objind].layers[i];
+ new_querylayerarray[new_querylayerarray.length] = mb_mapObj[objind].querylayers[i];
+ new_stylesarray[new_stylesarray.length] = mb_mapObj[objind].styles[i];
+ new_mapURLarray[new_mapURLarray.length] = mb_mapObj[objind].mapURL[i]
+ }
+ else {
+ wms_ID = mb_mapObj[objind].wms[i].wms_id;
+ }
+ }
+ mb_mapObj[objind].wms = new_wmsarray;
+ mb_mapObj[objind].layers = new_layerarray;
+ mb_mapObj[objind].querylayers = new_querylayerarray;
+ mb_mapObj[objind].styles = new_stylesarray;
+ mb_mapObj[objind].mapURL = new_mapURLarray;
+
+ var another_new_wmsarray = new Array();
+ for (var i=0;i<wms.length; i++){
+ if(wms[i].wms_id != wms_ID){
+ another_new_wmsarray[another_new_wmsarray.length] = wms[i];
+ }
+ }
+ wms = another_new_wmsarray;
+}
+function setExtent(width,height,epsg){
+ for(var i=0; i < wms[0].gui_epsg.length; i++){
+ if(wms[0].gui_epsg[i] == epsg){
+ var bbox_minx = parseFloat(wms[0].gui_minx[i]);
+ var bbox_miny = parseFloat(wms[0].gui_miny[i]);
+ var bbox_maxx = parseFloat(wms[0].gui_maxx[i]);
+ var bbox_maxy = parseFloat(wms[0].gui_maxy[i]);
+
+ var extenty = bbox_maxy - bbox_miny;
+ var extentx = bbox_maxx - bbox_minx;
+
+ var relation_px_x = width / height;
+ var relation_px_y = height / width;
+ var relation_bbox_x = extentx / extenty;
+ var centerx = bbox_minx + (extentx/2);
+ var centery = bbox_miny + (extenty/2);
+ if(relation_bbox_x <= relation_px_x){
+ bbox_minx = centerx - relation_px_x * extenty / 2;
+ bbox_maxx = centerx + relation_px_x * extenty / 2;
+ }
+
+ if(relation_bbox_x > relation_px_x){
+ bbox_miny = centery - relation_px_y * extentx / 2;
+ bbox_maxy = centery + relation_px_y * extentx / 2;
+ }
+ return bbox_minx +","+ bbox_miny +","+ bbox_maxx +","+ bbox_maxy;
+ }
+ }
+}
+function setMapRequest(frameName){
+
+ var ts = mb_timestamp();
+
+ for(var i=0; i<mb_MapRequestPreFunctions.length; i++){
+ var ret = eval(mb_MapRequestPreFunctions[i]);
+ if(ret == false){
+ return true;
+ }
+ }
+ //alert("A");
+ for(var i=0; i<mb_mapObj.length; i++){
+ var newMapRequest = "";
+ if(mb_mapObj[i].frameName == frameName){
+ for(var ii=0; ii<mb_mapObj[i].wms.length; ii++){
+ var proxy = false; //proxy
+ if(mb_mapObj[i].wms[ii].gui_wms_visible > 0){
+ var myDivId = "div_" + ii;
+ var myMapId = "map_" + ii;
+ //disable Layer which are out of scale
+ var str_LayerStyles = mb_checkScale(frameName,i,ii);
+ if(mb_mapObj[i].layers[ii] != "" && str_LayerStyles[0] != ''){
+ var newMapURL = "";
+ newMapRequest += "<div id='"+myDivId+"' style='position:absolute; top:0px; left:0px; z-index:'"+ii+"'>";
+ newMapRequest += "<img id='"+myMapId+"' name='mapimage' src='";
+ newMapURL += mb_mapObj[i].wms[ii].wms_getmap;
+
+ /* ows proxy */
+ if(newMapURL.indexOf(mb_security_proxy)>-1){
+ var a = newMapURL.indexOf(mb_security_proxy) + mb_security_proxy.length;
+ proxy = newMapURL.substr(0,a);
+ newMapURL = newMapURL.substr(a,newMapURL.length);
+ }
+ /* end ows proxy */
+
+ newMapURL += mb_getConjunctionCharacter(mb_mapObj[i].wms[ii].wms_getmap);
+
+ if(mb_mapObj[i].wms[ii].wms_version == "1.0.0"){newMapURL += "WMTVER="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=map&";}
+ if(mb_mapObj[i].wms[ii].wms_version != "1.0.0"){newMapURL += "VERSION="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=GetMap&SERVICE=WMS&";}
+
+ newMapURL += "LAYERS="+str_LayerStyles[0]+"&";
+ newMapURL += "STYLES="+str_LayerStyles[1]+"&";
+
+ newMapURL += "SRS="+mb_mapObj[i].epsg+"&";
+ newMapURL += "BBOX="+mb_mapObj[i].extent+"&";
+ newMapURL += "WIDTH="+mb_mapObj[i].width+"&";
+ newMapURL += "HEIGHT="+mb_mapObj[i].height+"&";
+ newMapURL += "FORMAT="+mb_mapObj[i].wms[ii].gui_wms_mapformat+"&";
+ newMapURL += "BGCOLOR=0xffffff&";
+ if(mb_mapObj[i].wms[ii].gui_wms_mapformat.search(/gif/i)>-1 || mb_mapObj[i].wms[ii].gui_wms_mapformat.search(/png/i)>-1){
+ newMapURL += "TRANSPARENT=TRUE&";
+ }
+ newMapURL += "EXCEPTIONS="+mb_mapObj[i].wms[ii].gui_wms_exceptionformat;
+ // add vendor-specifics
+ for(var v=0; v<mb_vendorSpecific.length; v++){
+ newMapURL += "&" + eval(mb_vendorSpecific[v]);
+ }
+ // add Filter
+ if(mb_mapObj[i].wms[ii].wms_filter != ""){
+ var tmp = mb_mapObj[i].wms[ii].wms_filter +"?id="+ mb_styleID;
+
+ var temp = "&SLD=" + tmp+ "&";
+ newMapURL += temp;
+ }
+ if(mb_log){
+ var tmp = eval(mb_log + "('" + newMapURL + "','" + ts + "')");
+ }
+ if(proxy){
+ newMapURL = proxy + escape(newMapURL) + "&" + <?php echo "'".SID."'" ?>;
+ }
+ newMapRequest += newMapURL;
+ mb_mapObj[i].mapURL[ii] = newMapURL;
+ mb_mapObj[i].wms[ii].mapURL = newMapURL;
+ newMapRequest += "' width='"+mb_mapObj[i].width+"' height='"+mb_mapObj[i].height+"' border='0'></div>";
+ }
+ else{
+ mb_mapObj[i].mapURL[ii] = false;
+ mb_mapObj[i].wms[ii].mapURL = false;
+ newMapRequest += "<div id='"+myDivId+"' style='position:absolute; top:0px; left:0px; z-index:'"+ii+"'>";
+ newMapRequest += "<img id='"+myMapId+"' name='mapimage' src='" + mb_trans.src;
+ newMapRequest += "' width='"+mb_mapObj[i].width+"' height='"+mb_mapObj[i].height+"' border='0'>";
+ newMapRequest +="</div>";
+ }
+ }
+
+ }
+
+ //prompt("",newMapRequest);
+ writeTag(mb_mapObj[i].frameName,mb_mapObj[i].elementName,newMapRequest);
+ }
+ }
+ for(var i=0; i<mb_MapRequestSubFunctions.length; i++){
+ eval(mb_MapRequestSubFunctions[i]);
+ }
+}
+function setSingleMapRequest(frameName,wms_id){
+
+ var ts = mb_timestamp();
+
+ for(var i=0; i<mb_MapRequestPreFunctions.length; i++){
+ eval(mb_MapRequestPreFunctions[i]);
+ }
+ for(var i=0; i<mb_mapObj.length; i++){
+ var newMapRequest = "";
+ if(mb_mapObj[i].frameName == frameName){
+ for(var ii=0; ii<mb_mapObj[i].wms.length; ii++){
+ var proxy = false; //proxy
+ var myDivId = "div_" + ii;
+ var myMapId = "map_" + ii;
+ if(mb_mapObj[i].wms[ii].wms_id == wms_id){
+ var newMapURL = "";
+ newMapRequest += "<img id='"+myMapId+"' name='mapimage' src='";
+ newMapURL += mb_mapObj[i].wms[ii].wms_getmap;
+ /* ows proxy */
+ if(newMapURL.indexOf(mb_security_proxy)>-1){
+ var a = newMapURL.indexOf(mb_security_proxy) + mb_security_proxy.length;
+ proxy = newMapURL.substr(0,a);
+ newMapURL = newMapURL.substr(a,newMapURL.length);
+ }
+ /* end ows proxy */
+
+ newMapURL += mb_getConjunctionCharacter(mb_mapObj[i].wms[ii].wms_getmap);
+
+ if(mb_mapObj[i].wms[ii].wms_version == "1.0.0"){newMapURL += "WMTVER="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=map&";}
+ if(mb_mapObj[i].wms[ii].wms_version != "1.0.0"){newMapURL += "VERSION="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=GetMap&SERVICE=WMS&";}
+
+ //disable Layer which are out of scale
+ var str_LayerStyles = mb_checkScale(frameName,i,ii);
+
+ newMapURL += "LAYERS="+str_LayerStyles[0]+"&";
+ newMapURL += "STYLES="+str_LayerStyles[1]+"&";
+
+ newMapURL += "SRS="+mb_mapObj[i].epsg+"&";
+ newMapURL += "BBOX="+mb_mapObj[i].extent+"&";
+ newMapURL += "WIDTH="+mb_mapObj[i].width+"&";
+ newMapURL += "HEIGHT="+mb_mapObj[i].height+"&";
+ newMapURL += "FORMAT="+mb_mapObj[i].wms[ii].gui_wms_mapformat+"&";
+ newMapURL += "BGCOLOR=0xffffff&";
+ if(mb_mapObj[i].wms[ii].gui_wms_mapformat.search(/gif/i)>-1 || mb_mapObj[i].wms[ii].gui_wms_mapformat.search(/png/i)>-1){
+ newMapURL += "TRANSPARENT=TRUE&";
+ }
+ newMapURL += "EXCEPTIONS="+mb_mapObj[i].wms[ii].gui_wms_exceptionformat;
+ // add vendor-specific
+ for(var v=0; v<mb_vendorSpecific.length; v++){
+ newMapURL += "&" + eval(mb_vendorSpecific[v]);
+ }
+ // add Filter
+ if(mb_mapObj[i].wms[ii].wms_filter != ""){
+ var tmp = mb_mapObj[i].wms[ii].wms_filter +"?id="+ mb_styleID;
+ //prompt("",tmp);;
+ var temp = "&SLD=" + tmp+ "&";
+ newMapURL += temp;
+ }
+ //prompt("",newMapURL);
+ if(mb_mapObj[i].layers[ii] != "" && str_LayerStyles[0] != ""){
+ if(proxy){
+ newMapURL = proxy + escape(newMapURL) + "&" + <?php echo "'".SID."'" ?>;
+ }
+ newMapRequest += newMapURL;
+ mb_mapObj[i].mapURL[ii] = newMapURL;
+ mb_mapObj[i].wms[ii].mapURL = newMapURL;
+ newMapRequest += "' width='"+mb_mapObj[i].width+"' height='"+mb_mapObj[i].height+"' border='0'>";
+ }
+ else{
+ mb_mapObj[i].mapURL[ii] = false;
+ mb_mapObj[i].wms[ii].mapURL = false;
+ newMapRequest = "<img id='"+myMapId+"' name='mapimage' src='" + mb_trans.src;
+ newMapRequest += "' width='"+mb_mapObj[i].width+"' height='"+mb_mapObj[i].height+"' border='0'>";
+ }
+ //prompt("",newMapRequest);
+ if(mb_log){
+ var tmp = eval(mb_log + "('" + newMapURL + "','" + ts + "')");
+ }
+ writeTag(mb_mapObj[i].frameName,myDivId,newMapRequest);
+ }
+ }
+ }
+ }
+ for(var i=0; i<mb_MapRequestSubFunctions.length; i++){
+ eval(mb_MapRequestSubFunctions[i]);
+ }
+}
+function mb_restateLayers(frameName,wms_id){
+ //alert(frameName + " / " + wms_id);
+ var ind = getMapObjIndexByName(frameName);
+ for(var i=0; i<mb_mapObj[ind].wms.length; i++){
+ if(mb_mapObj[ind].wms[i].wms_id == wms_id){
+ var cnt_layers = 0;
+ var cnt_querylayers = 0;
+ var layers = "";
+ var styles = "";
+ var querylayers = "";
+ for(var ii=0; ii<mb_mapObj[ind].wms[i].objLayer.length; ii++){
+ if(this.wms[i].objLayer[ii].gui_layer_visible == 1 && ii>0){
+ if(cnt_layers > 0){layers += ","; styles += ","; }
+ layers += wms[i].objLayer[ii].layer_name;
+ //alert(wms[i].objLayer[ii].layer_name);
+ styles += "";
+ cnt_layers++;
+ }
+ if(this.wms[i].objLayer[ii].gui_layer_querylayer == 1 && ii>0){
+ if(cnt_querylayers > 0){querylayers += ",";}
+ querylayers += wms[i].objLayer[ii].layer_name;
+ cnt_querylayers++;
+ }
+ mb_mapObj[ind].layers[i] = layers;
+ mb_mapObj[ind].querylayers[i] = querylayers;
+ mb_mapObj[ind].styles[i] = styles;
+ }
+ }
+ }
+}
+
+function mb_checkScale(frameName,mObj,wmsObj){
+ var thisLayer = mb_mapObj[mObj].layers[wmsObj].split(",");
+ var thisScale = mb_getScale(frameName);
+ var str_layer = "";
+ var str_styles = "";
+ var str_titles = "";
+ var str_legendurls = "";
+ var str_parent = "";
+ var cnt_layer = 0;
+ for(var i=0; i<mb_mapObj[mObj].wms[wmsObj].objLayer.length; i++){
+ var myLayername = mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_name;
+ var myMinscale = mb_mapObj[mObj].wms[wmsObj].objLayer[i].gui_layer_minscale;
+ var myMaxscale = mb_mapObj[mObj].wms[wmsObj].objLayer[i].gui_layer_maxscale;
+ for(var ii=0; ii<thisLayer.length; ii++){
+ var minscaleOK = false;
+ var maxscaleOK = false;
+ if(thisLayer[ii] == myLayername){
+ if(myMinscale == 0 || thisScale >= myMinscale){minscaleOK = true;}
+ if(myMaxscale == 0 || thisScale <= myMaxscale){maxscaleOK = true;}
+ if(maxscaleOK == true && minscaleOK == true ){
+ if(cnt_layer > 0){str_layer += ","; str_styles += ","; str_titles += ",";str_parent += ","; str_legendurls += ",";}
+ str_layer += thisLayer[ii];
+ str_styles += "";
+ str_titles += mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_title;
+ str_parent += mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_parent;
+ if(mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_style.length>0){
+ str_legendurls += mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_style[0]["legendurl"] ;
+ }
+ cnt_layer++;
+ }
+ }
+ }
+ }
+ var str_layerstyles = new Array();
+ str_layerstyles[0] = str_layer;
+ str_layerstyles[1] = str_styles;
+ str_layerstyles[2] = str_titles;
+ str_layerstyles[3] = str_legendurls;
+ str_layerstyles[4] = str_parent;
+ return str_layerstyles;
+}
+function setFeatureInfoRequest(fName,x,y, path) {
+ var ts = mb_timestamp();
+ for(var i=0; i<mb_FeatureInfoPreFunctions.length; i++){
+ eval(mb_FeatureInfoPreFunctions[i]);
+ }
+ var cnt_fi = 0;
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == fName){
+ for(var ii=0; ii<mb_mapObj[i].wms.length; ii++){
+ var newfeatureInfoRequest = "";
+ var requestParams = "";
+ var validation = false;
+ newfeatureInfoRequest += mb_mapObj[i].wms[ii].wms_getfeatureinfo;
+ newfeatureInfoRequest += mb_getConjunctionCharacter(mb_mapObj[i].wms[ii].wms_getfeatureinfo);
+
+ if(mb_mapObj[i].wms[ii].wms_version == "1.0.0"){requestParams += "WMTVER="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=feature_info&";}
+ if(mb_mapObj[i].wms[ii].wms_version != "1.0.0"){requestParams += "VERSION="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=GetFeatureInfo&SERVICE=WMS&";}
+ requestParams += "SRS="+mb_mapObj[i].epsg+"&";
+ requestParams += "BBOX="+mb_mapObj[i].extent+"&";
+ requestParams += "WIDTH="+mb_mapObj[i].width+"&";
+ requestParams += "HEIGHT="+mb_mapObj[i].height+"&";
+ requestParams += "LAYERS="+mb_mapObj[i].layers[ii]+"&";
+ requestParams += "STYLES="+mb_mapObj[i].styles[ii]+"&";
+ requestParams += "FORMAT="+mb_mapObj[i].wms[ii].gui_wms_mapformat+"&";
+ requestParams += "INFO_FORMAT="+mb_mapObj[i].wms[ii].gui_wms_featureinfoformat+"&";
+ requestParams += "EXCEPTIONS=application/vnd.ogc.se_xml&";
+ if(mb_feature_count > 0){
+ requestParams += "FEATURE_COUNT="+mb_feature_count+"&";
+ }
+ requestParams += "QUERY_LAYERS="+mb_mapObj[i].querylayers[ii]+"&";
+ requestParams += "X=" + x + "&";
+ requestParams += "Y=" + y;
+
+ if(mb_mapObj[i].querylayers[ii] != "" && mb_mapObj[i].layers[ii] != ""){
+ validation = true;
+ }
+ //add vendor-specific
+ for(var v=0; v<mb_vendorSpecific.length; v++){
+ requestParams += "&" + eval(mb_vendorSpecific[v]);
+ }
+ if(mb_log && validation){
+ var tmp = eval(mb_log + "('" + newfeatureInfoRequest + requestParams + "','" + ts + "')");
+ }
+ if(document.getElementById("FeatureInfoRedirect") && validation){
+ newfeatureInfoRequest += requestParams;
+ if(path){
+ window.frames["FeatureInfoRedirect"].document.getElementById(mb_mapObj[i].wms[ii].wms_id).src = path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr;
+ }
+ else{
+ window.frames["FeatureInfoRedirect"].document.getElementById(mb_mapObj[i].wms[ii].wms_id).src = newfeatureInfoRequest;
+ }
+ cnt_fi++;
+ }
+ else if(path && validation){
+ newfeatureInfoRequest += requestParams
+ window.open(path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
+ cnt_fi++;
+ }
+ else if(validation){
+ newfeatureInfoRequest += requestParams;
+ window.open(newfeatureInfoRequest, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
+ cnt_fi++;
+ }
+ }
+ }
+ }
+ if(cnt_fi == 0){alert("Please select a layer! \n Bitte wählen Sie eine Ebene zur Abfrage aus!");}
+}
+function writeTag(frameName, elName, tagSource) {
+ if(frameName && frameName != ""){
+ window.frames[frameName].document.getElementById(elName).innerHTML = tagSource;
+ }
+ else if(!frameName || frameName == ""){
+ document.getElementById(elName).innerHTML = tagSource;
+ }
+}
+function zoom(frameName,in_, factor,x,y) {
+ var x = parseFloat(x);
+ var y = parseFloat(y);
+ var ind = getMapObjIndexByName(frameName);
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ var xtentx = parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0]);
+ var xtenty = parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]);
+ var centerx = parseFloat(arrayBBox[0]) + xtentx/2;
+ var centery = parseFloat(arrayBBox[1]) + xtenty/2;
+ var factor = parseFloat(factor);
+ if(x){
+ centerx = x;
+ centery = y;
+ }
+ if (!in_) {factor = 1 / factor;}
+ var new_xtentx = xtentx / factor;
+ var new_xtenty = xtenty / factor;
+ var minx = centerx - new_xtentx / 2;
+ var miny = centery - new_xtenty / 2;
+ var maxx = centerx + new_xtentx / 2;
+ var maxy = centery + new_xtenty / 2;
+ mb_mapObj[ind].extent = minx + "," + miny + "," + maxx + "," + maxy;
+ setMapRequest(frameName);
+}
+function mb_panMap(frameName,dir){
+ var ind = getMapObjIndexByName(frameName);
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ var minx = parseFloat(arrayBBox[0]);
+ var miny = parseFloat(arrayBBox[1]);
+ var maxx = parseFloat(arrayBBox[2]);
+ var maxy = parseFloat(arrayBBox[3]);
+ var xtentx = parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0]);
+ var xtenty = parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]);
+
+ if(dir == "NW"){minx = minx - (xtentx/2); maxx = maxx - (xtentx/2); miny = miny + (xtenty/2); maxy = maxy + (xtenty/2);}
+ if(dir == "N"){miny = miny + (xtenty/2); maxy = maxy + (xtenty/2);}
+ if(dir == "NE"){minx = minx + (xtentx/2); maxx = maxx + (xtentx/2); miny = miny + (xtenty/2); maxy = maxy + (xtenty/2);}
+ if(dir == "W"){minx = minx - (xtentx/2); maxx = maxx - (xtentx/2);}
+ if(dir == "E"){minx = minx + (xtentx/2); maxx = maxx + (xtentx/2);}
+ if(dir == "SW"){minx = minx - (xtentx/2); maxx = maxx - (xtentx/2); miny = miny - (xtenty/2); maxy = maxy - (xtenty/2);}
+ if(dir == "S"){miny = miny - (xtenty/2); maxy = maxy - (xtenty/2);}
+ if(dir == "SE"){minx = minx + (xtentx/2); maxx = maxx + (xtentx/2); miny = miny - (xtenty/2); maxy = maxy - (xtenty/2);}
+ mb_mapObj[ind].extent = minx + "," + miny + "," + maxx + "," + maxy;
+ setMapRequest(frameName);
+}
+
+function handleSelectedLayer(frameName,wms_title,layerName,type,status){
+ //alert(frameName + " , " +wms_title + " , " +layerName + " , " +type + " , " +status);
+ //type = {visible || querylayer] status = {0 || 1}
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == frameName){
+ var cnt_layer = 0;
+ var str_layer = "";
+ var myMapObj = i;
+ for(var ii=0; ii<mb_mapObj[i].wms.length; ii++){
+ if(mb_mapObj[i].wms[ii].wms_title == wms_title){ //ii is true
+ var myWMS = ii;
+ if(type == "visible"){var arrayLayer = mb_mapObj[i].layers[ii].split(",");}
+ if(type == "querylayer"){var arrayLayer = mb_mapObj[i].querylayers[ii].split(",");}
+ for(var iii=1; iii<mb_mapObj[i].wms[ii].objLayer.length; iii++){
+ var layer_name = mb_mapObj[i].wms[ii].objLayer[iii].layer_name;
+ if(type == "querylayer"){
+ if(layer_name == layerName && status == 1 && mb_mapObj[i].wms[ii].objLayer[iii].layer_queryable == 1){
+ if(cnt_layer > 0){str_layer += ",";}
+ str_layer += layer_name;
+ cnt_layer++;
+ }
+ }
+ else if(type == "visible"){
+ if(layer_name == layerName && status == 1){
+ if(cnt_layer > 0){str_layer += ",";}
+ str_layer += layer_name;
+ cnt_layer++;
+ }
+ }
+ for(var iiii=0; iiii<arrayLayer.length; iiii++){
+ if(layer_name == arrayLayer[iiii] && layer_name != layerName){
+ if(cnt_layer > 0){str_layer += ",";}
+ str_layer += layer_name;
+ cnt_layer++;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if(type == "visible"){
+ mb_mapObj[myMapObj].layers[myWMS] = str_layer;
+ var array_str_layer = str_layer.split(",");
+ var str_styles = "";
+ for(var cnt=0; cnt<array_str_layer.length; cnt++){
+ if(cnt > 0){str_styles += ",";}
+ str_styles += "";
+ }
+ mb_mapObj[myMapObj].styles[myWMS] = str_styles;
+ }
+ if(type == "querylayer"){mb_mapObj[myMapObj].querylayers[myWMS] = str_layer;}
+ /*
+ if(type == 'visible'){
+ setSingleMapRequest(frameName,wms_title);
+ }
+ */
+}
+function handleSelectedLayer_array(mapObj, array_wms, array_layer, type, status){
+ //alert(mapObj+" / "+array_wms[0]+" / "+ array_layer[0]+" / "+ type+" / "+ status);
+ var ind = getMapObjIndexByName(mapObj);
+ for(var j=0; j<array_wms.length; j++){
+ for(var i=0; i<mb_mapObj[ind].wms.length; i++){
+ if(mb_mapObj[ind].wms[i].wms_id == array_wms[j]){
+ var check = false;
+ for(var ii=0; ii<mb_mapObj[ind].wms[i].objLayer.length; ii++){
+ if(wms[i].wms_id == array_wms[j] && wms[i].objLayer[ii].layer_name == array_layer[j]){
+ if(type == "visible"){
+ wms[i].objLayer[ii].gui_layer_visible = parseInt(status);
+ //alert(wms[i].objLayer[ii].layer_name);
+ check = true;
+ }
+ if(type == "querylayer" && (wms[i].objLayer[ii].gui_layer_queryable == "1" || wms[i].objLayer[ii].gui_layer_queryable == 1)){
+ wms[i].objLayer[ii].gui_layer_querylayer = parseInt(status);
+ }
+ }
+ }
+ mb_restateLayers(mapObj, array_wms[j]);
+ //alert('restate');
+ /*
+ * hier noch checken, welche wms sich geändert haben und disctinct eine singleRequest aufrufen:
+ */
+ if(check == true){
+
+ if(mb_mapObj[ind].wms[i].gui_wms_visible == 1){
+ setSingleMapRequest(mapObj,wms[i].wms_id);
+ //alert('sSMR');
+ }
+ }
+ }
+ }
+ }
+}
+function makeClickPos2RealWorldPos(frameName, myClickX, myClickY) {
+ var ind = getMapObjIndexByName(frameName);
+ var width = parseInt(mb_mapObj[ind].width);
+ var height = parseInt(mb_mapObj[ind].height);
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ var minX = parseFloat(arrayBBox[0]);
+ var minY = parseFloat(arrayBBox[1]);
+ var maxX = parseFloat(arrayBBox[2]);
+ var maxY = parseFloat(arrayBBox[3]);
+ var deltaX = (maxX - minX)/width;
+ var deltaY = (maxY - minY)/height;
+ if(deltaX > 0){
+ var roundx = 1/Math.pow(10,(Math.round(Math.log(deltaX)/Math.log(10))));
+ }
+ else{
+ var roundx = Math.pow(10,(Math.round(Math.log(deltaX)/Math.log(10))));
+ }
+ if(deltaY > 0){
+ var roundy = 1/Math.pow(10,(Math.round(Math.log(deltaY)/Math.log(10))));
+ }
+ else{
+ var roundy = Math.pow(10,(Math.round(Math.log(deltaY)/Math.log(10))));
+ }
+ var xtentx = maxX - minX;
+ var xtenty = maxY - minY;
+ var posX = parseFloat(minX + (myClickX / width) * xtentx);
+ var posY = parseFloat(maxY - (myClickY / height) * xtenty);
+ posX = Math.round(posX * roundx)/roundx;
+ posY = Math.round(posY * roundy)/roundy;
+ return new Array(posX, posY);
+}
+function makeRealWorld2mapPos(frameName,rw_posx, rw_posy){
+ var ind = getMapObjIndexByName(frameName);
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ var minX = parseFloat(arrayBBox[0]);
+ var minY = parseFloat(arrayBBox[1]);
+ var maxX = parseFloat(arrayBBox[2]);
+ var maxY = parseFloat(arrayBBox[3]);
+ var xtentx = parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0]);
+ var xtenty = parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]);
+ var width = mb_mapObj[ind].width;
+ var height = mb_mapObj[ind].height;
+ pixPos_x = Math.round(parseFloat(((rw_posx - minX)/xtentx)*width));
+ pixPos_y = Math.round(parseFloat(((maxY - rw_posy)/xtenty)*height));
+ return new Array(pixPos_x, pixPos_y);
+}
+
+function mb_arrangeElement(frameName, elName, left, top) {
+ if(frameName != ""){
+ window.frames[frameName].document.getElementById(elName).style.top = top;
+ window.frames[frameName].document.getElementById(elName).style.left = left;
+ }
+ else{
+ document.getElementById(elName).style.top = top;
+ document.getElementById(elName).style.left = left;
+ }
+}
+/****************BUTTON HANDLING*************************/
+var mb_button = new Array();
+
+function mb_regButton_frame(wii, obj, frameName){
+ var ind = mb_button.length;
+ mb_button[ind] = new mb_conButton(wii, ind);
+ eval("window.frames['" + frameName + "']."+wii+"(obj,"+ind+")");
+ mb_button[ind].prev = mb_button[ind].src;
+ mb_button[ind].src = mb_button[ind].img_over;
+ mb_button[ind].onmouseover = new Function("mb_button_over("+ind+")");
+ mb_button[ind].onmouseout = new Function("mb_button_out("+ind+")");
+ mb_button[ind].onclick = new Function("mb_button_click("+ind+")");
+ mb_button[ind].frameName = frameName;
+}
+
+function mb_regButton(wii){
+ var ind = mb_button.length;
+ mb_button[ind] = new mb_conButton(wii, ind);
+ eval(wii+"("+ind+")");
+ mb_button[ind].prev = mb_button[ind].src;
+ mb_button[ind].src = mb_button[ind].img_over;
+ mb_button[ind].onmouseover = new Function("mb_button_over("+ind+")");
+ mb_button[ind].onmouseout = new Function("mb_button_out("+ind+")");
+ mb_button[ind].onclick = new Function("mb_button_click("+ind+")");
+ mb_button[ind].frameName = "";
+
+}
+function mb_conButton(wii, ind){
+ this.wii = wii;
+ return true;
+}
+function mb_button_over(ind){
+ if(mb_button[ind].status == 0){
+ mb_button[ind].prev = mb_button[ind].src;
+ mb_button[ind].src = mb_button[ind].img_over;
+ }
+}
+function mb_button_out(ind){
+ mb_button[ind].src = mb_button[ind].prev;
+}
+function mb_button_click(ind){
+ var mbStatus = mb_button[ind].status;
+ if(mbStatus == 0){
+ mb_disableButton(mb_button[ind].elName);
+ mb_button[ind].prev = mb_button[ind].img_on;
+ mb_button[ind].src = mb_button[ind].img_on;
+ mb_button[ind].status = 1;
+ if (mb_button[ind].frameName != "") {
+ window.frames[mb_button[ind].frameName].document.getElementById(mb_button[ind].elName).go();
+ }
+ else {
+ document.getElementById(mb_button[ind].elName).go();
+ }
+ }
+ else{
+ mb_button[ind].prev = mb_button[ind].img_off;
+ mb_button[ind].src = mb_button[ind].img_off;
+ mb_button[ind].status = 0;
+ if (mb_button[ind].frameName != "") {
+ window.frames[mb_button[ind].frameName].document.getElementById(mb_button[ind].elName).stop();
+ }
+ else {
+ document.getElementById(mb_button[ind].elName).stop();
+ }
+ }
+}
+function mb_disableButton(elName){
+ for(var i=0; i<mb_button.length; i++){
+ if(mb_button[i].elName != elName && mb_button[i].status == 1){
+ mb_button[i].status = 0;
+ if (mb_button[i].frameName != "") {
+ window.frames[mb_button[i].frameName].document.getElementById(mb_button[i].elName).src = mb_button[i].img_off;
+ window.frames[mb_button[i].frameName].document.getElementById(mb_button[i].elName).stop();
+ }
+ else {
+ document.getElementById(mb_button[i].elName).src = mb_button[i].img_off;
+ document.getElementById(mb_button[i].elName).stop();
+ }
+ return true;
+
+ }
+ }
+}
+function mb_disableThisButton(elName){
+ for(var i=0; i<mb_button.length; i++){
+ if(mb_button[i].elName == elName && mb_button[i].status == 1){
+ mb_button[i].status = 0;
+ if (mb_button[i].frameName != "") {
+ window.frames[mb_button[i].frameName].document.getElementById(mb_button[i].elName).src = mb_button[i].img_off;
+ window.frames[mb_button[i].frameName].document.getElementById(mb_button[i].elName).stop();
+ }
+ else {
+ document.getElementById(mb_button[i].elName).src = mb_button[i].img_off;
+ document.getElementById(mb_button[i].elName).stop();
+ }
+ return true;
+
+ }
+ }
+}
+/***********************Drag & Drop***********************/
+function mb_getMousePos(e,fName){
+if(fName){
+ if(ie){
+ clickX = window.frames[fName].event.clientX;
+ clickY = window.frames[fName].event.clientY;
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ }
+ else{
+ if(ie){
+ clickX = event.clientX;
+ clickY = event.clientY;
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ }
+ var pos = new Array(clickX,clickY);
+ return pos;
+}
+// function for object-identification
+function getMapObjIndexByName(frameName){
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == frameName){
+ return i;
+ }
+ }
+}
+function mb_getLayerTitleByName(map_index, wms_index, myLayer_name){
+ for(var i=0; i<mb_mapObj[map_index].wms[wms_index].objLayer.length; i++){
+ if(mb_mapObj[map_index].wms[wms_index].objLayer[i].layer_name == myLayer_name){
+ return mb_mapObj[map_index].wms[wms_index].objLayer[i].layer_title;
+ }
+ }
+}
+function getWMSIDByTitle(frameName,wms_title){
+ var ind = getMapObjIndexByName(frameName);
+ for(var i=0; i< mb_mapObj[ind].wms.length; i++){
+ if(mb_mapObj[ind].wms[i].wms_title == wms_title){
+ //return i;
+ return mb_mapObj[ind].wms[i].wms_id;
+ }
+ }
+}
+function getWMSIndexByTitle(frameName,wms_title){
+ var ind = getMapObjIndexByName(frameName);
+ for(var i=0; i< mb_mapObj[ind].wms.length; i++){
+ if(mb_mapObj[ind].wms[i].wms_title == wms_title){
+ return i;
+ }
+ }
+}
+function getWMSIndexById(frameName,wms_id){
+ var ind = getMapObjIndexByName(frameName);
+ for(var i=0; i< mb_mapObj[ind].wms.length; i++){
+ if(mb_mapObj[ind].wms[i].wms_id == wms_id){
+ return i;
+ }
+ }
+}
+//scale
+function mb_getScale(frameName) {
+ for(var i=0; i<mb_GetScalePreFunctions.length; i++){
+ var myScale = eval(mb_GetScalePreFunctions[i]);
+ }
+ if(myScale){
+ var Y_str = myScale;
+ }
+ else{
+ var ind = getMapObjIndexByName(frameName);
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ var xtenty = parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]);
+ var scaleY = (xtenty / mb_mapObj[ind].height) *(mb_resolution * 100);
+ var Y_str = Math.round(scaleY);
+ }
+ return Y_str;
+}
+
+function mb_repaintScale(frameName, x, y, scale){
+ var ind = getMapObjIndexByName(frameName);
+ if(x == null && y == null){
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ x = parseFloat(arrayBBox[0]) + ((parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0]))/2);
+ y = parseFloat(arrayBBox[1]) + ((parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]))/2);
+ }
+ var minx = parseFloat(x) - (mb_mapObj[ind].width / (mb_resolution * 100 *2) * scale);
+ var miny = parseFloat(y) - (mb_mapObj[ind].height / (mb_resolution * 100 *2) * scale);
+ var maxx = parseFloat(x) + (mb_mapObj[ind].width / (mb_resolution * 100 *2) * scale);
+ var maxy = parseFloat(y) + (mb_mapObj[ind].height / (mb_resolution * 100 *2) * scale);
+ mb_repaint(frameName,minx, miny, maxx, maxy);
+}
+function mb_repaint(frameName,minx,miny,maxx,maxy){
+ var ind = getMapObjIndexByName(frameName);
+ mb_mapObj[ind].extent = minx + "," + miny + "," + maxx + "," + maxy;
+ setMapRequest(frameName);
+}
+function mb_calculateExtent(frameName,minx,miny,maxx,maxy){
+ var ind = getMapObjIndexByName(frameName);
+
+ var extenty = maxy - miny;
+ var extentx = maxx - minx;
+
+ var relation_px_x = mb_mapObj[ind].width / mb_mapObj[ind].height;
+ var relation_px_y = mb_mapObj[ind].height / mb_mapObj[ind].width;
+ var relation_bbox_x = extentx / extenty;
+ var centerx = minx + (extentx/2);
+ var centery = miny + (extenty/2);
+ if(relation_bbox_x <= relation_px_x){
+ minx = centerx - relation_px_x * extenty / 2;
+ maxx = centerx + relation_px_x * extenty / 2;
+ }
+ if(relation_bbox_x > relation_px_x){
+ miny = centery - relation_px_y * extentx / 2;
+ maxy = centery + relation_px_y * extentx / 2;
+ }
+ mb_mapObj[ind].extent = minx +","+ miny +","+ maxx +","+ maxy;
+}
+function mb_showHighlight(frameName,x,y){
+ var pos = makeRealWorld2mapPos(frameName,x, y);
+ mb_arrangeElement(frameName,"highlight",pos[0]-7, pos[1]-7);
+ window.frames[frameName].document.getElementById("highlight").style.visibility = 'visible';
+}
+function mb_hideHighlight(frameName){
+ mb_arrangeElement(frameName,"highlight",-20, -20);
+ mb_arrangeElement(frameName,"highlight",-20, -20);
+ window.frames[frameName].document.getElementById("highlight").style.visibility = 'hidden';
+}
+function mb_permanentHighlight(frameName,x,y){
+ var pos = makeRealWorld2mapPos(frameName,x, y);
+ mb_arrangeElement(frameName,"permanent",pos[0]-7, pos[1]-7);
+ window.frames[frameName].document.getElementById("permanent").style.visibility = 'visible';
+}
+// framename, commaseparated coordinates, commaseparated rgb values (color)
+//new: coords is array!
+function mb_markResult(frameName,geom,col){
+ var x = "";
+ var y = "";
+ var tmp = new Array();
+ var ind = getMapObjIndexByName(frameName);
+ for(var i=0; i<geom.length; i++){
+ if(i>0){
+ x += ":";
+ y += ":";
+ }
+ tmp = geom[i].split(",");
+ for(var ii=0; ii<tmp.length; ii+=2){
+ var pos = makeRealWorld2mapPos(frameName,tmp[ii], tmp[ii+1]);
+ if(ii>0){
+ x += ",";
+ y += ",";
+ }
+ x += pos[0];
+ y += pos[1];
+ }
+ }
+ var source = "<img src='../extensions/markResult.php?x=" + x + "&y=" + y + "&width=" + mb_mapObj[ind].width + "&height=" + mb_mapObj[ind].height + "&color="+col+"'>";
+ //prompt("",source);
+ writeTag(frameName,"markResult",source);
+}
+function mb_disableResult(frameName){
+ writeTag(frameName,"markResult","");
+}
+function Numsort(a,b){
+ return a-b;
+}
+/*
+* Object (Array)
+* this.id
+* this.type
+* this.x = new Array();
+* this.y = new Array();
+* this.label
+* this.epsg
+*/
+function mb_registerGML(frameName,obj){
+ var ind = getMapObjIndexByName(frameName);
+ mb_mapObj[ind].geom = obj;
+}
+function mb_obj2gml(frameName){
+ var ind = getMapObjIndexByName(frameName);
+ var geom = mb_mapObj[ind].geom;
+
+ var layerName = "MyLayer";
+
+ var str = "<?xml version="1.0" encoding="ISO-8859-1"?><wfs:FeatureCollection ";
+ str += "xmlns='http://www.ttt.org/myns' ";
+ str += "xmlns:myns='http://www.opengis.net/' ";
+ str += "xmlns:wfs='http://www.opengis.net/wfs/' ";
+ str += "xmlns:gml='http://www.opengis.net/gml/' ";
+ str += "xmlns:ogc='http://www.opengis.net/ogc/' ";
+ str += "xmlns:xsi='http://www.w3.org/' ";
+ str += "xsi:schemaLocation='http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd http://www.ttt.org/myns http://localhost/cgi-bin/mapserv44?'>";
+ str += "<gml:boundedBy>";
+ str += "<gml:Box srsName='"+geom[0].epsg.substr(0,4).toLowerCase()+geom[0].epsg.substr(4,geom[0].epsg.length)+"'>";
+ str += "<gml:coordinates>";
+ str += "-1.000000,-1.000000 -1.000000,-1.000000";
+ str += "</gml:coordinates>";
+ str += "</gml:Box>";
+ str += "</gml:boundedBy>";
+
+ var myType = "";
+ for(var i=0; i<geom.length;i++){
+ if(geom[i].type == "text"){ myType = "point";}
+ if(geom[i].type == "line"){ myType = "lineString";}
+ if(geom[i].type == "polygon"){ myType = "polygon";}
+ var sortx = geom[i].x;
+ var sorty = geom[i].y;
+ //sortx.sort(Numsort);
+ //sorty.sort(Numsort);
+ str += "<gml:featureMember>";
+ str += "<"+layerName+">";
+ str += "<gml:boundedBy>";
+ str += "<gml:Box srsName=""+geom[i].epsg.substr(0,4).toLowerCase()+geom[i].epsg.substr(4,geom[i].epsg.length)+"">";
+ str += "<gml:coordinates>";
+ str += sortx[0]+"," + sorty[0] + " " + sortx[sortx.length-1] + "," + sorty[sorty.length-1];
+ str += "</gml:coordinates>";
+ str += "</gml:Box>";
+ str += "</gml:boundedBy>";
+ str += "<gml:"+myType+"Property>";
+ str += "<gml:"+myType.charAt(0).toUpperCase()+myType.substr(1,myType.length);
+ str += " srsName=""+geom[i].epsg.substr(0,4).toLowerCase()+geom[i].epsg.substr(4,geom[i].epsg.length)+"">";
+ if(geom[i].type == "polygon"){ str += "<gml:outerBoundaryIs><gml:LinearRing>";}
+ str += "<gml:coordinates>";
+ for(var j=0; j<geom[i].x.length; j++){
+ str += geom[i].x[j] + "," + geom[i].y[j] + " ";
+ //alert(geom[i].x[j] + "," + geom[i].y[j]);
+ }
+ str += "</gml:coordinates>";
+ if(geom[i].type == "polygon"){ str += "</gml:LinearRing></gml:outerBoundaryIs>";}
+ str += "</gml:"+myType.charAt(0).toUpperCase()+myType.substr(1,myType.length)+">";
+ str += "</gml:"+myType+"Property>";
+ str += "<id>"+i+"</id>";
+ if(geom[i].label != false){
+ str += "<label>"+geom[i].label+"</label>";
+ }
+ str += "</"+layerName+">";
+ str += "</gml:featureMember>";
+ }
+ str += "</wfs:FeatureCollection>";
+ return str;
+ /*
+ document.sendData.target = "_blank";
+ document.sendData.action = "../classes/class_gml2obj.php";
+ document.sendData.data.value = str;
+ document.sendData.submit();
+ */
+}
+function mb_timestamp(){
+ var d = new Date();
+ var ts = Math.round(Date.parse(d)/1000);
+ return ts;
+}
+function mb_getlayerposbyname(objInd,wmsInd,lname){
+ var t = mb_mapObj[objInd].wms[wmsInd];
+ for(var i=0; i < t.objLayer.length; i++){
+ if(t.objLayer[i].layer_name == lname){
+ return t.objLayer[i].layer_pos;
+ }
+ }
+}
+function mb_getLayerObjByName(fname,wms_id,layer_name){
+ var ind = getMapObjIndexByName(fname);
+ var wmsInd = getWMSIndexById(fname,wms_id);
+ var t = mb_mapObj[ind].wms[wmsInd];
+ for(var i=0; i < t.objLayer.length; i++){
+ if(t.objLayer[i].layer_name == layer_name){
+ return t.objLayer[i];
+ }
+ }
+}
+
+
+function mb_getchildsbyname(objInd,wmsInd,lname){
+ var t = mb_mapObj[objInd].wms[wmsInd];
+ var pos = mb_getlayerposbyname(objInd, wmsInd,lname);
+ var l = new Array();
+ l["name"] = new Array();
+ l["title"] = new Array();
+ l["legendurl"] = new Array();
+ for(var i=0; i < t.objLayer.length; i++){
+ if(t.objLayer[i].layer_parent == pos){
+ l["name"][l["name"].length] = t.objLayer[i].layer_name;
+ l["title"][l["title"].length] = t.objLayer[i].layer_title;
+ if(t.objLayer[i].layer_style.length>0){
+ l["legendurl"][l["legendurl"].length] = t.objLayer[i].layer_style[0]["legendurl"] ;
+ }else{
+ l["legendurl"][l["legendurl"].length] = 0 ;
+ }
+ }
+ }
+ if(l["name"].length > 0){
+ return l;
+ }
+ else{
+ return false;
+ }
+}
+
+
+/************************************************************************************
+ checks if a tag <tagname> with id <id> exists in frame <framename>.
+ if yes, the node is returned
+ if no, the node is created with attributes <attributes> and returned
+ if a node with id <id> exists but the tagname is not <tagname>, false is returned.
+************************************************************************************/
+
+function mb_checkTag(frameName, tagName, elementId, appendAtTagName, attributes){
+
+ var oldElement;
+ var newElement;
+
+ // for both frames and no frames...
+ if(frameName && frameName != ""){
+ oldElement = window.frames[frameName].document.getElementById(elementId);
+ }
+ else if(!frameName || frameName == ""){
+ oldElement = document.getElementById(elementId);
+ }
+
+ // ... check if an element with elementId exists.
+ if (oldElement == null) {
+ // if no element with elementId exists, a new one is created and appended to appendAtTagName
+
+ newElement = window.frames[frameName].document.createElement(tagName);
+ if(frameName && frameName != ""){
+ newElement = window.frames[frameName].document.getElementsByTagName(appendAtTagName)[0].appendChild(newElement);
+ }
+ else if(!frameName || frameName == ""){
+ newElement = window.frames[frameName].document.getElementsByTagName(appendAtTagName)[0].appendChild(newElement);
+ }
+ }
+ else {
+ // if element id is already taken, check if tag name are identical
+ // if yes, the desired element already exists, and is returned
+ // if not, another element with the desired id exists, false is returned
+
+ if (oldElement.nodeName.toLowerCase() == tagName.toLowerCase()) {
+ for (var i=0; i<attributes.length; i++) {
+ oldElement.setAttribute(attributes[i][0], attributes[i][1]);
+ }
+ return oldElement;
+ }
+ else {
+ return false;
+ }
+ }
+
+ //
+ // set element id
+ //
+ var newElementAttributeNode = document.createAttribute("id");
+ newElementAttributeNode.value = elementId;
+ newElement.setAttributeNode(newElementAttributeNode);
+ for (var i=0; i<attributes.length; i++) {
+ newElement.setAttribute(attributes[i][0], attributes[i][1]);
+ }
+ return newElement;
+}
+function mb_execloadWmsSubFunctions(){
+ for(var i=0; i<mb_loadWmsSubFunctions.length; i++){
+ eval(mb_loadWmsSubFunctions[i]);
+ }
+}
+
+function mb_getConjunctionCharacter(onlineresource){
+ if(onlineresource.indexOf("?") > -1){
+ if(onlineresource.charAt(onlineresource.length-1) == "?"){
+ nextvalue = "";
+ }else if(onlineresource.charAt(onlineresource.length-1) == "&"){
+ nextvalue = "";
+ }else{
+ nextvalue = "&";
+ }
+ }
+ if(onlineresource.indexOf("?") == -1){
+ nextvalue = "?";
+ }
+ return nextvalue;
+}
+<?php
+include("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$mb_sql = "SELECT e_js_file FROM gui_element WHERE e_public = 1 AND fkey_gui_id = '".$_REQUEST["gui_id"]."' ORDER BY e_pos";
+$mb_res = db_query($mb_sql);
+//$mb_cnt = 0;
+while($row_js = db_fetch_array($mb_res)){
+ if($row_js["e_js_file"] != ""){
+ include($row_js["e_js_file"]);
+ }
+}
+?>
Added: trunk/mapbender/http/javascripts/map_obj.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/map_obj.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/map_obj.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,188 @@
+//$Id: map_obj.js,v 1.8 2005/12/12 11:27:10 c_baudson Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/map_obj.js,v 1.8 2005/12/12 11:27:10 c_baudson Exp $
+//global variables
+var wms = new Array();
+var wms_layer_count = 0;
+//list of all wms-objects
+function add_wms(
+ wms_id,
+ wms_version,
+ wms_title,
+ wms_abstract,
+ wms_getmap,
+ wms_getfeatureinfo,
+ wms_getlegendurl,
+ wms_filter,
+ gui_wms_mapformat,
+ gui_wms_featureinfoformat,
+ gui_wms_exceptionformat,
+ gui_wms_epsg,
+ gui_wms_visible){
+ wms[wms.length] = new wms_const(
+ wms_id,
+ wms_version,
+ wms_title,
+ wms_abstract,
+ wms_getmap,
+ wms_getfeatureinfo,
+ wms_getlegendurl,
+ wms_filter,
+ gui_wms_mapformat,
+ gui_wms_featureinfoformat,
+ gui_wms_exceptionformat,
+ gui_wms_epsg,
+ gui_wms_visible);
+ wms_layer[wms.length - 1] = new Array();
+}
+//the wms constructor
+function wms_const(
+ wms_id,
+ wms_version,
+ wms_title,
+ wms_abstract,
+ wms_getmap,
+ wms_getfeatureinfo,
+ wms_getlegendurl,
+ wms_filter,
+ gui_wms_mapformat,
+ gui_wms_featureinfoformat,
+ gui_wms_exceptionformat,
+ gui_wms_epsg,
+ gui_wms_visible){
+
+ this.wms_id = wms_id;
+ this.wms_version = wms_version;
+ this.wms_title = wms_title;
+ this.wms_abstract = wms_abstract;
+ this.wms_getmap = wms_getmap;
+ this.wms_getfeatureinfo = wms_getfeatureinfo;
+ this.wms_getlegendurl = wms_getlegendurl;
+ this.wms_filter = wms_filter;
+ this.data_type = new Array();
+ this.data_format = new Array();
+ this.objLayer = new Array();
+ this.gui_wms_mapformat = gui_wms_mapformat;
+ this.gui_wms_featureinfoformat = gui_wms_featureinfoformat;
+ this.gui_wms_exceptionformat = gui_wms_exceptionformat;
+ this.gui_wms_epsg = gui_wms_epsg;
+ this.gui_wms_visible = gui_wms_visible;
+ this.gui_epsg = new Array();
+ this.gui_minx = new Array();
+ this.gui_miny = new Array();
+ this.gui_maxx = new Array();
+ this.gui_maxy = new Array();
+}
+function wms_add_data_type_format(datatype,dataformat){
+ var insertDataFormat = true;
+ for (var i = 0 ; i < wms[wms.length-1].data_type.length ; i ++) {
+ if (wms[wms.length-1].data_type[i] == datatype && wms[wms.length-1].data_format[i] == dataformat) {
+ insertDataFormat = false;
+ }
+ }
+ if (insertDataFormat == true) {
+ wms[wms.length-1].data_type[wms[wms.length-1].data_type.length] = datatype;
+ wms[wms.length-1].data_format[wms[wms.length-1].data_format.length] = dataformat;
+ }
+}
+function wms_addSRS(epsg,minx,miny,maxx,maxy){
+ wms[wms.length-1].gui_epsg[wms[wms.length-1].gui_epsg.length] = epsg;
+ wms[wms.length-1].gui_minx[wms[wms.length-1].gui_minx.length] = minx;
+ wms[wms.length-1].gui_miny[wms[wms.length-1].gui_miny.length] = miny;
+ wms[wms.length-1].gui_maxx[wms[wms.length-1].gui_maxx.length] = maxx;
+ wms[wms.length-1].gui_maxy[wms[wms.length-1].gui_maxy.length] = maxy;
+}
+function wms_addLayerStyle(styleName, styleTitle, count, layerCount, styleLegendUrl, styleLegendUrlFormat){
+ if (wms[wms.length-1].objLayer[layerCount]) {
+ wms[wms.length-1].objLayer[layerCount].layer_style[count] = new Array();
+ wms[wms.length-1].objLayer[layerCount].layer_style[count]["name"] = styleName;
+ wms[wms.length-1].objLayer[layerCount].layer_style[count]["title"] = styleTitle;
+ wms[wms.length-1].objLayer[layerCount].layer_style[count]["legendurl"] = styleLegendUrl;
+ wms[wms.length-1].objLayer[layerCount].layer_style[count]["legendurlformat"] = styleLegendUrlFormat;
+ }
+}
+
+
+//layer
+function wms_add_layer(
+ layer_parent,
+ layer_name,
+ layer_title,
+ layer_dataurl_href,
+ layer_pos,
+ layer_queryable,
+ layer_minscale,
+ layer_maxscale,
+ layer_metadataurl,
+ gui_layer_wms_id,
+ gui_layer_status,
+ gui_layer_selectable,
+ gui_layer_visible,
+ gui_layer_queryable,
+ gui_layer_querylayer,
+ gui_layer_minscale,
+ gui_layer_maxscale,
+ gui_layer_wfs_featuretype){
+
+ wms[wms.length-1].objLayer[wms[wms.length-1].objLayer.length] = new wms_layer(
+ layer_parent,
+ layer_name,
+ layer_title,
+ layer_dataurl_href,
+ layer_pos,
+ layer_queryable,
+ layer_minscale,
+ layer_maxscale,
+ layer_metadataurl,
+ gui_layer_wms_id,
+ gui_layer_status,
+ gui_layer_selectable,
+ gui_layer_visible,
+ gui_layer_queryable,
+ gui_layer_querylayer,
+ gui_layer_minscale,
+ gui_layer_maxscale,
+ gui_layer_wfs_featuretype );
+//alert(layer_parent + " , " +layer_name + " , " +layer_title + " , " +layer_dataurl_href + " , " +layer_pos + " , " +layer_queryable + " , " +layer_minscale + " , " +layer_maxscale + " , " +gui_layer_wms_id + " , " +gui_layer_status+" , "+gui_layer_selectable + " , " +gui_layer_visible + " , " +gui_layer_queryable + " , " +gui_layer_querylayer );
+}
+function wms_layer(
+ layer_parent,
+ layer_name,
+ layer_title,
+ layer_dataurl_href,
+ layer_pos,
+ layer_queryable,
+ layer_minscale,
+ layer_maxscale,
+ layer_metadataurl,
+ gui_layer_wms_id,
+ gui_layer_status,
+ gui_layer_selectable,
+ gui_layer_visible,
+ gui_layer_queryable,
+ gui_layer_querylayer,
+ gui_layer_minscale,
+ gui_layer_maxscale,
+ gui_layer_wfs_featuretype){
+ this.layer_id = wms_layer_count;
+ this.layer_parent = layer_parent;
+ this.layer_name = layer_name;
+ this.layer_title = layer_title;
+ this.layer_dataurl_href = layer_dataurl_href;
+ this.layer_pos = layer_pos;
+ this.layer_queryable = layer_queryable;
+ this.layer_minscale = layer_minscale;
+ this.layer_maxscale = layer_maxscale;
+ this.layer_metadataurl = layer_metadataurl;
+ this.layer_epsg = new Array();
+ this.gui_layer_wms_id = gui_layer_wms_id;
+ this.gui_layer_status = gui_layer_status;
+ this.gui_layer_selectable = gui_layer_selectable;
+ this.gui_layer_visible = gui_layer_visible;
+ this.gui_layer_queryable = gui_layer_queryable;
+ this.gui_layer_querylayer = gui_layer_querylayer;
+ this.gui_layer_minscale = gui_layer_minscale;
+ this.gui_layer_maxscale = gui_layer_maxscale;
+ this.gui_layer_wfs_featuretype = gui_layer_wfs_featuretype;
+ this.layer_style = new Array();
+ wms_layer_count++;
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/map_obj.js_bak
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/map_obj.js_bak?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/map_obj.js_bak 2006-04-13 20:20:00+0000
@@ -0,0 +1,156 @@
+//$Id: map_obj.js_bak,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/map_obj.js_bak,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+//global variables
+var wms = new Array();
+var wms_layer_count = 0;
+//list of all wms-objects
+function add_wms(
+ wms_id,
+ wms_version,
+ wms_title,
+ wms_abstract,
+ wms_getmap,
+ wms_getfeatureinfo,
+ gui_wms_mapformat,
+ gui_wms_featureinfoformat,
+ gui_wms_exceptionformat,
+ gui_wms_epsg,
+ gui_wms_visible){
+ wms[wms.length] = new wms_const(
+ wms_id,
+ wms_version,
+ wms_title,
+ wms_abstract,
+ wms_getmap,
+ wms_getfeatureinfo,
+ gui_wms_mapformat,
+ gui_wms_featureinfoformat,
+ gui_wms_exceptionformat,
+ gui_wms_epsg,
+ gui_wms_visible);
+ wms_layer[wms.length - 1] = new Array();
+}
+//the wms constructor
+function wms_const(
+ wms_id,
+ wms_version,
+ wms_title,
+ wms_abstract,
+ wms_getmap,
+ wms_getfeatureinfo,
+ gui_wms_mapformat,
+ gui_wms_featureinfoformat,
+ gui_wms_exceptionformat,
+ gui_wms_epsg,
+ gui_wms_visible){
+
+ this.wms_id = wms_id;
+ this.wms_version = wms_version;
+ this.wms_title = wms_title;
+ this.wms_abstract = wms_abstract;
+ this.wms_getmap = wms_getmap;
+ this.wms_getfeatureinfo = wms_getfeatureinfo;
+ this.data_type = new Array();
+ this.data_format = new Array();
+ this.objLayer = new Array();
+ this.gui_wms_mapformat = gui_wms_mapformat;
+ this.gui_wms_featureinfoformat = gui_wms_featureinfoformat;
+ this.gui_wms_exceptionformat = gui_wms_exceptionformat;
+ this.gui_wms_epsg = gui_wms_epsg;
+ this.gui_wms_visible = gui_wms_visible;
+ this.gui_epsg = new Array();
+ this.gui_minx = new Array();
+ this.gui_miny = new Array();
+ this.gui_maxx = new Array();
+ this.gui_maxy = new Array();
+}
+function wms_add_data_type_format(datatype,dataformat){
+ wms[wms.length-1].data_type[wms[wms.length-1].data_type.length] = datatype;
+ wms[wms.length-1].data_format[wms[wms.length-1].data_format.length] = dataformat;
+}
+function wms_addSRS(epsg,minx,miny,maxx,maxy){
+ wms[wms.length-1].gui_epsg[wms[wms.length-1].gui_epsg.length] = epsg;
+ wms[wms.length-1].gui_minx[wms[wms.length-1].gui_minx.length] = minx;
+ wms[wms.length-1].gui_miny[wms[wms.length-1].gui_miny.length] = miny;
+ wms[wms.length-1].gui_maxx[wms[wms.length-1].gui_maxx.length] = maxx;
+ wms[wms.length-1].gui_maxy[wms[wms.length-1].gui_maxy.length] = maxy;
+}
+function wms_addLayerStyle(styleName, styleTitle, count, layerCount){
+ wms[wms.length-1].objLayer[layerCount].layer_style[count] = new Array();
+ wms[wms.length-1].objLayer[layerCount].layer_style[count]["name"] = styleName;
+ wms[wms.length-1].objLayer[layerCount].layer_style[count]["title"] = styleTitle;
+}
+
+//layer
+function wms_add_layer(
+ layer_parent,
+ layer_name,
+ layer_title,
+ layer_pos,
+ layer_queryable,
+ layer_minscale,
+ layer_maxscale,
+ gui_layer_wms_id,
+ gui_layer_status,
+ gui_layer_selectable,
+ gui_layer_visible,
+ gui_layer_queryable,
+ gui_layer_querylayer,
+ gui_layer_minscale,
+ gui_layer_maxscale){
+
+ wms[wms.length-1].objLayer[wms[wms.length-1].objLayer.length] = new wms_layer(
+ layer_parent,
+ layer_name,
+ layer_title,
+ layer_pos,
+ layer_queryable,
+ layer_minscale,
+ layer_maxscale,
+ gui_layer_wms_id,
+ gui_layer_status,
+ gui_layer_selectable,
+ gui_layer_visible,
+ gui_layer_queryable,
+ gui_layer_querylayer,
+ gui_layer_minscale,
+ gui_layer_maxscale );
+//alert(layer_parent + " , " +layer_name + " , " +layer_title + " , " +layer_pos + " , " +layer_queryable + " , " +layer_minscale + " , " +layer_maxscale + " , " +gui_layer_wms_id + " , " +gui_layer_status+" , "+gui_layer_selectable + " , " +gui_layer_visible + " , " +gui_layer_queryable + " , " +gui_layer_querylayer );
+}
+function wms_layer(
+ layer_parent,
+ layer_name,
+ layer_title,
+ layer_pos,
+ layer_queryable,
+ layer_minscale,
+ layer_maxscale,
+ gui_layer_wms_id,
+ gui_layer_status,
+ gui_layer_selectable,
+ gui_layer_visible,
+ gui_layer_queryable,
+ gui_layer_querylayer,
+ gui_layer_minscale,
+ gui_layer_maxscale){
+ this.layer_id = wms_layer_count;
+ this.layer_parent = layer_parent;
+ this.layer_name = layer_name;
+ this.layer_title = layer_title;
+ this.layer_pos = layer_pos;
+ this.layer_queryable = layer_queryable;
+ this.layer_minscale = layer_minscale;
+ this.layer_maxscale = layer_maxscale;
+ this.layer_epsg = new Array();
+ this.gui_layer_wms_id = gui_layer_wms_id;
+ this.gui_layer_status = gui_layer_status;
+ this.gui_layer_selectable = gui_layer_selectable;
+ this.gui_layer_visible = gui_layer_visible;
+ this.gui_layer_queryable = gui_layer_queryable;
+ this.gui_layer_querylayer = gui_layer_querylayer;
+ this.gui_layer_minscale = gui_layer_minscale;
+ this.gui_layer_maxscale = gui_layer_maxscale;
+ this.layer_style = new Array();
+ wms_layer_count++;
+}
+
Added: trunk/mapbender/http/javascripts/mod_addWMS.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_addWMS.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_addWMS.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,53 @@
+<?php
+#$Id: mod_addWMS.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_addWMS.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'addWMS' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $e_require = $row["e_requires"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('addWMS: ID not unique!');";}
+echo "var mod_addWMS_data = '".$e_require."';";
+$target = explode(",", $e_target);
+echo "var mod_addWMS_target1 = '".trim($target[0])."';";
+echo "var mod_addWMS_target2 = '".trim($target[1])."';";
+?>
+
+function mod_addWMS(){
+ var load = prompt("Capabilities - URL:","");
+ if(load){
+ mod_addWMS_load(load);
+ }
+}
+function mod_addWMS_load(caps){
+ window.frames[mod_addWMS_data].document.location.href = "../php/mod_createJSObjFromXML.php?caps=" + escape(caps);
+}
+function mod_addWMS_refresh(){
+ mb_mapObjaddWMS(mod_addWMS_target2);
+ window.frames[mod_addWMS_target1].document.location.reload();
+ zoom(mod_addWMS_target2, true, 1.0); // div-tags have to be created
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_addWMSfromList.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_addWMSfromList.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_addWMSfromList.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,198 @@
+<?php
+#$Id: mod_addWMSfromList.php,v 1.13 2006/03/10 12:53:41 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_addWMSfromList.php,v 1.13 2006/03/10 12:53:41 astrid_emde Exp $
+# 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("../../conf/mapbender.conf");
+require_once("../php/mb_validateSession.php");
+import_request_variables("PG");
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Add WMS from Catalog</title>
+<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
+
+<script type="text/javascript">
+<!--
+
+function mod_addWMS(pointer_name,version)
+{
+ var mywms = pointer_name;
+ if(mywms.indexOf("?") > -1){pointer_name += "&";}
+ if(mywms.indexOf("?") == -1){pointer_name += "?";}
+
+
+ if (version == '1.0.0')
+ {
+ var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
+ var load = cap;
+ }
+ else if (version == '1.1.0')
+ {
+ var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
+ var load = cap;
+ }
+ else if (version == '1.1.1')
+ {
+ var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
+ var load = cap;
+ }
+
+
+ if(load)
+ {
+ window.opener.mod_addWMS_load(load);
+ }
+}
+
+// -->
+</script>
+
+</head>
+<body onload='window.focus()'>
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_gui_wms = 0;
+$cnt_wms = 0;
+
+$exists = false;
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+$logged_gui_id=$_SESSION["mb_user_gui"];
+
+/*get infos from gui_element ********************************************************************************************/
+
+$sql_target = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'addWMS' AND fkey_gui_id = '".$logged_gui_id."'";
+$res_target = db_query($sql_target);
+$cnt_target = 0;
+while($row = db_fetch_array($res_target)){
+ $e_target = $row["e_target"];
+ $e_require = $row["e_requires"];
+ $cnt_target++;
+}
+if($cnt_target > 1){ echo "alert('addWMS: ID not unique!');";}
+echo "<script language='Javascript'>";
+echo "var gui_id = '".$logged_gui_id."';";
+echo "var mod_addWMS_data = '".$e_require."';";
+$target = explode(",", $e_target);
+echo "var mod_addWMS_target1 = '".trim($target[0])."';";
+echo "var mod_addWMS_target2 = '".trim($target[1])."';";
+echo "</script>";
+/*get infos from gui_element ********************************************************************************************/
+
+
+/*get allocated gui ********************************************************************************************/
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+ if($i>0){ $sql_gui .= ",";}
+ $sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+ while($row = db_fetch_array($res_gui)){
+ $gui_id[$cnt_gui] = $row["gui_id"];
+ $gui_name[$cnt_gui] = $row["gui_name"];
+ $cnt_gui++;
+ }
+/*get allocated gui ********************************************************************************************/
+
+/*get allocated wms from allocated gui ********************************************************************************************/
+$sql_gui_wms = "SELECT DISTINCT fkey_wms_id FROM gui_wms WHERE fkey_gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+ if($i>0){ $sql_gui_wms .= ",";}
+ $sql_gui_wms .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui_wms.= ") ORDER BY fkey_wms_id";
+
+$res_gui_wms = db_query($sql_gui_wms);
+ while($row = db_fetch_array($res_gui_wms)){
+ $fkey_gui_id[$cnt_gui_wms] = $row["fkey_gui_id"];
+ $fkey_wms_id[$cnt_gui_wms] = $row["fkey_wms_id"];
+ $cnt_gui_wms++;
+ }
+/*get allocated wms from allocated gui ********************************************************************************************/
+
+/*get allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+$sql_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities,wms_version FROM wms WHERE wms_id IN (";
+
+for($i=0; $i<count($fkey_wms_id); $i++){
+ if($i>0){ $sql_wms .= ",";}
+ $sql_wms .= "'".$fkey_wms_id[$i]."'";
+}
+#$sql_wms.= ") ORDER BY wms_id";
+$sql_wms.= ") ORDER BY wms_title";
+
+$res_wms = db_query($sql_wms);
+ while($row = db_fetch_array($res_wms)){
+ $wms_title[$cnt_wms] = $row["wms_title"];
+ $wms_abstract[$cnt_wms] = $row["wms_abstract"];
+ $wms_getcapabilities[$cnt_wms] = $row["wms_getcapabilities"];
+ $wms_version[$cnt_wms] = $row["wms_version"];
+ $cnt_wms++;
+ }
+/*get allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+
+
+/*INSERT HTML*/
+
+#echo "<table border='2' cellpadding='5' rules='rows'>";
+echo "<table border='1' style='font-size: 11;' cellpadding='2' rules='rows'>";
+echo " <thead bgcolor = 'lightgrey' >";
+echo "<tr ><td height='30'>WMS-Title</td><td align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+echo " </thead>";
+echo " <tbody >";
+ for($i=0; $i<$cnt_wms; $i++){
+ echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+ echo "<td><div id ='id_".$wms_title[$i]."' class='even' name ='name_".$wms_title[$i]."' style='cursor:pointer' onclick = 'mod_addWMS(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_title[$i]."</div></td>";
+ echo "<td><div id ='id_".$wms_abstract[$i]."' class='even' name ='name_".$wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMS(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_abstract[$i]."</div></td>";
+ echo "</tr>";
+
+
+ }
+echo " </tbody>";
+echo "</table>";
+
+
+
+?>
+<script type="text/javascript">
+
+
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,617 @@
+<?php
+#$Id: mod_addWMSfromfilteredList.php,v 1.14 2006/03/10 12:53:25 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_addWMSfromfilteredList.php,v 1.14 2006/03/10 12:53:25 astrid_emde Exp $
+# 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.
+
+#$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+require_once("../php/mb_validateSession.php");
+import_request_variables("PG");
+
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Add WMS from Filtered Catalog</title>
+<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
+
+<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;
+ }
+
+ .wms_button{
+ color: black;
+ border: solid thin;
+ height:22px;
+ width:60px;
+ }
+
+ -->
+</STYLE>
+
+
+<script type="text/javascript">
+<!--
+<?php
+#$con = db_connect($DBSERVER,$OWNER,$PW);
+#db_select_db(DB,$con);
+#$sql = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'addWMSfromfilteredList' AND fkey_gui_id = '".$gui_id."'";
+#echo "var sql_x = ".$sql.";";
+#$res = db_query($sql);
+#$cnt = 0;
+#while($row = db_fetch_array($res)){
+# $e_target = $row["e_target"];
+# $e_require = $row["e_requires"];
+# $cnt++;
+#}
+
+#if($cnt > 1){ echo "alert('addWMSfromfilteredList: ID not unique!');";}
+#echo "var mod_addWMSfromfilteredList_data = 'loadData';";
+#$target = explode(",", $e_target);
+#echo "var mod_addWMSfromfilteredList_target1 = 'treeGDE';";
+#echo "var mod_addWMSfromfilteredList_target2 = 'mapframe1';";
+
+/*get infos from gui_element ********************************************************************************************/
+
+/*
+$sql_target = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'addWMS' AND fkey_gui_id = '".$logged_gui_id."'";
+$res_target = db_query($sql_target);
+$cnt_target = 0;
+while($row = db_fetch_array($res_target)){
+ $e_target = $row["e_target"];
+ $e_require = $row["e_requires"];
+ $cnt_target++;
+}
+if($cnt_target > 1){ echo "alert('addWMS: ID not unique!');";}
+echo "<script language='Javascript'>";
+echo "var gui_id = '".$logged_gui_id."';";
+echo "var mod_addWMS_data = '".$e_require."';";
+$target = explode(",", $e_target);
+echo "var mod_addWMS_target1 = '".trim($target[0])."';";
+echo "var mod_addWMS_target2 = '".trim($target[1])."';";
+echo "</script>";
+*/
+?>
+
+function mod_addWMSfromfilteredList(pointer_name,version)
+{
+ //alert(pointer_name);
+ //alert(version);
+
+ var mywms = pointer_name;
+ if(mywms.indexOf("?") > -1){pointer_name += "&";}
+ if(mywms.indexOf("?") == -1){pointer_name += "?";}
+
+ if (version == '1.0.0')
+ {
+ var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
+ var load = cap;
+ }
+ else if (version == '1.1.0')
+ {
+ var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
+ var load = cap;
+ }
+ else if (version == '1.1.1')
+ {
+ var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
+ var load = cap;
+ }
+
+
+ if(load)
+ {
+ // if the mapfile WMS ONLINE RESOURCE is set relative, without any host
+// if(rest.charAt(0) == '/' && rest.charAt(1) == 'c')
+ if(load.charAt(0) == '/' && load.charAt(1) == 'c')
+ {
+ window.opener.mod_addWMS_load('http://localhost' + load);
+ }
+ else
+ {
+ window.opener.mod_addWMS_load(load);
+ }
+ }
+}
+
+
+
+function mod_show_group_wms(wert)
+ {
+ document.form1.show_group_wms.value = wert;
+ document.form1.submit();
+ }
+
+function mod_show_gui_wms(wert2)
+ {
+ document.form1.show_gui_wms.value = wert2;
+ document.form1.submit();
+ }
+
+function mod_show_wms(wert3)
+ {
+ document.form1.wms_show.value = wert3;
+ document.form1.submit();
+ }
+
+// -->
+</script>
+
+</head>
+<body onLoad="window.focus()">
+
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+require_once("../classes/class_wms.php");
+require_once("../php/mb_getGUIs.php");
+
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_gui_wms = 0;
+$cnt_wms = 0;
+$cnt_user_group = 0;
+$cnt_group = 0;
+$cnt_gui_mb_group = 0;
+$cnt_group_gui_wms = 0;
+$cnt_fkey_group_gui_wms = 0;
+$cnt_fkey_show_gui_wms = 0;
+$cnt_show_gui_wms = 0;
+$cnt_group_name = 0;
+$cnt_gui_table = 0;
+
+$exists = false;
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+$logged_gui_id=$_SESSION["mb_user_gui"];
+
+###### SQL #####################################################################################
+
+
+/*get infos from gui_element ********************************************************************************************/
+
+/*get group from logged user ********************************************************************************************/
+$sql_user_group = "SELECT * FROM mb_user_mb_group WHERE fkey_mb_user_id='".$logged_user_id."'";
+$res_user_group = db_query($sql_user_group);
+ while($row = db_fetch_array($res_user_group)){
+ $user_id[$cnt_user_group] = $row["fkey_mb_user_id"];
+ $group_id[$cnt_user_group] = $row["fkey_mb_group_id"];
+ $cnt_user_group++;
+ }
+/*get group from logged user ********************************************************************************************/
+
+/*get group name ********************************************************************************************/
+if(count($group_id) > 0)
+{
+ $sql_group = "SELECT mb_group_id, mb_group_name, mb_group_description FROM mb_group WHERE mb_group_id IN (";
+
+ for($i=0; $i < count($group_id); $i++){
+ if($i>0){ $sql_group .= ",";}
+ $sql_group .= "'".$group_id[$i]."'";
+
+ $sql_group.= ") ORDER BY mb_group_name";
+
+ $res_group = db_query($sql_group);
+ while($row = db_fetch_array($res_group)){
+ $mb_group_description[$cnt_group] = $row["mb_group_description"];
+ $my_group_name[$cnt_group] = $row["mb_group_name"];
+ $my_group_id[$cnt_group] = $row["mb_group_id"];
+ $cnt_group++;
+ }
+ }
+}
+/*get goup name ********************************************************************************************/
+
+/*get allocated gui ********************************************************************************************/
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+ if($i>0){ $sql_gui .= ",";}
+ $sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+ while($row = db_fetch_array($res_gui)){
+ $gui_id[$cnt_gui] = $row["gui_id"];
+ $gui_name[$cnt_gui] = $row["gui_name"];
+ $gui_description[$cnt_gui] = $row["gui_description"];
+ #echo"$gui_name[$cnt_gui]";
+ $cnt_gui++;
+ }
+/*get allocated gui ********************************************************************************************/
+
+/*get allocated wms from allocated gui ********************************************************************************************/
+$sql_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+ if($i>0){ $sql_gui_wms .= ",";}
+ $sql_gui_wms .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui_wms.= ") ORDER BY fkey_wms_id";
+
+$res_gui_wms = db_query($sql_gui_wms);
+ while($row = db_fetch_array($res_gui_wms)){
+ $fkey_gui_id[$cnt_gui_wms] = $row["fkey_gui_id"];
+ $fkey_wms_id[$cnt_gui_wms] = $row["fkey_wms_id"];
+ $cnt_gui_wms++;
+ }
+/*get allocated wms from allocated gui ********************************************************************************************/
+
+/*get allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+$sql_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_version FROM wms WHERE wms_id IN (";
+
+for($i=0; $i<count($fkey_wms_id); $i++){
+ if($i>0){ $sql_wms .= ",";}
+ $sql_wms .= "'".$fkey_wms_id[$i]."'";
+}
+$sql_wms.= ") ORDER BY wms_title";
+
+$res_wms = db_query($sql_wms);
+ while($row = db_fetch_array($res_wms)){
+ $wms_title[$cnt_wms] = $row["wms_title"];
+ $wms_abstract[$cnt_wms] = $row["wms_abstract"];
+ $wms_getcapabilities[$cnt_wms] = $row["wms_getcapabilities"];
+ $wms_version[$cnt_wms] = $row["wms_version"];
+ $cnt_wms++;
+ }
+/*get allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+# Button
+echo "<table border='0' cellpadding='3' rules='rows'>";
+echo "<tr>";
+if (isset($wms_show))
+{
+echo "<td><input type='button' class='wms_button' name='wms1' value='all wms' onclick='mod_show_wms(1)'></td>";
+echo "<td><input type='button' class='wms_button' name='wms2' value='group' onclick = 'mod_show_wms(2)'></td>";
+echo "<td><input type='button' class='wms_button' name='wms3' value='gui' onclick = 'mod_show_wms(3)'></td>";
+echo "</tr>";
+echo "</table>";
+
+
+###### SQL #####################################################################################
+
+
+###### SHOW GUI WMS OR GROUP WMS #####################################################################################
+
+/*show goup wms ********************************************************************************************/
+#if (isset($show_group_wms))
+if (!empty($show_group_wms))
+{
+ /*get gui goup ********************************************************************************************/
+ $sql_gui_mb_group = "SELECT fkey_gui_id, fkey_mb_group_id FROM gui_mb_group WHERE fkey_mb_group_id='".$show_group_wms."'";
+ $res_gui_mb_group = db_query($sql_gui_mb_group);
+
+ while($row = db_fetch_array($res_gui_mb_group)){
+ $group_gui_id[$cnt_gui_mb_group] = $row["fkey_gui_id"];
+ $fkey_mb_group_id[$cnt_gui_mb_group] = $row["fkey_mb_group_id"];
+ #echo"$group_gui_id[$cnt_gui_mb_group]";
+ $cnt_gui_mb_group++;
+
+ }
+ /*get gui goup ********************************************************************************************/
+
+ /*get group gui WMS ********************************************************************************************/
+ if(count($group_gui_id)>0){
+ $sql_fkey_group_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id IN (";
+
+ for($i=0; $i<count($group_gui_id); $i++){
+ if($i>0){ $sql_fkey_group_gui_wms .= ",";}
+ $sql_fkey_group_gui_wms .= "'".$group_gui_id[$i]."'";
+ }
+ $sql_fkey_group_gui_wms.= ") ORDER BY fkey_wms_id";
+
+ $res_fkey_group_gui_wms = db_query($sql_fkey_group_gui_wms);
+ while($row = db_fetch_array($res_fkey_group_gui_wms)){
+ $fkey_group_gui_gui_id[$cnt_fkey_group_gui_wms] = $row["fkey_gui_id"];
+ $fkey_group_gui_wms_id[$cnt_fkey_group_gui_wms] = $row["fkey_wms_id"];
+ #echo"$fkey_group_gui_wms_id[$cnt_fkey_group_gui_wms]";
+ $cnt_fkey_group_gui_wms++;
+ }
+
+ /*get group gui WMS ********************************************************************************************/
+
+ /*group: get allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+ if(count($fkey_group_gui_wms_id)>0){
+ $sql_group_gui_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_version FROM wms WHERE wms_id IN (";
+
+ for($i=0; $i<count($fkey_group_gui_wms_id); $i++){
+ if($i>0){ $sql_group_gui_wms .= ",";}
+ $sql_group_gui_wms .= "'".$fkey_group_gui_wms_id[$i]."'";
+ }
+ $sql_group_gui_wms.= ") ORDER BY wms_title";
+
+ $res_group_gui_wms = db_query($sql_group_gui_wms);
+ while($row = db_fetch_array($res_group_gui_wms)){
+ $group_wms_title[$cnt_group_gui_wms] = $row["wms_title"];
+ $group_wms_abstract[$cnt_group_gui_wms] = $row["wms_abstract"];
+ $group_wms_getcapabilities[$cnt_group_gui_wms] = $row["wms_getcapabilities"];
+ $group_wms_version[$cnt_group_gui_wms] = $row["wms_version"];
+ #echo"$group_wms_title[$cnt_group_gui_wms]";
+ $cnt_group_gui_wms++;
+ }
+ }
+ }
+ /*group: get allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+
+ /*table with allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+# if ($show_group_wms > 0)
+ if ($cnt_group_gui_wms > 0)
+ {
+ /*get goup name for showing in the table ********************************************************************************************/
+ $sql_group_name = "SELECT mb_group_id, mb_group_name FROM mb_group WHERE mb_group_id ='".$show_group_wms."'";
+ $res_group_name = db_query($sql_group_name);
+ while($row = db_fetch_array($res_group_name)){
+ $group_name_table[$cnt_group_name] = $row["mb_group_name"];
+ $my_group_id_table[$cnt_group_name] = $row["mb_group_id"];
+ $cnt_group_name++;
+ }
+ /*get goup name ********************************************************************************************/
+
+ echo"<br>";
+ echo"<br>";
+ echo"wms from group: $group_name_table[0]";
+ echo"<br>";
+ echo"<br>";
+ echo "<table border='1' width ='98%' cellpadding='3' rules='rows'>";
+ echo " <thead bgcolor = '#FAEBD7' >";
+ echo "<tr><td width='200' height='10'>WMS-Title</td><td align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+ echo " </thead>";
+ echo " <tbody >";
+ for($i=0; $i<$cnt_group_gui_wms; $i++){
+ echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+ echo "<td><div id ='id_".$group_wms_title[$i]."' class='even' name ='name_".$group_wms_title[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$group_wms_getcapabilities[$i]."\",\"".$group_wms_version[$i]."\")'>".$group_wms_title[$i]."</div></td>";
+ echo "<td><div id ='id_".$group_wms_abstract[$i]."' class='even' name ='name_".$group_wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$group_wms_getcapabilities[$i]."\",\"".$group_wms_version[$i]."\")'>".$group_wms_abstract[$i]."</div></td>";
+ echo "</tr>";
+ }
+ echo " </tbody>";
+ echo "</table>";
+ }
+ else
+ {
+ echo"<br>";
+ echo"<br>";
+ echo "no wms in this group";
+ }/*End: if ($show_group_wms > 0) *********/
+ /*table with allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+
+
+}/*End: if (!empty($show_group_wms)) *********/
+
+/*show gui wms ********************************************************************************************/
+if (!empty($show_gui_wms))
+{
+ /*get group gui WMS ********************************************************************************************/
+ $sql_fkey_show_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id ='".$show_gui_wms."'";
+ #$sql_fkey_show_gui_wms.= ") ORDER BY fkey_wms_id";
+
+ $res_fkey_show_gui_wms = db_query($sql_fkey_show_gui_wms);
+ while($row = db_fetch_array($res_fkey_show_gui_wms)){
+ $fkey_show_gui_gui_id[$cnt_fkey_show_gui_wms] = $row["fkey_gui_id"];
+ $fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms] = $row["fkey_wms_id"];
+ #echo"$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms]";
+ $cnt_fkey_show_gui_wms++;
+ }
+ /*get group gui WMS ********************************************************************************************/
+
+ /*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+ if(count($fkey_show_gui_wms_id)>0){
+ $sql_show_gui_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_id, wms_version FROM wms WHERE wms_id IN (";
+
+ for($i=0; $i<count($fkey_show_gui_wms_id); $i++){
+ if($i>0){ $sql_show_gui_wms .= ",";}
+ $sql_show_gui_wms .= "'".$fkey_show_gui_wms_id[$i]."'";
+ }
+ $sql_show_gui_wms.= ") ORDER BY wms_title";
+
+
+ $res_show_gui_wms = db_query($sql_show_gui_wms);
+ while($row = db_fetch_array($res_show_gui_wms)){
+ $gui_wms_id[$cnt_show_gui_wms] = $row["wms_id"];
+ $gui_wms_title[$cnt_show_gui_wms] = $row["wms_title"];
+ $gui_wms_abstract[$cnt_show_gui_wms] = $row["wms_abstract"];
+ $gui_wms_getcapabilities[$cnt_show_gui_wms] = $row["wms_getcapabilities"];
+ $gui_wms_version[$cnt_show_gui_wms] = $row["wms_version"];
+ #echo"$gui_wms_title[$cnt_show_gui_wms]";
+ $cnt_show_gui_wms++;
+ }
+ /*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+
+ /*table with allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+ #if (isset($cnt_show_gui_wms > 0))
+ }
+
+ if ($cnt_show_gui_wms > 0)
+ {
+ /*get selected gui name for table caption ********************************************************************************************/
+ $sql_gui_table = "SELECT * FROM gui WHERE gui_id ='".$show_gui_wms."'";
+ $res_gui_table = db_query($sql_gui_table);
+ while($row = db_fetch_array($res_gui_table)){
+ $gui_id_table[$cnt_gui_table] = $row["gui_id"];
+ $gui_name_table[$cnt_gui_table] = $row["gui_name"];
+ $cnt_gui_table++;
+ #echo"$gui_id_table[0]";
+ }
+ /*get selected gui name for table caption ********************************************************************************************/
+
+ echo"<br>";
+ echo"<br>";
+ echo"wms from gui: $gui_name_table[0]";
+ echo"<br>";
+ echo"<br>";
+ echo "<table border='1' width ='98%' cellpadding='3' rules='rows'>";
+ echo " <thead bgcolor = '#FAEBD7' >";
+ echo "<tr><td width='200' height='10'>WMS-Title</td><td align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+ echo " </thead>";
+ echo " <tbody >";
+ for($i=0; $i<$cnt_show_gui_wms; $i++){
+ echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+ echo "<td><div id ='id_".$gui_wms_title[$i]."' class='even' name ='name_".$gui_wms_title[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$gui_wms_getcapabilities[$i]."\",\"".$gui_wms_version[$i]."\")'>".$gui_wms_title[$i]."</div></td>";
+ echo "<td><div id ='id_".$gui_wms_abstract[$i]."' class='even' name ='name_".$gui_wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$gui_wms_getcapabilities[$i]."\",\"".$gui_wms_version[$i]."\")'>".$gui_wms_abstract[$i]."</div></td>";
+ echo "</tr>";
+ }
+ echo " </tbody>";
+ echo "</table>";
+ }
+ else
+ {
+ echo"<br>";
+ echo"<br>";
+ echo"<br>";
+
+ echo "no wms in this gui";
+
+ } /*End: if ($cnt_show_gui_wms > 0) *********/
+ /*table with allocated wms-Abstract and wms-Capabilities from allocated gui ********************************************************************************************/
+
+
+} /*End: if(isset($show_gui_wms)) *********/
+
+###### SHOW GUI WMS OR GROUP WMS #####################################################################################
+
+###### SHOW GUI OR GROUP OR ALL WMS #####################################################################################
+
+ if ($wms_show == 3) #gui
+ {
+ echo"<br>";
+ echo"<br>";
+ echo"Please select a gui:";
+ echo"<br>";
+ echo"<br>";
+ echo "<table border='1' width='98%' cellpadding='3' rules='rows'>";
+ echo " <thead bgcolor = 'lightgrey' >";
+ echo "<tr><td width='200' height='10'>gui name</td><td align = 'left' class='fieldnames_s'>description</td>";
+ echo " </thead>";
+ echo " <tbody >";
+ for($i=0; $i<$cnt_gui; $i++){
+ echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+ echo "<td><div id ='id_".$gui_name[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_name[$i]."' style='cursor:pointer' onclick = 'mod_show_gui_wms(\"".$gui_id[$i]."\")'>".$gui_name[$i]."</div></td>";
+ echo "<td><div id ='id_".$gui_description[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_description[$i]."' style='cursor:pointer' onclick = 'mod_show_gui_wms(\"".$gui_id[$i]."\")'>".$gui_description[$i]."</div></td>";
+ echo "</tr>";
+ }
+ echo " </tbody>";
+ echo "</table>";
+
+ }elseif ($wms_show== 2) # group
+ {
+ echo"<br>";
+ echo"<br>";
+
+ if($cnt_group>0){
+ echo "Please select a group:";
+ echo"<br>";
+ echo"<br>";
+ echo "<table border='1' width='98%' cellpadding='3' rules='rows'>";
+ echo " <thead bgcolor = 'lightgrey' >";
+ echo "<tr><td width='200' height='10'>group name</td><td align = 'left' class='fieldnames_s'>description</td>";
+ echo " </thead>";
+ echo " <tbody >";
+ for($i=0; $i<$cnt_group; $i++){
+ echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+ echo "<td><div id ='id_".$my_group_name[$i]."' value='".$my_group_id[$i]."' class='even' name ='".$my_group_name[$i]."' style='cursor:pointer' onclick = 'mod_show_group_wms(\"".$my_group_id[$i]."\")'>".$my_group_name[$i]."</div></td>";
+ echo "<td><div id ='id_".$mb_group_description[$i]."' value='".$my_group_id[$i]."' class='even' name ='".$mb_group_description[$i]."' style='cursor:pointer' onclick = 'mod_show_group_wms(\"".$my_group_id[$i]."\")'>".$mb_group_description[$i]."</div></td>";
+ echo "</tr>";
+ }
+ echo " </tbody>";
+ echo "</table>";
+ }else{
+ echo"no group for this user";
+ }
+
+ }elseif ($wms_show== 1) # all wms
+ {
+ echo"<br>";
+ echo"<br>";
+
+ echo "<table border='1' width ='98%' cellpadding='3' rules='rows'>";
+ echo " <thead bgcolor = '#FAEBD7' >";
+ echo "<tr><td width='200' height='10'>WMS-Title</td><td align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+ echo " </thead>";
+ echo " <tbody >";
+ for($i=0; $i<$cnt_wms; $i++){
+ echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+ echo "<td><div id ='id_".$wms_title[$i]."' class='even' name ='name_".$wms_title[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_title[$i]."</div></td>";
+ echo "<td><div id ='id_".$wms_abstract[$i]."' class='even' name ='name_".$wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_abstract[$i]."</div></td>";
+ echo "</tr>";
+ }
+ echo " </tbody>";
+ echo "</table>";
+ }
+}else #if (!isset($wms_show))
+{
+echo "<td><input type='button' class='wms_button' name='wms1' value='all wms' onclick='mod_show_wms(1)'></td>";
+echo "<td><input type='button' class='wms_button' name='wms2' value='group' onclick = 'mod_show_wms(2)'></td>";
+echo "<td><input type='button' class='wms_button' name='wms3' value='gui' onclick = 'mod_show_wms(3)'></td>";
+echo "</tr>";
+echo "</tbody>";
+echo "</table>";
+echo"<br>";
+echo"<br>";
+
+echo "<table border='1' width ='98%' cellpadding='3' rules='rows'>";
+echo " <thead bgcolor = '#FAEBD7' >";
+echo "<tr><td width='200' height='10'>WMS-Title</td><td align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+echo " </thead>";
+echo " <tbody >";
+ for($i=0; $i<$cnt_wms; $i++){
+ echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+ echo "<td><div id ='id_".$wms_title[$i]."' class='even' name ='name_".$wms_title[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_title[$i]."</div></td>";
+ echo "<td><div id ='id_".$wms_abstract[$i]."' class='even' name ='name_".$wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_abstract[$i]."</div></td>";
+ echo "</tr>";
+ }
+echo " </tbody>";
+echo "</table>";
+}
+
+###### SHOW GUI OR GROUP OR ALL WMS #####################################################################################
+
+
+/*show group wms ********************************************************************************************/
+echo "<input type='hidden' name='show_group_wms'>";
+/*show gui wms ********************************************************************************************/
+echo "<input type='hidden' name='show_gui_wms'>";
+/*show button ********************************************************************************************/
+echo "<input type='hidden' name='wms_show'>";
+echo "</form>";
+?>
+<script type="text/javascript">
+
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,13 @@
+//$Id: mod_addWMSgeneralFunctions.js,v 1.1 2006/02/03 13:25:48 astrid_emde Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_addWMSgeneralFunctions.js,v 1.1 2006/02/03 13:25:48 astrid_emde Exp $
+
+
+function mod_addWMS_load(caps){
+ window.frames['loadData'].document.location.href = "../php/mod_createJSObjFromXML.php?caps=" + escape(caps);
+}
+
+function mod_addWMS_refresh(){
+ mb_mapObjaddWMS('mapframe1')
+ window.frames['treeGDE'].document.location.reload();
+ zoom('mapframe1', true, 0.999);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_adminNavigation.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_adminNavigation.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_adminNavigation.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,13 @@
+//$Id: mod_adminNavigation.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_adminNavigation.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+function mod_adminNavigation_init(){
+ for (var i=0; i< document.getElementsByTagName("a").length; i++){
+ document.getElementsByTagName("a")[i].onclick = new Function("mod_adminNavigation(this)");
+ }
+}
+function mod_adminNavigation(obj){
+ for (var i=0; i< document.getElementsByTagName("a").length; i++){
+ document.getElementsByTagName("a")[i].style.color = "#808080";
+ }
+ obj.style.color = "#0000ff";
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_back.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_back.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_back.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,126 @@
+<?php
+#$Id: mod_back.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_back.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'back' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = split(",",$row["e_target"]);
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('back: ID not unique!');";}
+echo "var mod_back_map = '".$e_target[0]."';";
+echo "var mod_back_overview = '".$e_target[1]."';";
+
+?>
+var mb_MapHistoryObj = new Array();
+var mod_back_img_off = new Image(); mod_back_img_off.src = "<?php echo preg_replace("/_off_disabled/","_off",$e_src); ?>";
+var mod_back_img_off_disabled = new Image(); mod_back_img_off_disabled.src = "<?php echo $e_src; ?>";
+var mod_back_img_over = new Image(); mod_back_img_over.src = "<?php echo preg_replace("/_off_disabled/","_over",$e_src); ?>";
+var mod_back_img_previous = null;
+var mod_back_cnt = -1;
+
+mb_registerSubFunctions("mb_setHistoryObj(frameName)");
+mb_registerSubFunctions("mod_back_check(frameName)");
+
+function mod_back_check(frameName){
+ if(frameName == mod_back_map){
+ mod_back_cnt++;
+ //alert(mod_back_cnt);
+ if(mb_MapHistoryObj[mod_back_map].length > 1){
+ document.getElementById("back").src = mod_back_img_off.src;
+ }
+ else{
+ document.getElementById("back").src = mod_back_img_off_disabled.src;
+ mod_back_img_previous = document.getElementById("back").src;
+ }
+ }
+}
+function mod_back_over(obj){
+ mod_back_img_previous = document.getElementById("back").src;
+ if(document.getElementById("back").src == mod_back_img_off.src){
+ document.getElementById("back").src = mod_back_img_over.src;
+ }
+}
+
+function mod_back_out(obj){
+ document.getElementById("back").src = mod_back_img_previous;
+}
+function mod_back_set(){
+ if(mod_back_img_previous == mod_back_img_off.src){
+ //FutureObj
+ if(mb_MapFutureObj){
+ mb_setFutureObj(mod_back_map);
+ }
+ var ind = getMapObjIndexByName(mod_back_map);
+ var cnt = mb_MapHistoryObj[mod_back_map].length - 2;
+ if(mb_mapObj[ind].epsg != mb_MapHistoryObj[mod_back_map][cnt].epsg){
+ var oind = getMapObjIndexByName(mod_back_overview);
+ for(var i=0; i<mb_MapHistoryObj[mod_back_overview].length; i++){
+ if(mb_MapHistoryObj[mod_back_overview][i].epsg == mb_MapHistoryObj[mod_back_map][cnt].epsg){
+ mb_mapObj[oind].epsg = mb_MapHistoryObj[mod_back_overview][i].epsg;
+ mb_mapObj[oind].extent = mb_MapHistoryObj[mod_back_overview][i].extent;
+ setMapRequest(mod_back_overview);
+ break;
+ }
+ }
+ }
+ document.getElementById(mod_back_map).style.width = mb_MapHistoryObj[mod_back_map][cnt].width;
+ document.getElementById(mod_back_map).style.height = mb_MapHistoryObj[mod_back_map][cnt].height;
+ mb_mapObj[ind].width = mb_MapHistoryObj[mod_back_map][cnt].width;
+ mb_mapObj[ind].height = mb_MapHistoryObj[mod_back_map][cnt].height;
+ mb_mapObj[ind].epsg = mb_MapHistoryObj[mod_back_map][cnt].epsg;
+ mb_mapObj[ind].extent = mb_MapHistoryObj[mod_back_map][cnt].extent;
+ mb_mapObj[ind].layers = mb_MapHistoryObj[mod_back_map][cnt].layers;
+ mb_mapObj[ind].styles = mb_MapHistoryObj[mod_back_map][cnt].styles;
+ mb_mapObj[ind].querylayers = mb_MapHistoryObj[mod_back_map][cnt].querylayers;
+ mb_MapHistoryObj[mod_back_map].length = (mb_MapHistoryObj[mod_back_map].length - 2);
+ setMapRequest(mod_back_map);
+ }
+}
+function mb_setHistoryObj(frameName){
+ if(mb_MapHistoryObj[frameName] == null){
+ mb_MapHistoryObj[frameName] = new Array();
+ }
+ var ind = getMapObjIndexByName(frameName);
+ var cnt = mb_MapHistoryObj[frameName].length;
+ mb_MapHistoryObj[frameName][cnt] = new Object();
+ mb_MapHistoryObj[frameName][cnt].width = mb_mapObj[ind].width;
+ mb_MapHistoryObj[frameName][cnt].height = mb_mapObj[ind].height;
+ mb_MapHistoryObj[frameName][cnt].epsg = mb_mapObj[ind].epsg;
+ mb_MapHistoryObj[frameName][cnt].extent = mb_mapObj[ind].extent;
+ mb_MapHistoryObj[frameName][cnt].layers = new Array();
+ for(var i=0; i<mb_mapObj[ind].layers.length;i++){
+ mb_MapHistoryObj[frameName][cnt].layers[i] = mb_mapObj[ind].layers[i];
+ }
+ mb_MapHistoryObj[frameName][cnt].styles = new Array();
+ for(var i=0; i<mb_mapObj[ind].styles.length;i++){
+ mb_MapHistoryObj[frameName][cnt].styles[i] = mb_mapObj[ind].styles[i];
+ }
+ mb_MapHistoryObj[frameName][cnt].querylayers = new Array();
+ for(var i=0; i<mb_mapObj[ind].querylayers.length;i++){
+ mb_MapHistoryObj[frameName][cnt].querylayers[i] = mb_mapObj[ind].querylayers[i];
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_box.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_box.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_box.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,150 @@
+//$Id: mod_box.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_box.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+var mb_isActive = false;
+var mb_isBF = false;
+var mb_zF = false;
+
+function mod_box_start(e){
+//alert(mb_isBF);
+ mb_isActive = true;
+ mb_getMousePos(e,mb_isBF);
+ mb_start_x = clickX;
+ mb_start_y = clickY
+ mb_end_x = mb_start_x+1;
+ mb_end_y = mb_start_y+1;
+ mb_offset_left = mb_start_x;
+ mb_offset_top = mb_start_y;
+ mb_offset_bottom = mb_start_y;
+ mb_offset_right = mb_start_x
+ mb_drawBox(mb_start_x,mb_start_y,mb_end_x,mb_end_y);
+ return false;
+}
+function mod_box_run(e){
+ if(mb_isActive){
+ mb_getMousePos(e,mb_isBF);
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == mb_isBF){
+ var width = mb_mapObj[i].width;
+ var height = mb_mapObj[i].height;
+ }
+ }
+ if (((clickX>width) || (clickY>height) || (clickX<=0) ||(clickY<=0))) {isActive = false; mod_box_stop(e); }
+ else {
+ mb_end_x=clickX;
+ mb_end_y=clickY;
+ evalExtent();
+ }
+ return false;
+ }
+}
+function mod_box_stop(e){
+ mb_hideElement("l_top");
+ mb_hideElement("l_left");
+ mb_hideElement("l_right");
+ mb_hideElement("l_bottom");
+ if(mb_isActive){
+ mb_setMapExtent(mb_start_x,mb_start_y,mb_end_x,mb_end_y);
+ }
+ mb_isActive = false;
+}
+function mb_drawBox(left,top,right,bottom){
+ mb_arrangeBox("l_top",left,top,right,top+2);
+ mb_arrangeBox("l_left",left,top,left+2,bottom);
+ mb_arrangeBox("l_right",right-2,top,right,bottom);
+ mb_arrangeBox("l_bottom",left,bottom-2,right,bottom);
+ mb_displayElement("l_top");
+ mb_displayElement("l_left");
+ mb_displayElement("l_right");
+ mb_displayElement("l_bottom");
+}
+function mb_arrangeBox(name, left, top, right, bottom){
+ var el = window.frames[mb_isBF].document.getElementById(name).style;
+ el.height = Math.abs(bottom - top);
+ el.width = Math.abs(right - left);
+ el.top = top + "px";
+ el.left = left + "px";
+}
+function mb_displayElement(name){
+ window.frames[mb_isBF].document.getElementById(name).style.visibility = "visible";
+}
+function mb_hideElement(name) {
+ window.frames[mb_isBF].document.getElementById(name).style.visibility = "hidden";
+}
+function evalExtent() {
+ if (mb_start_x>mb_end_x) {
+ mb_offset_right=mb_start_x;
+ mb_offset_left=mb_end_x;
+ }
+ else {
+ mb_offset_left=mb_start_x;
+ mb_offset_right=mb_end_x;
+ }
+ if (mb_start_y>mb_end_y) {
+ mb_offset_bottom=mb_start_y;
+ mb_offset_top=mb_end_y;
+ } else {
+ mb_offset_top=mb_start_y;
+ mb_offset_bottom=mb_end_y;
+ }
+ if ((mb_start_x != mb_end_x) && (mb_start_y != mb_end_y)) {
+ mb_drawBox(mb_offset_left,mb_offset_top,mb_offset_right,mb_offset_bottom);
+ }
+}
+function mb_setMapExtent(x1,y1,x2,y2){
+ if(x1 < x2){
+ var minx = x1;
+ var maxx = x2;
+ }
+ else{
+ var minx = x2;
+ var maxx = x1;
+ }
+ if(y1 < y2){
+ var miny = y2;
+ var maxy = y1;
+ }
+ else{
+ var miny = y1;
+ var maxy = y2;
+ }
+ // area or clickpoint ?
+ if((maxx - minx) > 3 && (miny - maxy) > 3){
+ var posMin = makeClickPos2RealWorldPos(mb_isBF,minx,miny);
+ var posMax = makeClickPos2RealWorldPos(mb_isBF,maxx,maxy);
+ mb_setValidClipping(posMin[0],posMin[1],posMax[0], posMax[1]);
+ }
+ else{
+ var pos = makeClickPos2RealWorldPos(mb_isBF,minx,miny);
+ zoom(mb_zF,true,1.0,pos[0], pos[1]);
+ }
+}
+function mb_setValidClipping(minx,miny,maxx,maxy){
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == mb_zF){
+ var width = mb_mapObj[i].width;
+ var height = mb_mapObj[i].height;
+ }
+ }
+ var extenty = maxy - miny;
+ var extentx = maxx - minx;
+ var relation_px_x = width / height;
+ var relation_px_y = height / width;
+ var relation_bbox_x = extentx / extenty;
+
+ if(relation_bbox_x <= relation_px_x){
+ var centerx = minx + (extentx/2);
+ minx = centerx - relation_px_x * extenty / 2;
+ maxx = centerx + relation_px_x * extenty / 2;
+ }
+ if(relation_bbox_x > relation_px_x){
+ var centery = miny + (extenty/2);
+ miny = centery - relation_px_y * extentx / 2;
+ maxy = centery + relation_px_y * extentx / 2;
+ }
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == mb_zF){
+ mb_mapObj[i].extent = minx + "," + miny + "," + maxx + "," + maxy;
+ }
+ }
+ setMapRequest(mb_zF);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_box1.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_box1.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_box1.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,140 @@
+//$Id: mod_box1.js,v 1.2 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_box1.js,v 1.2 2005/09/13 14:38:11 bjoern_heuser Exp $
+/*
+<!--
+Licensing: See the GNU General Public License for more details.
+http://www.gnu.org/copyleft/gpl.html
+or:
+mapbender/licence/
+-->
+*/
+
+var mb_isActive = false;
+var mb_isBF = false;
+var mb_zF = false;
+
+
+function mod_box_start(e){
+//alert(mb_isBF);
+ mb_isActive = true;
+ mb_getMousePos(e,mb_isBF);
+ mb_start_x = clickX;
+ mb_start_y = clickY
+ mb_end_x = mb_start_x+1;
+ mb_end_y = mb_start_y+1;
+ mb_offset_left = mb_start_x;
+ mb_offset_top = mb_start_y;
+ mb_offset_bottom = mb_start_y;
+ mb_offset_right = mb_start_x
+ mb_drawBox(mb_start_x,mb_start_y,mb_end_x,mb_end_y);
+ return false;
+}
+function mod_box_run(e){
+ if(mb_isActive){
+ mb_getMousePos(e,mb_isBF);
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == mb_isBF){
+ var width = mb_mapObj[i].width;
+ var height = mb_mapObj[i].height;
+ }
+ }
+ if (((clickX>width) || (clickY>height) || (clickX<=0) ||(clickY<=0))) {isActive = false; mod_box_stop(e); }
+ else {
+ mb_end_x=clickX;
+ mb_end_y=clickY;
+ evalExtent();
+ }
+ return false;
+ }
+}
+function mod_box_stop(e){
+ mb_hideElement("l_top");
+ mb_hideElement("l_left");
+ mb_hideElement("l_right");
+ mb_hideElement("l_bottom");
+ if(mb_isActive){
+ mb_isActive = false;
+ return mb_setMapExtent(mb_start_x,mb_start_y,mb_end_x,mb_end_y);
+ }
+ mb_isActive = false;
+}
+function mb_drawBox(left,top,right,bottom){
+ mb_arrangeBox("l_top",left,top,right,top+2);
+ mb_arrangeBox("l_left",left,top,left+2,bottom);
+ mb_arrangeBox("l_right",right-2,top,right,bottom);
+ mb_arrangeBox("l_bottom",left,bottom-2,right,bottom);
+ mb_displayElement("l_top");
+ mb_displayElement("l_left");
+ mb_displayElement("l_right");
+ mb_displayElement("l_bottom");
+}
+function mb_arrangeBox(name, left, top, right, bottom){
+ var el = window.frames[mb_isBF].document.getElementById(name).style;
+ el.height = Math.abs(bottom - top);
+ el.width = Math.abs(right - left);
+ el.top = top + "px";
+ el.left = left + "px";
+}
+function mb_displayElement(name){
+ window.frames[mb_isBF].document.getElementById(name).style.visibility = "visible";
+}
+function mb_hideElement(name) {
+ window.frames[mb_isBF].document.getElementById(name).style.visibility = "hidden";
+}
+function evalExtent() {
+ if (mb_start_x>mb_end_x) {
+ mb_offset_right=mb_start_x;
+ mb_offset_left=mb_end_x;
+ }
+ else {
+ mb_offset_left=mb_start_x;
+ mb_offset_right=mb_end_x;
+ }
+ if (mb_start_y>mb_end_y) {
+ mb_offset_bottom=mb_start_y;
+ mb_offset_top=mb_end_y;
+ } else {
+ mb_offset_top=mb_start_y;
+ mb_offset_bottom=mb_end_y;
+ }
+ if ((mb_start_x != mb_end_x) && (mb_start_y != mb_end_y)) {
+ mb_drawBox(mb_offset_left,mb_offset_top,mb_offset_right,mb_offset_bottom);
+ }
+}
+function mb_setMapExtent(x1,y1,x2,y2){
+ if(x1 < x2){
+ var minx = x1;
+ var maxx = x2;
+ }
+ else{
+ var minx = x2;
+ var maxx = x1;
+ }
+ if(y1 < y2){
+ var miny = y2;
+ var maxy = y1;
+ }
+ else{
+ var miny = y1;
+ var maxy = y2;
+ }
+ // area or clickpoint ?
+ var ret = new Array();
+ if((maxx - minx) > 3 && (miny - maxy) > 3){
+ var posMin = makeClickPos2RealWorldPos(mb_isBF,minx,miny);
+ var posMax = makeClickPos2RealWorldPos(mb_isBF,maxx,maxy);
+ ret[0] = posMin[0];
+ ret[1] = posMin[1];
+ ret[2] = posMax[0];
+ ret[3] = posMax[1];
+ return ret;
+// mb_setValidClipping(posMin[0],posMin[1],posMax[0], posMax[1]);
+ }
+ else{
+ var posMin = makeClickPos2RealWorldPos(mb_isBF,minx,miny);
+ ret[0] = posMin[0];
+ ret[1] = posMin[1];
+ return ret;
+ //zoom(mb_zF,true,1.0,pos[0], pos[1]);
+ }
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_cardindex.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_cardindex.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_cardindex.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,51 @@
+//$Id: mod_cardindex.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_cardindex.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+/*********configuration:********************************************************************/
+var mod_cardindex_indexes = new Array("tab1 ","tab2 ","tab3 ","tab4 ");
+var mod_cardindex_id = new Array("iframe1","iframe2", "iframe3","iframe4");
+var mod_cardindex_dim = new Array();
+var mod_cardindex_icolor = "#7BA5D6"; // background active tabs
+var mod_cardindex_ficolor = "#ff0000"; // font activ tabs
+var mod_cardindex_bcolor = "#ffffff"; // background inactive tabs
+/***************************************************************************************/
+
+mb_registerInitFunctions("mod_cardindex_init()");
+function mod_cardindex_init(){
+ mod_cardindex_dim["width"] = document.getElementById(mod_cardindex_id[0]).style.width;
+ mod_cardindex_dim["height"] = document.getElementById(mod_cardindex_id[0]).style.height;
+ var str = "<span style='font-family: Arial, Helvetica, sans-serif;font-size:10px;cursor:pointer'>";
+ for(var i=0; i<mod_cardindex_indexes.length; i++){
+ str += "<span id='mod_cardindex"+i+"'onclick='mod_cardindex("+i+")' style='color:black'>"+mod_cardindex_indexes[i]+"</span> ";
+ }
+ str += "</span>";
+ writeTag("","cardindex",str);
+ for(var i=0; i<mod_cardindex_indexes.length; i++){
+ if(i == 0){
+ document.getElementById("mod_cardindex" + i).style.color = mod_cardindex_ficolor;
+ document.getElementById("mod_cardindex" + i).style.backgroundColor = mod_cardindex_icolor;
+ }
+ else{
+ document.getElementById(mod_cardindex_id[i]).style.visibility = 'hidden';
+ document.getElementById(mod_cardindex_id[i]).style.width = "1px";
+ document.getElementById(mod_cardindex_id[i]).style.height = "1px";
+ }
+ }
+}
+function mod_cardindex(obj){
+ for(var i=0; i<mod_cardindex_indexes.length; i++){
+ if(obj != i){
+ document.getElementById("mod_cardindex" + i).style.color = 'black';
+ document.getElementById("mod_cardindex" + i).style.backgroundColor = mod_cardindex_bcolor;
+ document.getElementById(mod_cardindex_id[i]).style.visibility = 'hidden';
+ document.getElementById(mod_cardindex_id[i]).style.width = "1px";
+ document.getElementById(mod_cardindex_id[i]).style.height = "1px";
+ }
+ else if(obj == i){
+ document.getElementById("mod_cardindex" + i).style.color = mod_cardindex_ficolor;
+ document.getElementById("mod_cardindex" + i).style.backgroundColor = mod_cardindex_icolor;
+ document.getElementById(mod_cardindex_id[i]).style.visibility = 'visible';
+ document.getElementById(mod_cardindex_id[i]).style.width = mod_cardindex_dim["width"];
+ document.getElementById(mod_cardindex_id[i]).style.height = mod_cardindex_dim["height"];
+ }
+ }
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_center1.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_center1.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_center1.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,75 @@
+<?php
+#$Id: mod_center1.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_center1.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'center1' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('center1: ID not unique!');";}
+echo "var mod_center_target = '".$e_target."';";
+?>
+
+var mod_center_elName = "center1";
+var mod_center_frameName = "";
+
+
+var mod_center_img_on = new Image(); mod_center_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_center_img_off = new Image(); mod_center_img_off.src = "<?php echo $e_src; ?>";
+var mod_center_img_over = new Image(); mod_center_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_gui1_center(ind){
+ mb_button[ind] = document.getElementById(mod_center_elName);
+ mb_button[ind].img_over = mod_center_img_over.src;
+ mb_button[ind].img_on = mod_center_img_on.src;
+ mb_button[ind].img_off = mod_center_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_center_elName;
+ mb_button[ind].fName = mod_center_frameName;
+ mb_button[ind].go = new Function ("mod_center_click()");
+ mb_button[ind].stop = new Function ("mod_center_disable()");
+}
+function mod_center_click(){
+ window.frames[mod_center_target].document.onclick = mod_center_event;
+}
+function mod_center_disable(){
+ window.frames[mod_center_target].document.onclick = null;
+}
+function mod_center_event(e){
+ if(ie){
+ clickX = window.frames[mod_center_target].event.clientX;
+ clickY = window.frames[mod_center_target].event.clientY;
+
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ var pos = makeClickPos2RealWorldPos(mod_center_target, clickX, clickY);
+ zoom(mod_center_target,true,1.0,pos[0], pos[1]);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_closePolygon.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_closePolygon.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_closePolygon.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,13 @@
+//$Id: mod_closePolygon.js,v 1.5 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_closePolygon.js,v 1.5 2005/09/13 14:38:11 bjoern_heuser Exp $
+var mod_closePolygon_img = new Image();
+mod_closePolygon_img.src = "../img/button_gray/closePolygon_off.gif";
+register_measureSubFunctions("mod_closePolygon()");
+function mod_closePolygon(){
+ var str = "<div style='position:absolute;top:25px' onmouseup='parent.mod_closePolygon_go()' ";
+ str += "onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_disableTimeout()'><img src='"+mod_closePolygon_img.src+"'></div>";
+ return str;
+}
+function mod_closePolygon_go(){
+ mod_measure_close();
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_closePolygonExt.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_closePolygonExt.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_closePolygonExt.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,13 @@
+//$Id: mod_closePolygonExt.js,v 1.1 2005/12/21 15:20:56 uli_rothstein Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_closePolygonExt.js,v 1.1 2005/12/21 15:20:56 uli_rothstein Exp $
+var mod_closePolygonExt_img = new Image();
+mod_closePolygonExt_img.src = "../img/button_gray/closePolygon_off.gif";
+register_setExtRequestSubFunctions("mod_closePolygonExt()");
+function mod_closePolygonExt(){
+ var str = "<div style='position:absolute;top:25px' onmouseup='parent.mod_wfs_SpatialRequest_close()' ";
+ str += "onmouseover='parent.mod_wfs_SpatialRequest_timeout()' onmouseout='parent.mod_wfs_SpatialRequest_disableTimeout()'><img src='"+mod_closePolygonExt_img.src+"'></div>";
+ return str;
+}
+function mod_closePolygonExt_go(){
+ mod_setExtRequest_close();
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_coords.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_coords.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_coords.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,93 @@
+<?php
+#$Id: mod_coords.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_coords.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'showCoords' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('showCoords ID not unique!');";}
+echo "var mod_showCoords_target = '".$e_target."';";
+?>
+
+var mod_showCoords_win = null;
+var mod_showCoords_elName = "showCoords";
+var mod_showCoords_frameName = "";
+var mod_showCoords_img_on = new Image(); mod_showCoords_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_showCoords_img_off = new Image(); mod_showCoords_img_off.src = "<?php echo $e_src; ?>";
+var mod_showCoords_img_over = new Image(); mod_showCoords_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_mod_showCoords(ind){
+ mb_button[ind] = document.getElementById(mod_showCoords_elName);
+ mb_button[ind].img_over = mod_showCoords_img_over.src;
+ mb_button[ind].img_on = mod_showCoords_img_on.src;
+ mb_button[ind].img_off = mod_showCoords_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_showCoords_elName;
+ mb_button[ind].fName = mod_showCoords_frameName;
+ mb_button[ind].go = new Function ("mod_showCoords_run()");
+ mb_button[ind].stop = new Function ("mod_showCoords_disable()");
+}
+function mod_showCoords_run(){
+ window.frames[mod_showCoords_target].document.onmousemove = mod_showCoords_display;
+ window.frames[mod_showCoords_target].document.onclick = mod_showCoords_click;
+}
+function mod_showCoords_disable(){
+ window.frames[mod_showCoords_target].document.onclick = null;
+ window.frames[mod_showCoords_target].document.onmousemove = null;
+ window.status = "";
+}
+function mod_showCoords_click(e){
+ mod_showCoords_win = window.open("","","width=150, height=100");
+ mod_showCoords_win.document.open("text/html");
+ if(ie){
+ clickX = window.frames[mod_showCoords_target].event.clientX;
+ clickY = window.frames[mod_showCoords_target].event.clientY;
+
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ var pos = makeClickPos2RealWorldPos(mod_showCoords_target, clickX, clickY);
+ mod_showCoords_win.document.write((Math.round(pos[0]*100)/100) + " / " + (Math.round(pos[1]*100)/100));
+ mod_showCoords_win.document.close();
+ mod_showCoords_win.focus();
+}
+function mod_showCoords_display(e){
+ if(ie){
+ clickX = window.frames[mod_showCoords_target].event.clientX;
+ clickY = window.frames[mod_showCoords_target].event.clientY;
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ var pos = makeClickPos2RealWorldPos(mod_showCoords_target, clickX, clickY);
+ window.status = pos[0] + " / " + pos[1];
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_coords_div.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_coords_div.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_coords_div.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,102 @@
+<?php
+#$Id: mod_coords_div.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_coords_div.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'showCoords_div' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('showCoords_div ID not unique!');";}
+echo "var mod_showCoords_div_target = '".$e_target."';";
+?>
+
+var mod_showCoords_div_win = null;
+var mod_showCoords_div_elName = "showCoords_div";
+var mod_showCoords_div_frameName = "";
+var mod_showCoords_div_img_on = new Image(); mod_showCoords_div_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_showCoords_div_img_off = new Image(); mod_showCoords_div_img_off.src = "<?php echo $e_src; ?>";
+var mod_showCoords_div_img_over = new Image(); mod_showCoords_div_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+var mod_showCoords_div_fix = "";
+
+function init_mod_showCoords_div(ind){
+ mb_button[ind] = document.getElementById(mod_showCoords_div_elName);
+ mb_button[ind].img_over = mod_showCoords_div_img_over.src;
+ mb_button[ind].img_on = mod_showCoords_div_img_on.src;
+ mb_button[ind].img_off = mod_showCoords_div_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_showCoords_div_elName;
+ mb_button[ind].fName = mod_showCoords_div_frameName;
+ mb_button[ind].go = new Function ("mod_showCoords_div_run()");
+ mb_button[ind].stop = new Function ("mod_showCoords_div_disable()");
+}
+function mod_showCoords_div_run(){
+ window.frames[mod_showCoords_div_target].document.onmousemove = mod_showCoords_div_display;
+ window.frames[mod_showCoords_div_target].document.onclick = mod_showCoords_div_click;
+}
+function mod_showCoords_div_disable(){
+ window.frames[mod_showCoords_div_target].document.onclick = null;
+ window.frames[mod_showCoords_div_target].document.onmousemove = null;
+ if(document.getElementById("dependentDiv")){
+ writeTag("","dependentDiv","");
+ }
+}
+function mod_showCoords_div_click(e){
+ if(ie){
+ clickX = window.frames[mod_showCoords_div_target].event.clientX;
+ clickY = window.frames[mod_showCoords_div_target].event.clientY;
+
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ var pos = makeClickPos2RealWorldPos(mod_showCoords_div_target, clickX, clickY);
+ mod_showCoords_div_fix = "Selection: " + pos[0] + " / " + pos[1];
+ mod_showCoord_write(pos[0],pos[1]);
+}
+function mod_showCoords_div_display(e){
+ if(ie){
+ clickX = window.frames[mod_showCoords_div_target].event.clientX;
+ clickY = window.frames[mod_showCoords_div_target].event.clientY;
+
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ var pos = makeClickPos2RealWorldPos(mod_showCoords_div_target, clickX, clickY);
+ mod_showCoord_write(pos[0],pos[1]);
+}
+function mod_showCoord_write(x,y){
+ if(document.getElementById("dependentDiv")){
+ var str = x + " / " + y;
+ if(mod_showCoords_div_fix != ""){
+ str += "<div>" + mod_showCoords_div_fix + "</div>";
+ }
+ writeTag("","dependentDiv", str);
+ }
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_copyright.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_copyright.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_copyright.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,62 @@
+<?php
+#$Id: mod_copyright.php,v 1.11 2006/01/13 13:28:49 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_copyright.php,v 1.11 2006/01/13 13:28:49 astrid_emde Exp $
+# 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("../../conf/mapbender.conf");
+$e_id_css = 'copyright';
+$gui_id = $_REQUEST["gui_id"];
+include '../include/dyn_js.php';
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'copyright' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('copyright: ID not unique!');";}
+echo "var mod_copyright_target = '".$e_target."';";
+?>
+try{
+ if (mod_copyright_text){}
+}
+catch(e){
+ mod_copyright_text = "mapbender.org"
+}
+
+var mod_copyright_left = 5;
+var mod_copyright_bottom = 20;
+
+var mod_copyright_color1 = "white";
+var mod_copyright_color2 = "black";
+var mod_copyright_font = "Arial, Helvetica, sans-serif";
+var mod_copyright_fontsize = "9px";
+
+mb_registerSubFunctions("mod_copyright()");
+function mod_copyright(){
+ var ind = getMapObjIndexByName(mod_copyright_target);
+ var str_c = "<div>";
+ str_c += "<img src='../img/transparent.gif' width ='"+mb_mapObj[ind].width+"' height='"+mb_mapObj[ind].height+"'>";
+ str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color1+";position:absolute;top:"+(mb_mapObj[ind].height - (mod_copyright_bottom-1))+"px;left:"+mod_copyright_left+"px'>"+mod_copyright_text+"</div>";
+ str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color1+";position:absolute;top:"+(mb_mapObj[ind].height - mod_copyright_bottom)+"px;left:"+mod_copyright_left+"px'>"+mod_copyright_text+"</div>";
+ str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color2+";position:absolute;top:"+(mb_mapObj[ind].height - mod_copyright_bottom)+"px;left:"+(mod_copyright_left+1)+"px'>"+mod_copyright_text+"</div>";
+ str_c += "</div>";
+ writeTag(mod_copyright_target,"copyright",str_c);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_dependentDiv.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_dependentDiv.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_dependentDiv.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,46 @@
+<?php
+#$Id: mod_dependentDiv.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_dependentDiv.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'dependentDiv' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target =$row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('dependentDiv: ID not unique!');";}
+echo "var mod_dependentDiv_target = '".$e_target."';";
+?>
+mod_dependentDiv_offsetLeft = 10;
+mod_dependentDiv_offsetTop = 10;
+
+mb_registerSubFunctions("mod_dependentDiv()");
+function mod_dependentDiv(){
+ var obj = document.getElementById(mod_dependentDiv_target).style;
+ var thisObj = document.getElementById('dependentDiv').style;
+ thisObj.left = parseInt(obj.left) - mod_dependentDiv_offsetLeft;
+ thisObj.top = parseInt(obj.top) + parseInt(obj.height) + mod_dependentDiv_offsetTop;
+ thisObj.width = parseInt(obj.width) + (2*mod_dependentDiv_offsetTop);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_dependentIframe.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_dependentIframe.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_dependentIframe.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,45 @@
+<?php
+#$Id: mod_dependentIframe.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_dependentIframe.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'dependentIframe' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('dependentIframe: ID not unique!');";}
+echo "var mod_dependentIframe_target = '".$e_target."';";
+?>
+mod_dependentIframe_offsetLeft = 10;
+mod_dependentIframe_offsetTop = 10;
+
+parent.mb_registerSubFunctions("mod_dependentIframe()");
+
+function mod_dependentIframe(){
+ var obj = document.getElementById(mod_dependentIframe_target).style;
+ var thisObj = document.getElementById('dependentIframe').style;
+ thisObj.left = parseInt(obj.left) + parseInt(obj.width) + mod_dependentIframe_offsetLeft;
+ thisObj.top = parseInt(obj.top) - mod_dependentIframe_offsetTop;
+ thisObj.height = parseInt(obj.height) + (2*mod_dependentIframe_offsetTop);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_digitize_js.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_digitize_js.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_digitize_js.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,59 @@
+<?php
+#$Id: mod_digitize_js.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_digitize_js.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'digitize' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = explode(",",$row["e_target"]);
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('digitize_button: ID not unique!');";}
+echo "var mod_digitize_target = '".$e_target[0]."';";
+echo "var mod_digitize_frame = '".$e_target[1]."';";?>
+
+var mod_digitize_elName = "digitize";
+var mod_digitize_frameName = "";
+var mod_digitize_img_on = new Image(); mod_digitize_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_digitize_img_off = new Image(); mod_digitize_img_off.src = "<?php echo $e_src; ?>";
+var mod_digitize_img_over = new Image(); mod_digitize_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+var mod_digitize_status = 0;
+
+function init_mod_digitize(ind){
+ if(mod_digitize_status == 0){
+ document.getElementById("digitize_frame").src = "../php/mod_digitize.php?target=" + mod_digitize_frame;
+ mod_digitize_status = 1;
+ }
+ mb_button[ind] = document.getElementById("digitize");
+ mb_button[ind].img_over = mod_digitize_img_over.src;
+ mb_button[ind].img_on = mod_digitize_img_on.src;
+ mb_button[ind].img_off = mod_digitize_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_digitize_elName;
+ mb_button[ind].fName = mod_digitize_frameName;
+ mb_button[ind].go = new Function ("window.frames[mod_digitize_target].mod_digitize_go()");
+ mb_button[ind].stop = new Function ("window.frames[mod_digitize_target].mod_digitize_disable()");
+ mb_registerSubFunctions("window.frames[mod_digitize_target].drawDashedLine()");
+ mb_registerPanSubElement("digitize");
+}
Added: trunk/mapbender/http/javascripts/mod_digitize_tab.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_digitize_tab.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,1643 @@
+<?php
+#$Id: mod_digitize_tab.php,v 1.39 2006/04/07 15:48:13 c_baudson Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_digitize_tab.php,v 1.39 2006/04/07 15:48:13 c_baudson Exp $
+# 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.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+ <html>
+ <head>
+ <meta http-equiv="cache-control" content="no-cache">
+ <meta http-equiv="pragma" content="no-cache">
+ <meta http-equiv="expires" content="0">
+ <?php
+ echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+ ?>
+ <title>Digitize</title>
+ <?php
+ include '../include/dyn_css.php';
+
+
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db(DB,$con);
+ $sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'digitize' AND fkey_gui_id = '".$gui_id."'";
+ $res = db_query($sql);
+ $cnt = 0;
+ while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = explode(",",$row["e_target"]);
+ $cnt++;
+ }
+ if($cnt > 1){ echo "alert('digitize_button: ID not unique!');";}
+# echo $e_target[0] . "<br>";
+# echo $e_target[1];
+ echo "<script language='JavaScript'>";
+ echo "var mod_digitize_target = '".$e_target[0]."';";
+ echo "var mod_digitize_frame = '".$e_target[1]."';";
+
+?>
+
+// var mod_digitize_status = 0;
+
+ //public
+
+ var mod_digitize_color1 = "white";
+ var mod_digitize_color2 = "black";
+ var mod_digitize_font = "Arial, Helvetica, sans-serif";
+ var mod_digitize_fontsize = "9px";
+ var mod_digitize_basepoint = "#8a2be2";
+ var mod_digitize_linepoint = "#ff00ff";
+ var mod_digitize_bg = "";
+
+ var mod_digitize_elName = "digitize";
+ var mod_digitize_frameName = "";
+
+ var wfsWindow;
+
+
+ var snappingCoordinates = new Array();
+ var snappingTolerance = 12;
+ var snappedMember = -1;
+ var snappedGeometry = -1;
+ var snappedPoint = -1;
+ var snapped = false;
+
+ // canvas contains circles around snapping target
+ var canvas = new Array();
+
+ var wfs_conf = new Array();
+
+ var D = new Array();
+
+ var activeButton = null; // contains id of active button
+ var isOn = true;
+ var mod_digitize_width;
+ var mod_digitize_height;
+ var mod_digitize_Dist = new Array();
+ var mod_digitize_TotalDist = new Array();
+ var mod_digitizeSubFunctions = new Array();
+ var mod_digitizeEvent = false;
+
+ //currently selected basepoint
+ var basepointObject = false;
+
+ // stores the number of geometries in the geometry list
+ var numberOfGeometries = 0;
+
+ //indices of the geometry associated with a certain basepoint
+ var basepointMemberIndex = false;
+ var basepointGeometryIndex = false;
+ var basepointPointIndex = false;
+
+ //when a basepoint is being dragged, the coordinates are stored
+ var basepointDragActive = false;
+ var basepointDragStartX = false;
+ var basepointDragStartY = false;
+ var basepointDragEndX = false;
+ var basepointDragEndY = false;
+
+ //indices of the geometry that is currently built
+ var currentMemberIndex = -1;
+ var currentGeometryIndex = -1;
+
+
+
+ var canvas = new Array();
+
+
+
+ // ------------------------------------------------------------------------------------------------------------------------
+ // --- registered functions (begin) ---------------------------------------------------------------------------------------
+
+ //
+ // this method is called onload. these functions will be invoked whenever they are triggered by the mapObj
+ //
+ function registerFunctions(){
+ parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].setStyleForTargetFrame()");
+ parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].checkTag()");
+ parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].drawDashedLine()");
+ }
+
+ //
+ // checks if a div tag with id "digitize" exists in frame mod_digitize_target.
+ // if yes, these element's attributes are set and itself is returned
+ // if not, it is created (with attributes) and returned
+ // if an element with id "digitize" exists and it is not a div tag, false is returned
+ //
+ function checkTag () {
+ var attributes = new Array();
+ attributes[0] = new Array();
+ attributes[0][0] = "style";
+ attributes[0][1] = "position:absolute; top:0px; left:0px; z-index:26; font-size:10px";
+ node = parent.mb_checkTag(mod_digitize_target, "div", "digitize", "body", attributes);
+ if (node == false) {
+ alert("Fatal error: Element id 'digitize' is already taken!");
+ }
+ }
+
+ //
+ // this adds the stylesheet to the map frame
+ //
+ function setStyleForTargetFrame() {
+ var cssLink = parent.window.frames[mod_digitize_target].document.createElement("link");
+ cssLink.setAttribute("href", cssUrl);
+ cssLink.setAttribute("type", "text/css");
+ cssLink.setAttribute("rel", "stylesheet");
+ var cssTmp = parent.window.frames[mod_digitize_target].document.getElementsByTagName("head")[0];
+ cssTmp.appendChild(cssLink);
+ }
+
+ // --- registered functions (end) -----------------------------------------------------------------------------------------
+ // ------------------------------------------------------------------------------------------------------------------------
+
+/*
+ function const_D(id,type){
+ this.id = id;
+ this.type = type;
+ this.x = new Array();
+ this.y = new Array();
+ this.label = "";
+
+ var ind = parent.getMapObjIndexByName(mod_digitize_target);
+ this.epsg = parent.mb_mapObj[ind].epsg;
+ this.units = "";
+ this.dist = new Array();
+ this.totaldist = new Array();
+ this.complete = false;
+ }
+*/
+
+
+ // ------------------------------------------------------------------------------------------------------------------------
+ // --- preload images (begin) ---------------------------------------------------------------------------------------------
+
+ // up
+ var digitize_point_up = new Image(); digitize_point_up.src = "../img/button_digitize/text_up.png";
+ var digitize_line_up = new Image(); digitize_line_up.src = "../img/button_digitize/line_up.png";
+ var digitize_poly_up = new Image(); digitize_poly_up.src = "../img/button_digitize/poly_up.png";
+ var digitize_move_up = new Image(); digitize_move_up.src = "../img/button_digitize/move_up.png";
+ var digitize_addNode_up = new Image(); digitize_addNode_up.src = "../img/button_digitize/newNode_up.png";
+ var digitize_delNode_up = new Image(); digitize_delNode_up.src = "../img/button_digitize/delNode_up.png";
+ // down
+ var digitize_point_down = new Image(); digitize_point_down.src = "../img/button_digitize/text_down.png";
+ var digitize_line_down = new Image(); digitize_line_down.src = "../img/button_digitize/line_down.png";
+ var digitize_poly_down = new Image(); digitize_poly_down.src = "../img/button_digitize/poly_down.png";
+ var digitize_move_down = new Image(); digitize_move_down.src = "../img/button_digitize/move_down.png";
+ var digitize_addNode_down = new Image(); digitize_addNode_down.src = "../img/button_digitize/newNode_down.png";
+ var digitize_delNode_down = new Image(); digitize_delNode_down.src = "../img/button_digitize/delNode_down.png";
+
+ // --- preload images (end) -----------------------------------------------------------------------------------------------
+ // ------------------------------------------------------------------------------------------------------------------------
+
+
+ // ------------------------------------------------------------------------------------------------------------------------
+ // --- button handling (begin) --------------------------------------------------------------------------------------------
+
+ function register_button(obj) {
+ parent.mb_regButton_frame("init_digitize_button", obj, mod_digitize_elName);
+ }
+
+ function init_digitize_button(obj, ind){
+ parent.mb_button[ind] = obj;
+ parent.mb_button[ind].img_over = obj.src;
+
+ if (obj.id == "dragBasePoint") {
+ parent.mb_button[ind].img_on = digitize_move_down.src;
+ parent.mb_button[ind].img_off = digitize_move_up.src;
+ }
+ else if (obj.id == "setBasePoint"){
+ parent.mb_button[ind].img_on = digitize_addNode_down.src;
+ parent.mb_button[ind].img_off = digitize_addNode_up.src;
+ }
+ else if (obj.id == "delBasePoint"){
+ parent.mb_button[ind].img_on = digitize_delNode_down.src;
+ parent.mb_button[ind].img_off = digitize_delNode_up.src;
+ }
+ else if (obj.id == "Point"){
+ parent.mb_button[ind].img_on = digitize_point_down.src;
+ parent.mb_button[ind].img_off = digitize_point_up.src;
+ }
+ else if (obj.id == "Line"){
+ parent.mb_button[ind].img_on = digitize_line_down.src;
+ parent.mb_button[ind].img_off = digitize_line_up.src;
+ }
+ else if (obj.id == "Polygon"){
+ parent.mb_button[ind].img_on = digitize_poly_down.src;
+ parent.mb_button[ind].img_off = digitize_poly_up.src;
+ }
+ parent.mb_button[ind].status = 0;
+ parent.mb_button[ind].elName = obj.id;
+ parent.mb_button[ind].fName = "";
+ parent.mb_button[ind].go = new Function ("digitize_click(parent.mb_button["+ind+"])");
+ parent.mb_button[ind].stop = new Function ("digitize_disable(parent.mb_button["+ind+"])");
+ }
+
+ function digitize_click(obj) {
+ if (obj.id == "dragBasePoint") {
+ activeButton = obj.id;
+ setEvent(obj);
+ }
+ else if (obj.id == "setBasePoint"){
+ activeButton = obj.id;
+ setEvent(obj);
+ }
+ else if (obj.id == "delBasePoint"){
+ activeButton = obj.id;
+ setEvent(obj);
+ }
+ else if (obj.id == "Point"){
+ activeButton = obj.id;
+ obj.title = "Finish editing";
+ currentMemberIndex = -1;
+ registerGeometry(obj);
+ storeSnappingCoordinates();
+ var el = parent.frames[mod_digitize_target].document;
+ el.onmousemove = mod_digitize_go;
+ }
+ else if (obj.id == "Line"){
+ activeButton = obj.id;
+ obj.title = "Finish editing";
+ currentMemberIndex = -1;
+ registerGeometry(obj);
+ storeSnappingCoordinates();
+ var el = parent.frames[mod_digitize_target].document;
+ el.onmousemove = mod_digitize_go;
+ }
+ else if (obj.id == "Polygon"){
+ activeButton = obj.id;
+ obj.title = "Finish editing";
+ currentMemberIndex = -1;
+ registerGeometry(obj);
+ storeSnappingCoordinates();
+ var el = parent.frames[mod_digitize_target].document;
+ el.onmousemove = mod_digitize_go;
+ }
+ }
+
+ function digitize_disable(obj) {
+ if (obj.id == "dragBasePoint") {
+ }
+ else if (obj.id == "setBasePoint"){
+ }
+ else if (obj.id == "delBasePoint"){
+ }
+ else if (obj.id == "Point"){
+ activeButton = null;
+ obj.title = "Add point";
+ closeGeometry(obj.id);
+ mod_digitize_timeout();
+ }
+ else if (obj.id == "Line"){
+ activeButton = null;
+ obj.title = "Add line";
+ closeGeometry(obj.id);
+ mod_digitize_timeout();
+ }
+ else if (obj.id == "Polygon"){
+ activeButton = null;
+ obj.title = "Add polygon";
+ closeGeometry(obj.id);
+ mod_digitize_timeout();
+ }
+ }
+
+ // --- button handling (end) ----------------------------------------------------------------------------------------------
+ // ------------------------------------------------------------------------------------------------------------------------
+
+
+ var dwin = null;
+
+ function mod_saveGeom() {
+ dwin = window.open("../php/mod_wfs_save.php","dwin","width=300,height=200");
+ }
+
+
+
+ // ------------------------------------------------------------------------------------------------------------------------
+ // --- snapping (begin) ----------------------------------------------------------------------------------------------
+
+ //
+ // deletes all snapping areas from the canvas
+ //
+ function cleanCanvas () {
+ var el = parent.window.frames[mod_digitize_target].document.getElementById('mod_digi_draw');
+ if (el) el.innerHTML = "";
+ }
+
+ //
+ // checks if the canvas for snapping areas is present
+ // if not, it is being generated
+ //
+ function checkCanvasTag () {
+ var isTag = (parent.window.frames[mod_digitize_target].document.getElementById('mod_digi_draw'))?1:0;
+ if(isTag == 0){
+ var draw = parent.window.frames[mod_digitize_target].document.createElement("div");
+ var tmp = parent.window.frames[mod_digitize_target].document.getElementsByTagName("body")[0].appendChild(draw);
+ tmp.setAttribute("id","mod_digi_draw");
+ tmp.setAttribute("style","position:absolute;top:0px;left:0px;width:0px;height:0px;z-index:100");
+ }
+ canvas[mod_digitize_target] = new parent.jsGraphics('mod_digi_draw', parent.window.frames[mod_digitize_target]);
+ canvas[mod_digitize_target].setStroke(3);
+ }
+
+ //
+ // draws a snapping area around a given point
+ //
+ function drawSnappingArea (centerX,centerY,radius,size) {
+ canvas[mod_digitize_target].setColor("#ff0000");
+ canvas[mod_digitize_target].drawEllipse(centerX-(size/2)*radius,centerY-(size/2)*radius,size*radius,size*radius);
+ canvas[mod_digitize_target].paint();
+ }
+
+ //
+ // stores the coordinates of points that may be used for snapping
+ // in respect to the current point (the point being moved or inserted)
+ //
+ function storeSnappingCoordinates() {
+ snappingCoordinates = new Array();
+
+ // copy coordinates of other geometries in another array
+ var im = -1;
+
+ var cnt = 0;
+ for (var i = 0; i < D.length ; i++) {
+ for (var j = 0 ; j < D[i]['geometry'].length ; j++) {
+ for (var k = 0 ; k < D[i]['geometry'][j]['x'].length ; k++) {
+ var pos = parent.makeRealWorld2mapPos(mod_digitize_target, D[i]['geometry'][j]['x'][k], D[i]['geometry'][j]['y'][k]);
+
+ // snap only if the two points have different coordinates
+ if (basepointDragActive == false || basepointDragActive == true && (D[i]['geometry'][j]['x'][k] != D[basepointMemberIndex]['geometry'][basepointGeometryIndex]['x'][basepointPointIndex] || D[i]['geometry'][j]['y'][k] != D[basepointMemberIndex]['geometry'][basepointGeometryIndex]['y'][basepointPointIndex])) {
+
+ snappingCoordinates[cnt] = new Array();
+ snappingCoordinates[cnt]['map_x'] = pos[0];
+ snappingCoordinates[cnt]['map_y'] = pos[1];
+ snappingCoordinates[cnt]['member'] = i;
+ snappingCoordinates[cnt]['geometry'] = j;
+ snappingCoordinates[cnt]['point'] = k;
+ cnt++;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+
+ //
+ // checks if a point is in snapping range
+ // if yes, the snapping area is highlighted and the snapped point is stored
+ //
+ function checkSnapped (basepointDragEndX, basepointDragEndY, defaultMouseCursor) {
+
+ var minDist = false;
+ var min_i = -1;
+ for (var i = 0 ; i < snappingCoordinates.length ; i++) {
+ var aDist = dist(basepointDragEndX, basepointDragEndY, snappingCoordinates[i]['map_x'], snappingCoordinates[i]['map_y']);
+ if (aDist < snappingTolerance) {
+ if (minDist == false || aDist < minDist) {
+ minDist = aDist;
+ snappedMember = snappingCoordinates[i]['member'];
+ snappedGeometry = snappingCoordinates[i]['geometry'];
+ snappedPoint = snappingCoordinates[i]['point'];
+ min_i = i;
+ }
+ }
+ }
+
+ if (minDist == false || minDist > snappingTolerance) {
+ snapped = false;
+ var el = parent.window.frames[mod_digitize_target].document.getElementById('mod_digi_draw');
+ if (el) el.innerHTML = "";
+ }
+ else {
+ snapped = true;
+
+ checkCanvasTag();
+ cleanCanvas();
+ drawSnappingArea(snappingCoordinates[min_i]['map_x'], snappingCoordinates[min_i]['map_y'], snappingTolerance, 3);
+ }
+
+ if (basepointObject != false) {
+ if (snapped == true) {
+ basepointObject.style.cursor = 'crosshair';
+ }
+ else {
+ basepointObject.style.cursor = defaultMouseCursor;
+ }
+
+ if (defaultMouseCursor == 'move') {
+ // replace basepoint by transparent blob
+ basepointObject.style.width = mod_digitize_width;
+ basepointObject.style.height = mod_digitize_height;
+ basepointObject.style.left = 0;
+ basepointObject.style.top = 0;
+
+ if (parent.ie) {
+ // ie cannot handle backgroundColor = 'transparent'
+ basepointObject.style.background = "url(/../img/button_digitize/trans.png)";
+ }
+ else{
+ basepointObject.style.backgroundColor = 'transparent';
+ }
+ }
+ }
+ }
+
+ // --- snapping (end) ----------------------------------------------------------------------------------------------
+ // ------------------------------------------------------------------------------------------------------------------------
+
+ function mod_digitize_go(e){
+ parent.mb_registerGML(mod_digitize_target,D);
+ parent.document.getElementById(mod_digitize_elName).style.visibility = 'visible';
+
+ // track mouse position
+ parent.mb_getMousePos(e, mod_digitize_target);
+ checkSnapped(parent.clickX, parent.clickY, 'default');
+
+ var el = parent.frames[mod_digitize_target].document;
+ el.onmousedown = mod_digitize_start;
+ //el.onmousemove = mod_digitize_run;
+
+ var ind = parent.getMapObjIndexByName(mod_digitize_target);
+ mod_digitize_width = parent.mb_mapObj[ind].width;
+ mod_digitize_height = parent.mb_mapObj[ind].height;
+ mod_digitize_epsg = parent.mb_mapObj[ind].epsg;
+ }
+
+
+ function mod_digitize_timeout(){
+// isOn = false;
+// parent.document.getElementById(mod_digitize_elName).style.visibility = 'hidden';
+ var el = parent.frames[mod_digitize_target].document;
+ el.onmousedown = null;
+ el.onmouseup = null;
+ el.onmousemove = null;
+// drawDashedLine();
+ }
+
+
+ //
+ // a new member is being generated and attached to the array D
+ //
+ function registerGeometry(type){
+
+ // a new geometry will be inserted
+ if (currentMemberIndex == -1) {
+ currentMemberIndex = D.length;
+
+ // generate a new member
+ D[currentMemberIndex] = new Array();
+ D[currentMemberIndex]['geometry'] = new Array();
+ D[currentMemberIndex]['element'] = new Array();
+ D[currentMemberIndex]['wfs_conf'] = -1;
+ D[currentMemberIndex]['geomtype'] = type.id;
+
+ // attach a new geometry
+ var geomInd = D[currentMemberIndex]['geometry'].length;
+ D[currentMemberIndex]['geometry'][geomInd] = new Array();
+ D[currentMemberIndex]['geometry'][geomInd]['x'] = new Array();
+ D[currentMemberIndex]['geometry'][geomInd]['y'] = new Array();
+ D[currentMemberIndex]['geometry'][geomInd]['complete'] = false;
+
+ currentGeometryIndex = 0;
+ }
+ // a geometry will be added to an existing geometry
+ else {
+
+ // FIXME: check if geometry types match
+
+ // attach a new geometry
+ var geomInd = D[currentMemberIndex]['geometry'].length;
+ D[currentMemberIndex]['geometry'][geomInd] = new Array();
+ D[currentMemberIndex]['geometry'][geomInd]['x'] = new Array();
+ D[currentMemberIndex]['geometry'][geomInd]['y'] = new Array();
+ D[currentMemberIndex]['geometry'][geomInd]['complete'] = false;
+
+ currentGeometryIndex = geomInd;
+ }
+ }
+
+ //
+ // adds a new basepoint to the geometry
+ //
+ function mod_digitize_start(e){
+ isOn = true;
+
+ if (currentMemberIndex != -1) {
+
+ // select the last geometry of the current member
+ var geomInd = D[currentMemberIndex]['geometry'].length - 1;
+
+ // check if a proper geometry is selected
+ if(D[currentMemberIndex]['geometry'][geomInd]['complete'] == true || (D.length == 0)){
+
+ if (activeButton != null) {
+ alert("No geometry selected!");
+ }
+ return true;
+ }
+
+ // get the mouse position and calculate real world position
+ if (snapped == true) {
+ cleanCanvas();
+
+ var realWorldPos = new Array();
+ realWorldPos[0] = D[snappedMember]['geometry'][snappedGeometry]['x'][snappedPoint];
+ realWorldPos[1] = D[snappedMember]['geometry'][snappedGeometry]['y'][snappedPoint];
+
+ }
+ else {
+ parent.mb_getMousePos(e,mod_digitize_target);
+ var realWorldPos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX,parent.clickY);
+ }
+ snapped = false;
+
+ if (D[currentMemberIndex]['geomtype'].toLowerCase() == 'polygon'
+ && D[currentMemberIndex]['geometry'][geomInd]['x'].length > 1
+ && D[currentMemberIndex]['geometry'][geomInd]['x'][0] == realWorldPos[0]
+ && D[currentMemberIndex]['geometry'][geomInd]['y'][0] == realWorldPos[1]) {
+
+ // close the polygon
+ parent.mb_disableThisButton('Polygon');
+ }
+ else {
+ // set the calculated real world position as point of the geometry
+ xInd = D[currentMemberIndex]['geometry'][geomInd]['x'].length;
+ yInd = D[currentMemberIndex]['geometry'][geomInd]['y'].length;
+ D[currentMemberIndex]['geometry'][geomInd]['x'][xInd] = realWorldPos[0];
+ D[currentMemberIndex]['geometry'][geomInd]['y'][yInd] = realWorldPos[1];
+
+ // if the current geometry is a point, attach a label to it
+ if(D[currentMemberIndex]['geomtype'].toLowerCase() == 'point'){
+ parent.mb_disableThisButton('Point');
+ }
+
+ // add first point of polygon to snapping list (if three points have been inserted).
+ if (D[currentMemberIndex]['geomtype'].toLowerCase() == 'polygon'
+ && D[currentMemberIndex]['geometry'][geomInd]['x'].length == 3) {
+ var tempInd = snappingCoordinates.length;
+ var pos = parent.makeRealWorld2mapPos(mod_digitize_target, D[currentMemberIndex]['geometry'][geomInd]['x'][0], D[currentMemberIndex]['geometry'][geomInd]['y'][0]);
+ snappingCoordinates[tempInd] = new Array();
+ snappingCoordinates[tempInd]['map_x'] = pos[0];
+ snappingCoordinates[tempInd]['map_y'] = pos[1];
+ snappingCoordinates[tempInd]['member'] = currentMemberIndex;
+ snappingCoordinates[tempInd]['geometry'] = geomInd;
+ snappingCoordinates[tempInd]['point'] = 0;
+ }
+ }
+ drawDashedLine();
+ }
+
+ return true;
+ }
+
+ //
+ // finishes a geometry by labelling it complete.
+ // if no coordinates have been added, the geometry is discarded.
+ //
+ // when a polygon is built and the polygon button is clicked again, the
+ // polygon will be closed by connecting the last to the first point.
+ // Actually, the first point is stored twice at index '0' and index 'length'
+ //
+ function closeGeometry(obj_id){
+ var i = currentMemberIndex;
+ var j = currentGeometryIndex;
+
+ if(!isOn){ return; };
+
+ D[i]['geometry'][j]['complete'] = true;
+
+ var tmpLength = D[i]['geometry'][j]['x'].length;
+
+ // if no geometries have been inserted, delete the geometry or member
+ if (tmpLength == 0) {
+ if (j == 0) {
+ D.length--;
+ }
+ else {
+ D[i]['geometry'].length--;
+ }
+ }
+ if (obj_id == "Polygon") {
+ if (tmpLength > 0) {
+ D[i]['geometry'][j]['x'][tmpLength] = D[i]['geometry'][j]['x'][0];
+ D[i]['geometry'][j]['y'][tmpLength] = D[i]['geometry'][j]['y'][0];
+ }
+ }
+ drawDashedLine();
+ }
+
+ //
+ // displays *all* digitized geometries
+ //
+ function drawDashedLine(){
+ var smP = "";
+ smP += "<div class='t_img'>";
+ smP += "<img src='"+parent.mb_trans.src+"' width='"+mod_digitize_width+"' height='0'></div>";
+ smP += "<div class='t_img'>";
+ smP += "<img src='"+parent.mb_trans.src+"' width='0' height='"+mod_digitize_height+"'></div>";
+
+ // *all* members will be painted
+ for(var i=0; i<D.length; i++){
+
+ // paint all geometries of member i
+ for(var j=0; j<D[i]['geometry'].length; j++){
+ //
+ // paint the basepoints
+ //
+ for(var k=0; k<D[i]['geometry'][j]['x'].length; k++){
+ // calculate screen position from real world coordinates
+ var pos = parent.makeRealWorld2mapPos(mod_digitize_target,D[i]['geometry'][j]['x'][k],D[i]['geometry'][j]['y'][k]);
+
+ // if this geometry is a point
+ if(D[i]['geomtype'].toLowerCase() == "point"){
+ // smP += "<div class='label' style='top:"+(pos[1]-6)+"px;left:"+(pos[0])+"px;z-index:50;'>"+D[i]['label']+"</div>";
+ }
+
+ smP += "<div class='bp' style='top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;z-index:50;'";
+ if(j==0 && D[i]['geomtype'].toLowerCase() == 'polygon' && D[i]['geometry'][j]['complete'] == false){
+ smP += " title='to close polygon, release the polygon button on the left' ";
+ }
+ if(isOn){
+ smP += " onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].handleBasepoint(this,"+i+","+j+","+k+")' ;";
+ }
+ smP += "></div>";
+ }
+ //
+ // paint the lines between basepoints
+ //
+ for(var k = 1; k < D[i]['geometry'][j]['x'].length; k++){
+
+ var pos0 = parent.makeRealWorld2mapPos(mod_digitize_target, D[i]['geometry'][j]['x'][k] , D[i]['geometry'][j]['y'][k]);
+ var pos1 = parent.makeRealWorld2mapPos(mod_digitize_target, D[i]['geometry'][j]['x'][k-1], D[i]['geometry'][j]['y'][k-1]);
+
+ smP += evaluateDashes(pos1[0], pos1[1], pos0[0], pos0[1], i, j, k);
+ }
+ }
+ }
+ parent.writeTag(mod_digitize_target,"digitize",smP);
+ updateListOfGeometries();
+ }
+
+
+ //
+ // this function calculates the line points between start and end
+ //
+ function evaluateDashes(startX, startY, endX, endY, memberIndex, geomIndex, pointIndex){
+ var str_dashedLine = "";
+ var deltaX = endX - startX;
+ var deltaY = endY - startY;
+
+ // s = distance between two linepoints
+ var s = 10;
+ var vecLength = dist(startX, startY, endX, endY);
+ var n = Math.round(vecLength/s);
+ var stepX = deltaX/n;
+ var stepY = deltaY/n;
+ for(var i=1; i<n; i++){
+ var x = Math.round(startX + i * stepX) - 2;
+ var y = Math.round(startY + i * stepY) - 2;
+ if(x >= 0 && x <= mod_digitize_width && y >= 0 && y <= mod_digitize_height){
+ str_dashedLine += "<div class='lp' style='top:"+y+"px;left:"+x+"px;z-index:50;' ";
+ if(isOn){
+ str_dashedLine += "onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].convertLinepointToBasepoint(this,"+memberIndex+","+geomIndex+","+pointIndex+")'>";
+ }
+ str_dashedLine += "</div>";
+ }
+ }
+ return str_dashedLine;
+ }
+
+
+ // ------------------------------------------------------------------------------------------------------------------------
+ // --- basepoint handling (begin) -----------------------------------------------------------------------------------------
+
+ //
+ // this function checks what to do with a basepoint that is currently under
+ // the mouse pointer.
+ // Depending on what action is intended, other methods are invoked.
+ //
+
+ function handleBasepoint(Obj,memberIndex,geometryIndex,pointIndex){
+ if(!isOn){ return false; };
+
+ // set the global variables that will be used in deleteBasepoint etc.
+ basepointObject = Obj;
+ basepointMemberIndex = memberIndex;
+ basepointGeometryIndex = geometryIndex;
+ basepointPointIndex = pointIndex;
+
+ if(mod_digitizeEvent == "dragBasePoint" && activeButton == 'dragBasePoint'){
+ mod_digitize_timeout();
+ basepointObject.style.cursor = 'move';
+ basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].selectBasepoint;
+ }
+/*
+ if(mod_digitizeEvent == false && D[memberIndex]['geomtype'].toLowerCase() == 'polygon' && D[memberIndex]['geometry'][geometryIndex].complete == false){
+ basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].closeGeometry("Polygon");
+ }
+*/
+ if(mod_digitizeEvent == "delBasePoint" && activeButton == 'delBasePoint'){
+ mod_digitize_timeout();
+ basepointObject.style.cursor = 'crosshair';
+ basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].deleteBasepoint;
+ }
+ }
+
+ function deleteBasepoint(e){
+
+ var i = basepointMemberIndex;
+ var j = basepointGeometryIndex;
+ var k = basepointPointIndex;
+
+ var xCoord = D[i]['geometry'][j]['x'][k];
+ var yCoord = D[i]['geometry'][j]['y'][k];
+
+ var deleted = false;
+
+ while (deleted == false) {
+ var continueFor = true;
+ deleted = true;
+
+ //find points of other geometries with the same coordinates and delete them as well
+ for (var l = 0 ; l < D.length && continueFor == true; l ++) {
+ for (var m = 0; m < D[l]['geometry'].length && continueFor == true; m++) {
+ for (var n = 0; n < D[l]['geometry'][m]['x'].length && continueFor == true ; n++) {
+ if (D[l]['geometry'][m]['x'][n] == xCoord && D[l]['geometry'][m]['y'][n] == yCoord) {
+ deletePoint(l,m,n);
+ continueFor = false;
+ deleted = false;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //
+ // deletes the point at the i-th member, j-th geometry, k-th point
+ //
+ function deletePoint (i,j,k) {
+ //
+ // the last point is being deleted...
+ //
+ if ( (k == 0 || (D[i]['geometry'][j]['x'].length - k) == 1) && D[i]['geomtype'].toLowerCase() == 'polygon') {
+ // if the last basepoint of a polygon is being deleted,
+ // the first basepoint is now set to be the last but one as well,
+ // in order to close the polygon
+
+ // Shorten the array by one
+ D[i]['geometry'][j]['x'].length = D[i]['geometry'][j]['x'].length - 1;
+ D[i]['geometry'][j]['y'].length = D[i]['geometry'][j]['y'].length - 1;
+
+ // if only one point is left (which has been stored twice), remove it as well
+ if (D[i]['geometry'][j]['x'].length == 1) {
+ D[i]['geometry'][j]['x'].length = 0;
+ D[i]['geometry'][j]['y'].length = 0;
+ }
+ // point that will be deleted is not the only point of the geometry
+ else {
+
+ // place a copy of the last point at index 0
+ var tmpIndex = D[i]['geometry'][j]['x'].length - 1;
+ D[i]['geometry'][j]['x'][0] = D[i]['geometry'][j]['x'][tmpIndex];
+ D[i]['geometry'][j]['y'][0] = D[i]['geometry'][j]['y'][tmpIndex];
+ }
+ }
+ //
+ // a point that is *not* the last point of a geometry is being deleted
+ //
+ else {
+
+ // move basepoints behind deleted basepoints up by one...
+ for(var z= k; z<D[i]['geometry'][j]['x'].length-1; z++){
+ D[i]['geometry'][j]['x'][z] = D[i]['geometry'][j]['x'][z+1];
+ D[i]['geometry'][j]['y'][z] = D[i]['geometry'][j]['y'][z+1];
+ }
+ // ...and adjust length of the array
+ D[i]['geometry'][j]['x'].length = D[i]['geometry'][j]['x'].length - 1;
+ D[i]['geometry'][j]['y'].length = D[i]['geometry'][j]['y'].length - 1;
+ }
+
+ //
+ // if all basepoints of this geometry have been deleted...
+ //
+
+ if (D[i]['geometry'][j]['x'].length == 0) {
+ deleteGeometry(i, j);
+ }
+ else {
+ drawDashedLine();
+ //resetButtonsIfNoMembersLeft();
+ }
+ }
+
+ //
+ // deletes the geometry at index 'indexGeometry' of member at index 'indexmember' of D
+ //
+ function deleteGeometry (indexMember, indexGeometry) {
+ var i = indexMember;
+ var j = indexGeometry;
+
+ //
+ // check whether the deleted geometry is the only geometry of the member...
+ //
+ if (D[i]['geometry'].length == 1) {
+ deleteMember(i);
+ }
+ //
+ // ...if not, move other geometries one spot up
+ //
+ else {
+ var tmpLength = D[i]['geometry'].length - 1;
+ for (var z = j; z < tmpLength ; z ++) {
+ D[i]['geometry'][z] = D[i]['geometry'][z+1];
+ D[i]['element'][z] = D[i]['element'][z+1];
+ }
+ D[i]['geometry'].length -= 1;
+
+ drawDashedLine();
+ resetButtonsIfNoMembersLeft();
+ }
+ }
+
+ //
+ // deletes the member of D at index 'index''
+ //
+ function deleteMember (index) {
+ // delete geometry itself...
+ for(var z = index ; z < D.length - 1; z++){
+ D[z] = D[z+1];
+ }
+ // ... and adjust length of geometry array
+ D.length -= 1;
+
+ drawDashedLine();
+ }
+
+
+ //
+ // this function is invoked when the mouse is over a linepoint.
+ // When the mouse is clicked, the method insert basepoint is
+ // called.
+ //
+ function convertLinepointToBasepoint(obj, memberIndex, geomIndex, pointIndex){
+ if(!isOn){ return false; };
+
+ if(mod_digitizeEvent == "setBasePoint" && activeButton == 'setBasePoint'){
+ mod_digitize_timeout();
+ obj.style.cursor = 'crosshair';
+ obj.onclick = insertBasepoint;
+
+ basepointObject = obj;
+ basepointMemberIndex = memberIndex;
+ basepointGeometryIndex = geomIndex;
+ basepointPointIndex = pointIndex;
+ }
+ }
+
+ //
+ // this function inserts a new basepoint into the geometry.
+ // the basepoint is a former linepoint.
+ //
+ function insertBasepoint(e){
+ var i = basepointMemberIndex;
+ var j = basepointGeometryIndex;
+ var k = basepointPointIndex;
+
+ parent.mb_getMousePos(e, mod_digitize_target);
+ var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX, parent.clickY);
+
+ for(var z = D[i]['geometry'][j]['x'].length; z > k; z--){
+ D[i]['geometry'][j]['x'][z] = D[i]['geometry'][j]['x'][z-1];
+ D[i]['geometry'][j]['y'][z] = D[i]['geometry'][j]['y'][z-1];
+ }
+
+ D[i]['geometry'][j]['x'][k] = pos[0];
+ D[i]['geometry'][j]['y'][k] = pos[1];
+
+ drawDashedLine();
+ }
+
+ //
+ // when a basepoint move is intended, this function is invoked when the mouse button
+ // is pressed. It stores the start coordinates in a global variable and sets
+ // the global basepointDragActive to true, so other modules know that a basepoint is
+ // currently being dragged
+ //
+
+ function selectBasepoint(e){
+ if(basepointDragActive == false && mod_digitizeEvent == "dragBasePoint"){
+ basepointDragActive = true;
+ storeSnappingCoordinates();
+ basepointObject.onmouseup = releaseBasepoint;
+ basepointObject.onmousemove = dragBasepoint;
+ }
+ }
+
+ function dist (startX, startY, endX, endY) {
+ var deltaX = endX - startX;
+ var deltaY = endY - startY;
+
+ return Math.sqrt(Math.pow(deltaY,2) + Math.pow(deltaX,2)) ;
+ }
+
+
+ //
+ // when a basepoint is being dragged and the mouse button is down,
+ // this function will track the mouse position.
+ // instead of the basepoint, a transparent object the size of the
+ // mapframe is being displayed
+ //
+ function dragBasepoint(e){
+ if(basepointDragActive){
+ parent.mb_getMousePos(e, mod_digitize_target);
+ checkSnapped(parent.clickX, parent.clickY, 'move');
+ }
+ }
+
+
+ //
+ // checks if a geometry has identical neighbour points
+ //
+ function removeDuplicates(i, j) {
+ var length1 = D[i]['geometry'][j]['x'].length;
+ var continueFor = true;
+ for (var k = 2; k < length1 && continueFor == true ; k++) {
+ if (D[i]['geometry'][j]['x'][k] == D[i]['geometry'][j]['x'][k-1] && D[i]['geometry'][j]['y'][k] == D[i]['geometry'][j]['y'][k-1] ) {
+ deletePoint(i,j,k-1);
+ continueFor = false;
+ }
+ }
+ }
+
+
+ //
+ // when a basepoint is being dragged and the mouse button is released,
+ // this function is invoked and the geometry will be updated
+ //
+ function releaseBasepoint(e){
+
+ var i = basepointMemberIndex;
+ var j = basepointGeometryIndex;
+ var k = basepointPointIndex;
+
+ basepointDragActive = false;
+
+ parent.mb_getMousePos(e, mod_digitize_target);
+ basepointDragEndX = parent.clickX;
+ basepointDragEndY = parent.clickY;
+ basepointObject.onmousedown = null;
+ var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target, basepointDragEndX, basepointDragEndY);
+
+ if (snapped == true) {
+ cleanCanvas();
+
+ pos[0] = D[snappedMember]['geometry'][snappedGeometry]['x'][snappedPoint];
+ pos[1] = D[snappedMember]['geometry'][snappedGeometry]['y'][snappedPoint];
+ }
+
+ if ( (k == D[i]['geometry'][j]['x'].length - 1 || k == 0) && D[i]['geometry'][j]['complete'] == true && D[i]['geomtype'].toLowerCase() == 'polygon') {
+ D[i]['geometry'][j]['x'][0] = pos[0];
+ D[i]['geometry'][j]['y'][0] = pos[1];
+ }
+
+ // check if there are points in other geometries with the same coordinates
+ for (var l = 0; l < D.length ; l++) {
+ for (var m = 0 ; m < D[l]['geometry'].length ; m++) {
+ for (n = 0 ; n < D[l]['geometry'][m]['x'].length ; n++) {
+ if ((l != i || m != j) && D[i]['geometry'][j]['x'][k] == D[l]['geometry'][m]['x'][n] && D[i]['geometry'][j]['y'][k] == D[l]['geometry'][m]['y'][n]) {
+ D[l]['geometry'][m]['x'][n] = pos[0];
+ D[l]['geometry'][m]['y'][n] = pos[1];
+ if (snapped == true) {
+ removeDuplicates(l,m);
+ }
+ }
+ }
+ }
+ }
+
+ D[i]['geometry'][j]['x'][k] = pos[0];
+ D[i]['geometry'][j]['y'][k] = pos[1];
+ if (snapped == true) {
+ removeDuplicates(i,j);
+ }
+
+ snapped = false;
+ drawDashedLine();
+ }
+
+ // --- basepoint handling (end) -----------------------------------------------------------------------------------------
+ // ------------------------------------------------------------------------------------------------------------------------
+
+
+ //
+ // clones a given object
+ //
+
+ function cloneObject (someArray) {
+ var a = someArray;
+ var z = new Array();
+
+ for (attr in a) {
+ var b = a[attr];
+
+ if (typeof(b) == "object") {
+ z[attr] = cloneObject(b);
+ }
+ else {
+ z[attr] = b;
+ }
+ }
+ return z;
+ }
+
+
+ //
+ // clones a given geometry array
+ //
+
+ function cloneGeometryArray(originalArray) {
+ z = cloneObject(originalArray);
+
+ // add the attribute 'complete' for every geometry
+ for (var i = 0 ; i < originalArray['geometry'].length ; i ++) {
+ z['geometry'][i]['complete'] = true;
+ }
+ return z;
+ }
+
+
+ //
+ // a given geometry object is appended to the member array
+ //
+ function addMember(newMember) {
+ var index = D.length;
+ D[index] = new Array();
+
+ D[index] = cloneGeometryArray(newMember);
+
+ mod_digitize_go();
+ drawDashedLine();
+ }
+
+
+ function setEvent(obj){
+ mod_digitizeEvent = obj.id;
+ }
+
+ function delEvent(){
+ mod_digitizeEvent = false;
+ mod_digitize_go();
+ }
+
+ //
+ // displays an object
+ // (may not be essential, but useful for debugging)
+ //
+ function displayObject (someArray) {
+ var a = someArray;
+ var str = "";
+
+ for (attr in a) {
+ b = a[attr];
+
+ if (typeof(b) == "object") {
+ str += "<br>" + attr + "<br>";
+ str += displayObject(b);
+ }
+ else {
+ str += attr + ": " + b + "<br>";
+ }
+ }
+ return str;
+ }
+
+ //
+ // returns a form with the elements of a selected wfs
+ // (if the original wfs is the selected wfs, the values are set too)
+ //
+ function buildElementForm (wfsConfIndex, memberIndex) {
+ var selMember = memberIndex;
+ // if the selected wfs is not the original wfs,
+ // the form template, updating and deleting are disabled.
+ if (parseInt(D[memberIndex]['wfs_conf']) != parseInt(wfsConfIndex)) {
+ memberIndex = -1;
+ }
+
+ var str = "";
+
+ // the wfs conf needs to have a gid and a geom, otherwise saving does not work
+ var gid = false;
+ var geom = false;
+
+ var wfs = wfs_conf[wfsConfIndex];
+
+ var memEl;
+ if (parseInt(memberIndex) != -1) {
+ memEl = D[memberIndex]['element'];
+ }
+
+ // search attribute 'element' in wfsConfArray
+ for (attr in wfs) {
+ if (attr == "element") {
+ str += "<form id='wfs_conf'>\n\t<table>\n";
+
+ b = wfs[attr];
+
+ // get the 'element name' of wfsConfArray['element'][i]
+ for (var i = 0 ; i < b.length ; i ++) {
+ var c = b[i];
+
+ var wfsElementName = c['element_name'];
+
+ // don't display geoms
+ if (parseInt(c['f_geom']) != 1) {
+
+
+ if (parseInt(wfs['element'][i]['f_gid']) == 1) {
+ gid = wfsElementName;
+ }
+
+ //
+ // display the element name and an input row for its value
+ //
+ str += "\t\t<tr>\n\t\t\t<td>\n";
+ str += "\t\t\t\t" + wfsElementName + "\n\t\t\t</td>\n\t\t\t<td colspan = 2>\n";
+ str += "\t\t\t\t<input name='" + wfsElementName + "' type='text' size=20 ";
+
+ // only if the selected wfs is the original wfs!
+ if (parseInt(memberIndex) != -1) {
+ //
+ // get the 'element name' of memberArray['element'][j]
+ //
+ for (var j = 0 ; j < memEl.length ; j ++) {
+ currentElementName = memEl[j]['name'];
+ //
+ // if the element is in both objects, display the value as default
+ //
+ if (currentElementName == wfsElementName) {
+ str += "value = '" + memEl[j]['val'] + "' ";
+ }
+ }
+ }
+ str += ">\n";
+ str += "\t\t\t</td>\n\t\t</tr>\n";
+
+ }
+ else {
+ geom = wfsElementName;
+ }
+ }
+
+ //
+ // generating buttons "save", "update", "delete"
+ //
+
+ // a wfs_transaction url is required.
+ if (wfs['wfs_transaction']) {
+ str += "\t\t<tr>\n";
+
+ // if not all buttons will be generated, the missing columns will be generated afterwards.
+ var colspan = 0;
+
+ if (geom) {
+ str += "\t\t\t<td><input type='button' name='saveButton' value='Save' onclick='window.opener.saveGeom("+selMember+")' /></td>\n";
+ }
+ else {
+ colspan++;
+ }
+ if (parseInt(memberIndex) != -1 && gid) {
+ if (geom) {
+ str += "\t\t\t<td><input type='button' name='updateButton' value='Update' onclick='window.opener.updateGeom("+selMember+")'/></td>\n";
+ }
+ else {
+ colspan++;
+ }
+ str += "\t\t\t<td><input type='button' name='deleteButton' value='Delete' onclick='window.opener.deleteGeom("+selMember+")'/></td>\n";
+ }
+ else {
+ colspan++;
+ }
+
+ if (colspan > 0 && colspan < 3) {
+ str += "\t\t\t<td colspan = " + colspan + "></td>\n";
+ }
+
+ str += "\t\t</tr>";
+ }
+ str += "\t</table>\n";
+// str += "<input type='text' name='mb_geom'>";
+// str += "<input type='text' name='mb_wfs_conf'>";
+ str += "</form>\n";
+ }
+ }
+ return str;
+ }
+
+
+ //
+ // this method opens a new window and displays the attributes in wfs_conf
+ //
+ function showWfs(index) {
+
+ wfsWindow = open("", "wfsattributes", "width=300, height=300, resizable, dependent=yes, scrollbars=yes");
+ wfsWindow.document.open("text/html");
+ wfs_conf = parent.get_complete_wfs_conf();
+ var str = "";
+ var defaultIndex = -1;
+
+ str += "<form id='wfs'>\n\t<select name='wfs' size='" + wfs_conf.length + "'";
+ str += " onChange='document.getElementById(\"elementForm\").innerHTML = window.opener.buildElementForm(this.value , " + index + ")'";
+ str += ">\n\t\t";
+
+ for (var attr in wfs_conf) {
+ str += "<option value='" + attr + "'";
+
+ // if the geometry is already associated with a wfs
+ if (parseInt(D[index]['wfs_conf']) == parseInt(attr)) {
+ str += " selected";
+ defaultIndex = parseInt(attr);
+ }
+ str += ">" + wfs_conf[attr]['wfs_conf_abstract'];
+ str += "</option>\n\t\t";
+
+ }
+ str += "</select>\n\t\t</form>\n\t";
+ str += "<div id='elementForm'>\n</div>\n";
+
+ wfsWindow.document.write(str);
+ wfsWindow.document.close();
+
+ if (defaultIndex != -1) {
+ wfsWindow.document.getElementById("elementForm").innerHTML = buildElementForm(defaultIndex, index);
+ }
+ }
+
+
+
+ //
+ // updates the list of geometries.
+ // this function is invoked only at the end of drawDashedLines()
+ //
+ function updateListOfGeometries () {
+ var listOfGeom = "";
+
+ if (D.length > 0) {
+ listOfGeom += "<table>\n";
+ }
+
+ for (var i = 0 ; i < D.length; i ++) {
+ listOfGeom += "\t<tr>\n";
+ listOfGeom += "\t\t<td>\n";
+ listOfGeom += "\t\t\t<img src = '../img/button_digitize/geomInfo.png' title='WFS conf' onclick='showWfs("+i+")'>\n";
+ listOfGeom += "\t\t</td>\n";
+ listOfGeom += "\t\t<td>\n";
+ listOfGeom += "\t\t\t<img src = '../img/button_digitize/geomRemove.png' title='delete this " + D[i]['geomtype'] + "' onclick='deleteMember("+i+")'>\n";
+ listOfGeom += "\t\t</td>\n";
+ listOfGeom += "\t\t<td style = 'color:blue'>\n";
+ listOfGeom += "\t\t\t<div onmouseover='parent.mb_wfs_perform(\"over\",D["+i+"])' ";
+ listOfGeom += " onmouseout='parent.mb_wfs_perform(\"out\",D["+i+"])' ";
+
+ // if a geometry is a wfs result -> zoom to geometry
+
+ if (D[i]['wfs_conf'] != -1) {
+ listOfGeom += " onclick='parent.mb_wfs_perform(\"click\",D["+i+"]);' ";
+ }
+ // ... a geometry has been digitized by hand -> zoom to first point (FIXME: zooming to the entire geometry would be better)
+ else{
+ listOfGeom += " onclick='parent.zoom(mod_digitize_target,\"true\", 1.0, " + D[i]['geometry'][0]['x'][0] + ", " + D[i]['geometry'][0]['y'][0] + ");' ";
+ }
+ var geomName = parent.getElementValueByName(D, i, "name");
+ if (!geomName) {
+ geomName = "new";
+ }
+ var suffix = " ";
+ if (D[i]['geomtype'] == "Polygon") {
+ suffix += "(Py)";
+ }
+ else if (D[i]['geomtype'] == "Line") {
+ suffix += "(Li)";
+ }
+ if (D[i]['geomtype'] == "Point") {
+ suffix += "(Pt)";
+ }
+
+ listOfGeom += ">" + geomName + suffix +"</div>";
+ listOfGeom += "\t\t</td>\n";
+ }
+
+ if (D.length > 0) {
+ listOfGeom += "</table>\n";
+ }
+ parent.writeTag(mod_digitize_elName,"listOfGeometries",listOfGeom);
+ }
+function saveGeom(m){
+ var myform = wfsWindow.document.forms[0];
+ var ind = myform.wfs.selectedIndex;
+ var wfs = myform.wfs.options[ind].value;
+ myform = wfsWindow.document.forms[1];
+ D[m]['wfs_conf'] = wfs;
+ D[m]['element'] = new Array();
+ D[m]['element']['name'] = new Array();
+ D[m]['element']['val'] = new Array();
+ var cnt = 0;
+ for( var i=0; i<myform.length; i++){
+ if(myform.elements[i].type == 'text'){
+ D[m]['element'][cnt] = new Array();
+ D[m]['element'][cnt]['name'] = myform.elements[i].name;
+ D[m]['element'][cnt]['val'] = myform.elements[i].value;
+ cnt++;
+ }
+ }
+// alert(wfs_conf[D[m]['wfs_conf']]['wfs_transaction']);
+ var myconf = wfs_conf[D[m]['wfs_conf']];
+ document.sendForm.url.value = myconf['wfs_transaction'];
+ var str = '<wfs:Transaction version="1.0.0" service="WFS" xmlns="http://www.someserver.com/myns" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someserver.com/myns http://wms1.ccgis.de/geoserver-1.3-beta4/wfs/getCapabilities?request=describefeaturetype&typename=mapbender_user http://www.opengis.net/wfs../wfs/1.0.0/WFS-transaction.xsd" xmlns:topp="http://www.someserver.com/topp">';
+ str += '<wfs:Insert>';
+ str += '<'+ myconf['featuretype_name']+'>';
+ for(var i=0; i<D[m]['element'].length; i++){
+ if(D[m]['element'][i]['val'] != ""){
+ var tmp = D[m]['element'][i]['name'];
+ str += '<' + tmp + '>';
+ str += D[m]['element'][i]['val'];
+ str += '</' + tmp + '>';
+ }
+ }
+ for(var j=0; j<myconf['element'].length; j++){
+ if(myconf['element'][j]['f_geom'] == 1){
+ var el_geom = myconf['element'][j]['element_name'];
+ }
+ }
+ str += '<' + el_geom + '>';
+
+// if(dig.D[0].type == 'text'){
+// str += '<gml:Point srsName="epsg:4326">';
+// str += '<gml:coordinates>';
+// str += dig.D[0].x[0] + "," + dig.D[0].y[0];
+// str += '</gml:coordinates>';
+// str += '</gml:Point>';
+// }
+// if(dig.D[0].type == 'line'){
+// str += '<gml:MultiLineString srsName="epsg:4326">';
+// str += '<gml:lineStringMember>';
+// str += '<gml:LineString>';
+//
+// str += '<gml:coordinates>';
+// for(var k=0; k<dig.D[0].x.length; k++){
+// if(k>0){
+// str += " ";
+// }
+// str += dig.D[0].x[k] + "," + dig.D[0].y[k];
+// }
+// str += '</gml:coordinates>';
+// str += '</gml:LineString>';
+// str += '</gml:lineStringMember>';
+// str += '</gml:MultiLineString>';
+// }
+ if(D[m]['geomtype'] == 'Polygon'){
+ str += '<gml:MultiPolygon srsName="epsg:4326">';
+ str += '<gml:polygonMember>';
+ str += '<gml:Polygon>';
+ str += '<gml:outerBoundaryIs>';
+ str += '<gml:LinearRing>';
+
+ str += '<gml:coordinates>';
+ for(var k=0; k<D[m]['geometry'][0]['x'].length; k++){
+ if(k>0){
+ str += " ";
+ }
+ str += D[m]['geometry'][0]['x'][k] + "," + D[m]['geometry'][0]['y'][k];
+ }
+ str += '</gml:coordinates>';
+ str += '</gml:LinearRing>';
+ str += '</gml:outerBoundaryIs>';
+ str += '</gml:Polygon>';
+ str += '</gml:polygonMember>';
+ str += '</gml:MultiPolygon>';
+ }
+ str += '</' + el_geom + '>';
+ str += '</'+ myconf['featuretype_name']+'>';
+ str += '</wfs:Insert>';
+ str += '</wfs:Transaction>';
+ document.forms[1].filter.value = str;
+ document.forms[1].submit();
+ return false;
+}
+function updateGeom(m){
+ var myid_value;
+ var myform = wfsWindow.document.forms[0];
+ var ind = myform.wfs.selectedIndex;
+ var wfs = myform.wfs.options[ind].value;
+ myform = wfsWindow.document.forms[1];
+ D[m]['wfs_conf'] = wfs;
+ D[m]['element'] = new Array();
+ D[m]['element']['name'] = new Array();
+ D[m]['element']['val'] = new Array();
+ var cnt = 0;
+ for( var i=0; i<myform.length; i++){
+ if(myform.elements[i].type == 'text'){
+ D[m]['element'][cnt] = new Array();
+ D[m]['element'][cnt]['name'] = myform.elements[i].name;
+ D[m]['element'][cnt]['val'] = myform.elements[i].value;
+ if(D[m]['element'][cnt]['name'] == 'gid'){
+ myid_value = D[m]['element'][cnt]['val'];
+ }
+ cnt++;
+ }
+ }
+// alert(wfs_conf[D[m]['wfs_conf']]['wfs_transaction']);
+ var myconf = wfs_conf[D[m]['wfs_conf']];
+ document.sendForm.url.value = myconf['wfs_transaction'];
+ var str = '<wfs:Transaction version="1.0.0" service="WFS" xmlns="http://www.someserver.com/myns" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someserver.com/myns http://wms1.ccgis.de/geoserver-1.3-beta4/wfs/getCapabilities?request=describefeaturetype&typename=mapbender_user http://www.opengis.net/wfs../wfs/1.0.0/WFS-transaction.xsd" xmlns:topp="http://www.someserver.com/topp">';
+ str += '<wfs:Update typeName="'+ myconf['featuretype_name']+'">';
+ for(var i=0; i<D[m]['element'].length; i++){
+ if(D[m]['element'][i]['val'] != ""){
+ str += '<wfs:Property>';
+ str += '<wfs:Name>'+D[m]['element'][i]['name']+'</wfs:Name>';
+ str += '<wfs:Value>'+D[m]['element'][i]['val']+'</wfs:Value>';
+ str += '</wfs:Property>';
+ }
+ }
+ for(var j=0; j<myconf['element'].length; j++){
+ if(myconf['element'][j]['f_geom'] == 1){
+ var el_geom = myconf['element'][j]['element_name'];
+ }
+ }
+// str += '<' + el_geom + '>';
+
+// if(dig.D[0].type == 'text'){
+// str += '<gml:Point srsName="epsg:4326">';
+// str += '<gml:coordinates>';
+// str += dig.D[0].x[0] + "," + dig.D[0].y[0];
+// str += '</gml:coordinates>';
+// str += '</gml:Point>';
+// }
+// if(dig.D[0].type == 'line'){
+// str += '<gml:MultiLineString srsName="epsg:4326">';
+// str += '<gml:lineStringMember>';
+// str += '<gml:LineString>';
+//
+// str += '<gml:coordinates>';
+// for(var k=0; k<dig.D[0].x.length; k++){
+// if(k>0){
+// str += " ";
+// }
+// str += dig.D[0].x[k] + "," + dig.D[0].y[k];
+// }
+// str += '</gml:coordinates>';
+// str += '</gml:LineString>';
+// str += '</gml:lineStringMember>';
+// str += '</gml:MultiLineString>';
+// }
+ if(D[m]['geomtype'] == 'Polygon'){
+ str += '<wfs:Property>';
+ str += '<wfs:Name>' + el_geom + '</wfs:Name>';
+ str += '<wfs:Value>';
+ str += '<gml:MultiPolygon srsName="epsg:4326">';
+ str += '<gml:polygonMember>';
+ str += '<gml:Polygon>';
+ str += '<gml:outerBoundaryIs>';
+ str += '<gml:LinearRing>';
+
+ str += '<gml:coordinates>';
+ for(var k=0; k<D[m]['geometry'][0]['x'].length; k++){
+ if(k>0){
+ str += " ";
+ }
+ str += D[m]['geometry'][0]['x'][k] + "," + D[m]['geometry'][0]['y'][k];
+ }
+ str += '</gml:coordinates>';
+ str += '</gml:LinearRing>';
+ str += '</gml:outerBoundaryIs>';
+ str += '</gml:Polygon>';
+ str += '</gml:polygonMember>';
+ str += '</gml:MultiPolygon>';
+ str += '</wfs:Value>';
+ str += '</wfs:Property>';
+ }
+// str += '</' + el_geom + '>';
+ str += '<ogc:Filter>';
+ str += '<ogc:PropertyIsEqualTo>';
+ str += '<ogc:PropertyName>gid</ogc:PropertyName>';
+ str += '<ogc:Literal>'+myid_value+'</ogc:Literal>';
+ str += '</ogc:PropertyIsEqualTo>';
+ str += '</ogc:Filter>';
+ str += '</wfs:Update>';
+ str += '</wfs:Transaction>';
+ document.forms[1].filter.value = str;
+ //prompt("",str);
+ document.forms[1].submit();
+ return false;
+}
+function deleteGeom(m){
+ var myid_value;
+ var myform = wfsWindow.document.forms[0];
+ var ind = myform.wfs.selectedIndex;
+ var wfs = myform.wfs.options[ind].value;
+ myform = wfsWindow.document.forms[1];
+ D[m]['wfs_conf'] = wfs;
+ D[m]['element'] = new Array();
+ D[m]['element']['name'] = new Array();
+ D[m]['element']['val'] = new Array();
+ var cnt = 0;
+ for( var i=0; i<myform.length; i++){
+ if(myform.elements[i].type == 'text'){
+ D[m]['element'][cnt] = new Array();
+ D[m]['element'][cnt]['name'] = myform.elements[i].name;
+ D[m]['element'][cnt]['val'] = myform.elements[i].value;
+ if(D[m]['element'][cnt]['name'] == 'gid'){
+ myid_value = D[m]['element'][cnt]['val'];
+ }
+ cnt++;
+ }
+ }
+// alert(wfs_conf[D[m]['wfs_conf']]['wfs_transaction']);
+ var myconf = wfs_conf[D[m]['wfs_conf']];
+ document.sendForm.url.value = myconf['wfs_transaction'];
+ var str = '<wfs:Transaction version="1.0.0" service="WFS" xmlns="http://www.someserver.com/myns" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someserver.com/myns http://wms1.ccgis.de/geoserver-1.3-beta4/wfs/getCapabilities?request=describefeaturetype&typename=mapbender_user http://www.opengis.net/wfs../wfs/1.0.0/WFS-transaction.xsd" xmlns:topp="http://www.someserver.com/topp">';
+ str += '<wfs:Delete typeName="'+ myconf['featuretype_name']+'">';
+ for(var j=0; j<myconf['element'].length; j++){
+ if(myconf['element'][j]['f_geom'] == 1){
+ var el_geom = myconf['element'][j]['element_name'];
+ }
+ }
+
+ str += '<ogc:Filter>';
+ str += '<ogc:PropertyIsEqualTo>';
+ str += '<ogc:PropertyName>gid</ogc:PropertyName>';
+ str += '<ogc:Literal>'+myid_value+'</ogc:Literal>';
+ str += '</ogc:PropertyIsEqualTo>';
+ str += '</ogc:Filter>';
+ str += '</wfs:Delete>';
+ str += '</wfs:Transaction>';
+ document.forms[1].filter.value = str;
+ //prompt("",str);
+ document.forms[1].submit();
+ return false;
+}
+ </script>
+ </head>
+ <body onload="registerFunctions()">
+ <table cellpadding='0' cellspacing='0' align = center>
+ <tr>
+ <td>
+ <form name='dig'>
+ <table cellpadding='0' cellspacing='2'>
+ <tr>
+ <td>
+ <img name='Point' onmouseover='register_button(this)' id='Point' title="Add point" src = '../img/button_digitize/text_up.png'>
+ </td>
+ <td>
+ <img name='Line' onmouseover='register_button(this)' id='Line' title="Add line" src = '../img/button_digitize/line_up.png'>
+ </td>
+ <td>
+ <img name='Polygon' onmouseover='register_button(this)' id='Polygon' title="Add polygon" src = '../img/button_digitize/poly_up.png'>
+ </td>
+ <td>
+
+ </td>
+ <td>
+ <img name='dragBasePoint' onmouseover='register_button(this)' id='dragBasePoint' title="Move node" src = '../img/button_digitize/move_up.png'>
+ </td>
+ <td>
+ <img name='setBasePoint' onmouseover='register_button(this)' id='setBasePoint' title="Add node" src = '../img/button_digitize/newNode_up.png'>
+ </td>
+ <td>
+ <img name='delBasePoint' onmouseover='register_button(this)' id='delBasePoint' title="Delete node" src = '../img/button_digitize/delNode_up.png'>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </td>
+ </tr>
+ </table>
+ <div id = 'listOfGeometries'></div>
+ <form name='sendForm' action='../extensions/geom2wfst.php' method='POST' TARGET='_blank'>
+ <input type='hidden' name='url'>
+ <input type='hidden' name='filter'>
+ </form>
+ </body>
+ </html>
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_digitize_tab_gml2java_beta.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_digitize_tab_gml2java_beta.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab_gml2java_beta.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,664 @@
+<?php
+#$Id: mod_digitize_tab_gml2java_beta.php,v 1.7 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_digitize_tab_gml2java_beta.php,v 1.7 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+?>
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+ <html>
+ <head>
+ <meta http-equiv="cache-control" content="no-cache">
+ <meta http-equiv="pragma" content="no-cache">
+ <meta http-equiv="expires" content="0">
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="DC.Rights" content="CCGIS GbR, Bonn">
+ <title>Digitize</title>
+ <style type="text/css">
+ <!--
+ body{
+ font-family: Arial, Helvetica, sans-serif;
+ font-size : 12px;
+ color: #ffffff;
+ background-color: lightgray;
+ margin-top: 0px;
+ margin-left: 0px;
+ }
+ .button{
+ height: 18px;
+ width: 32px;
+ }
+ -->
+ </style>
+
+<?php
+
+
+ session_start();
+ $gui_id = $_SESSION["mb_user_gui"];
+
+ require_once("../../conf/mapbender.conf");
+ require_once("../classes/class_gml.php");
+
+ $con = db_connect($DBSERVER,$OWNER,$PW);
+ db_select_db(DB,$con);
+ $sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'digitize' AND fkey_gui_id = '".$gui_id."'";
+ $res = db_query($sql);
+ $cnt = 0;
+ while(db_fetch_row($res)){
+ $e_src = db_result($res,0,"e_src");
+ $e_target = explode(",",db_result($res,0,"e_target"));
+ $cnt++;
+ }
+ if($cnt > 1){ echo "alert('digitize_button: ID not unique!');";}
+# echo $e_target[0] . "<br>";
+# echo $e_target[1];
+ echo "<script language='JavaScript'>";
+ echo "var mod_digitize_target = '".$e_target[0]."';";
+ echo "var mod_digitize_frame = '".$e_target[1]."';";
+
+
+
+
+ // new gml
+ $gml = array();
+ $gml[0] = implode("", file("53115.xml"));
+ $D = new gml();
+ $D->addGml($gml);
+ $javaObjStr = $D->gml2JavaObj(0);
+
+ // bugs
+ // when zooming in/out, the geometry is not changed.
+ // when you move nodes now, the geometry flips to the new extent.
+ // -> whenever the zoom is changed, the geometry should be refreshed
+
+
+
+?>
+
+ parent.mb_registerSubFunctions("window.frames['digitize'].drawDashedLine()");
+
+ var mod_digitize_status = 0;
+
+ //public
+
+ var mod_digitize_color1 = "white";
+ var mod_digitize_color2 = "black";
+ var mod_digitize_font = "Arial, Helvetica, sans-serif";
+ var mod_digitize_fontsize = "9px";
+ var mod_digitize_basepoint = "#8a2be2";
+ var mod_digitize_linepoint = "#ff00ff";
+ var mod_digitize_bg = "";
+
+ var mod_digitize_elName = "digitize"
+ var mod_digitize_frameName = "";
+
+ // constructor - object:
+ var D = new Array();
+
+
+ function register_D(type){
+ var id = D.length;
+ if(id > 0){
+ var check = val_D(id);
+ if(check == false){
+ id -= 1;
+ }
+ }
+ D[id] = new const_D(id, type);
+ }
+
+ function const_D(id,type){
+ this.id = id;
+ this.type = type;
+ this.x = new Array();
+ this.y = new Array();
+ this.label = "";
+
+ var ind = parent.getMapObjIndexByName(mod_digitize_target);
+ this.epsg = parent.mb_mapObj[ind].epsg;
+ this.units = "";
+ this.dist = new Array();
+ this.totaldist = new Array();
+ this.complete = false;
+ }
+
+ function val_D(id){
+ if(D[(id - 1)].x.length == 0){
+ return false;
+ }
+ else{
+ return true;
+ }
+ }
+
+
+ var activeButton; // contains id of active button
+ var isOn = true;
+ var mod_digitize_width;
+ var mod_digitize_height;
+ var mod_digitize_Dist = new Array();
+ var mod_digitize_TotalDist = new Array();
+ var mod_digitizeSubFunctions = new Array();
+ var mod_digitizeEvent = false;
+
+ var bp_active = false;
+ var bp_obj = false;
+ var bp_geom = false;
+ var bp_p = false;
+ var start_x = false;
+ var start_y = false;
+ var end_x = false;
+ var end_y = false;
+
+
+ //
+ //
+ // preload images
+ //
+ //
+ // up
+ var digitize_text_up = new Image(); digitize_text_up.src = "../img/button_digitize/text_up.png";
+ var digitize_line_up = new Image(); digitize_line_up.src = "../img/button_digitize/line_up.png";
+ var digitize_poly_up = new Image(); digitize_poly_up.src = "../img/button_digitize/poly_up.png";
+ var digitize_move_up = new Image(); digitize_move_up.src = "../img/button_digitize/move_up.png";
+ var digitize_addNode_up = new Image(); digitize_addNode_up.src = "../img/button_digitize/newNode_up.png";
+ var digitize_delNode_up = new Image(); digitize_delNode_up.src = "../img/button_digitize/delNode_up.png";
+ var digitize_del_up = new Image(); digitize_del_up.src = "../img/button_digitize/del_up.png";
+ // down
+ var digitize_text_down = new Image(); digitize_text_down.src = "../img/button_digitize/text_down.png";
+ var digitize_line_down = new Image(); digitize_line_down.src = "../img/button_digitize/line_down.png";
+ var digitize_poly_down = new Image(); digitize_poly_down.src = "../img/button_digitize/poly_down.png";
+ var digitize_move_down = new Image(); digitize_move_down.src = "../img/button_digitize/move_down.png";
+ var digitize_addNode_down = new Image(); digitize_addNode_down.src = "../img/button_digitize/newNode_down.png";
+ var digitize_delNode_down = new Image(); digitize_delNode_down.src = "../img/button_digitize/delNode_down.png";
+ var digitize_del_down = new Image(); digitize_del_down.src = "../img/button_digitize/del_down.png";
+ // disabled
+ var digitize_text_disabled = new Image(); digitize_text_disabled.src = "../img/button_digitize/text_disabled.png";
+ var digitize_line_disabled = new Image(); digitize_line_disabled.src = "../img/button_digitize/line_disabled.png";
+ var digitize_poly_disabled = new Image(); digitize_poly_disabled.src = "../img/button_digitize/poly_disabled.png";
+ var digitize_move_disabled = new Image(); digitize_move_disabled.src = "../img/button_digitize/move_disabled.png";
+ var digitize_addNode_disabled = new Image(); digitize_addNode_disabled.src = "../img/button_digitize/newNode_disabled.png";
+ var digitize_delNode_disabled = new Image(); digitize_delNode_disabled.src = "../img/button_digitize/delNode_disabled.png";
+ var digitize_del_disabled = new Image(); digitize_del_disabled.src = "../img/button_digitize/del_disabled.png";
+
+ //
+ //
+ // button handling
+ //
+ //
+ function mod_addText(obj) {
+ if(document.getElementById("text").src == digitize_text_up.src){
+ // display correct buttons and set geometry
+ document.getElementById("text").src = digitize_text_down.src;
+ activeButton = obj.id;
+ document.getElementById("line").src = digitize_line_disabled.src;
+ document.getElementById("polygon").src = digitize_poly_disabled.src;
+ document.getElementById("dragBasePoint").src = digitize_move_disabled.src;
+ document.getElementById("setBasePoint").src = digitize_addNode_disabled.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_disabled.src;
+ document.getElementById("del").src = digitize_del_disabled.src;
+ set_D(obj);
+ mod_digitize_go();
+ }
+ // buttons will be reset after text has been added in mod_digitize_start(e)
+ }
+
+ function mod_addLine(obj) {
+ if(document.getElementById("line").src == digitize_line_up.src){
+ // display correct buttons and set geometry
+ document.getElementById("text").src = digitize_text_disabled.src;
+ document.getElementById("line").src = digitize_line_down.src;
+ document.getElementById("line").title = "Finish line";
+ activeButton = obj.id;
+ document.getElementById("polygon").src = digitize_poly_disabled.src;
+ document.getElementById("dragBasePoint").src = digitize_move_disabled.src;
+ document.getElementById("setBasePoint").src = digitize_addNode_disabled.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_disabled.src;
+ document.getElementById("del").src = digitize_del_disabled.src;
+ set_D(obj);
+ mod_digitize_go();
+ }
+ else{
+ // reset buttons
+ if (document.getElementById("line").src == digitize_line_down.src){
+ document.getElementById("text").src = digitize_text_up.src;
+ document.getElementById("line").src = digitize_line_up.src;
+ document.getElementById("line").title = "Add line";
+ document.getElementById("polygon").src = digitize_poly_up.src;
+ document.getElementById("dragBasePoint").src = digitize_move_up.src;
+ document.getElementById("setBasePoint").src = digitize_addNode_up.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_up.src;
+ document.getElementById("del").src = digitize_del_up.src;
+ activeButton = null;
+ }
+ }
+ }
+
+ function mod_addPolygon(obj) {
+ if(document.getElementById("polygon").src == digitize_poly_up.src){
+ // display correct buttons and set geometry
+ document.getElementById("text").src = digitize_text_disabled.src;
+ document.getElementById("line").src = digitize_line_disabled.src;
+ document.getElementById("polygon").src = digitize_poly_down.src;
+ document.getElementById("polygon").title = "Finish polygon";
+ activeButton = obj.id;
+ document.getElementById("dragBasePoint").src = digitize_move_disabled.src;
+ document.getElementById("setBasePoint").src = digitize_addNode_disabled.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_disabled.src;
+ document.getElementById("del").src = digitize_del_disabled.src;
+ set_D(obj);
+ mod_digitize_go();
+ }
+ else{
+ if (document.getElementById("polygon").src == digitize_poly_down.src){
+ // reset buttons and finish geometry
+ document.getElementById("text").src = digitize_text_up.src;
+ document.getElementById("line").src = digitize_line_up.src;
+ document.getElementById("polygon").src = digitize_poly_up.src;
+ document.getElementById("polygon").title = "Add polygon";
+ document.getElementById("dragBasePoint").src = digitize_move_up.src;
+ document.getElementById("setBasePoint").src = digitize_addNode_up.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_up.src;
+ document.getElementById("del").src = digitize_del_up.src;
+ activeButton = null;
+ close_D();
+ }
+ }
+ }
+
+ function mod_moveNode(obj) {
+ if(document.getElementById("dragBasePoint").src == digitize_move_up.src){
+ // display correct buttons and set event
+ document.getElementById("dragBasePoint").src = digitize_move_down.src;
+ activeButton = obj.id;
+ document.getElementById("setBasePoint").src = digitize_addNode_up.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_up.src;
+ setEvent(obj);
+ }
+ }
+
+ function mod_addNode(obj) {
+ if(document.getElementById("setBasePoint").src == digitize_addNode_up.src){
+ // display correct buttons and set event
+ document.getElementById("setBasePoint").src = digitize_addNode_down.src;
+ activeButton = obj.id;
+ document.getElementById("dragBasePoint").src = digitize_move_up.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_up.src;
+ setEvent(obj);
+ }
+ }
+
+ function mod_delNode(obj) {
+ if(document.getElementById("delBasePoint").src == digitize_delNode_up.src){
+ // display correct buttons and set event
+ document.getElementById("delBasePoint").src = digitize_delNode_down.src;
+ activeButton = obj.id;
+ document.getElementById("setBasePoint").src = digitize_addNode_up.src;
+ document.getElementById("dragBasePoint").src = digitize_move_up.src;
+ setEvent(obj);
+ }
+ }
+
+ function mod_delGeom() {
+ isOn = false;
+ if(document.getElementById("del").src == digitize_del_up.src){
+ if(confirm("Do you really want to delete all geometries?", "")) {
+ del_D();
+ }
+ }
+ }
+
+ function mod_addGml() {
+ <?php
+ echo $javaObjStr;
+ ?>
+ drawDashedLine();
+ }
+
+
+ function mod_digitize_go(){
+ parent.mb_registerGML(mod_digitize_target,D);
+ parent.document.getElementById(mod_digitize_elName).style.visibility = 'visible';
+ var el = parent.frames[mod_digitize_target].document;
+ el.onmousedown = mod_digitize_start;
+ //el.onmousemove = mod_digitize_run;
+
+ var ind = parent.getMapObjIndexByName(mod_digitize_target);
+ mod_digitize_width = parent.mb_mapObj[ind].width;
+ mod_digitize_height = parent.mb_mapObj[ind].height;
+ //mod_digitize_epsg = parent.mb_mapObj[ind].epsg;
+ }
+
+ function mod_digitize_disable(){
+ isOn = false;
+ parent.document.getElementById(mod_digitize_elName).style.visibility = 'hidden';
+ var el = parent.frames[mod_digitize_target].document;
+ el.onmousedown = null;
+ el.onmouseup = null;
+ el.onmousemove = null;
+ drawDashedLine();
+ }
+
+ function mod_digitize_timeout(){
+ var el = parent.window.frames[mod_digitize_target].document;
+ el.onmousedown = null;
+ el.ondblclick = null;
+ el.onmousemove = null;
+ }
+
+ function mod_digitize_start(e){
+ isOn = true;
+ if(D[D.length -1].complete == true || (D.length == 0)){
+ alert("Geometrie muss ausgewählt sein!");
+ return true;
+ }
+ parent.mb_getMousePos(e,mod_digitize_target);
+ var realWorldPos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX,parent.clickY);
+ D[D.length-1].x[D[D.length-1].x.length] = Math.round(realWorldPos[0] * 100)/100;
+ D[D.length-1].y[D[D.length-1].y.length] = Math.round(realWorldPos[1] * 100)/100;
+ if(D[D.length-1].type == 'text'){
+ var l = prompt("Beschriftung: ","");
+ if(l != null){
+ D[D.length-1].label = l;
+ D[D.length-1].complete = true;
+ }
+ document.getElementById("text").src = digitize_text_up.src;
+ document.getElementById("line").src = digitize_line_up.src;
+ document.getElementById("polygon").src = digitize_poly_up.src;
+ document.getElementById("dragBasePoint").src = digitize_move_up.src;
+ document.getElementById("setBasePoint").src = digitize_addNode_up.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_up.src;
+ document.getElementById("del").src = digitize_del_up.src;
+ activeButton = null;
+ }
+ drawDashedLine();
+ return true;
+ }
+
+
+ function drawDashedLine(){
+ var smP = "";
+ smP += "<div class='t_img'>";
+ smP += "<img src='"+parent.mb_trans.src+"' width='"+mod_digitize_width+"' height='0'></div>";
+ smP += "<div class='t_img'>";
+ smP += "<img src='"+parent.mb_trans.src+"' width='0' height='"+mod_digitize_height+"'></div>";
+ for(var j=0; j<D.length; j++){
+ for(var i=0; i<D[j].x.length; i++){
+ var pos = parent.makeRealWorld2mapPos(mod_digitize_target,D[j].x[i],D[j].y[i]);
+ if(D[j].type == 'text' || D[j].type == 'line' || D[j].type == 'polygon' || (D[j].type == 'point' && D[j].label =="")){
+ smP += "<div class='bp' style='top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;'";
+ if(i==0 && D[j].type == 'polygon' && D[j].complete == false){
+ smP += " title='to close polygon, release the polygon button on the left' ";
+ }
+ if(isOn){
+ smP += " onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].mobp(this,"+j+","+i+")' ;";
+
+ //This line is imho not necessary, and it
+ //causes a graphical error within the
+ //vertical tabs in Firefox
+ //CB removed this line to prevent this error:
+ //smP += " onmouseout='parent.window.frames[\""+mod_digitize_elName+"\"].mod_digitize_go()' ";
+ }
+ smP += "></div>";
+ }
+ //label:
+ if(i == 0 && D[j].label != ""){
+ smP += "<div class='label' style='top:"+(pos[1]-6)+"px;left:"+(pos[0])+"px'>"+D[j].label+"</div>";
+ }
+ }
+ if(D[j].x.length>1){
+ for(var k=1; k<D[j].x.length; k++){
+ var pos0 = parent.makeRealWorld2mapPos(mod_digitize_target,D[j].x[k], D[j].y[k]);
+ var pos1 = parent.makeRealWorld2mapPos(mod_digitize_target,D[j].x[k-1], D[j].y[k-1]);
+ smP += evaluateDashes(pos1[0],pos1[1],pos0[0],pos0[1],k,j,k);
+ }
+ }
+ }
+ parent.writeTag(mod_digitize_target,"digitize",smP);
+ }
+
+ function evaluateDashes(x1,y1,x2,y2,count,geom,p){
+ var str_dashedLine = "";
+ var s = 10;
+ var d = Math.sqrt(Math.pow((y1-y2),2) + Math.pow((x1-x2),2)) ;
+ var n = Math.round(d/s);
+ var s_x = (x2 - x1)/n;
+ var s_y = (y2 - y1)/n;
+ for(var i=1; i<n; i++){
+ var x = Math.round(x1 + i * s_x)-2;
+ var y = Math.round(y1 + i * s_y)-2;
+ if(x >= 0 && x <= mod_digitize_width && y >= 0 && y <= mod_digitize_height){
+ str_dashedLine += "<div class='lp' style='top:"+y+"px;left:"+x+"px;z-index:50;' ";
+ if(isOn){
+ str_dashedLine += "onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].lp2bp(this,"+geom+","+p+")'>";
+ }
+ str_dashedLine += "</div>";
+ }
+ }
+ return str_dashedLine;
+ }
+
+ function mobp(Obj,geom,p){
+ if(!isOn){ return false; };
+ bp_obj = Obj;
+ bp_geom = geom;
+ bp_p = p;
+ if(mod_digitizeEvent == "dragBasePoint" && activeButton == 'dragBasePoint'){
+ mod_digitize_timeout();
+ Obj.style.cursor = 'move';
+ Obj.onmousedown = parent.window.frames[mod_digitize_elName].bp_down;
+ }
+ if(mod_digitizeEvent == false && D[geom].type == 'polygon' && D[geom].complete == false){
+ Obj.onmousedown = parent.window.frames[mod_digitize_elName].close_Pol;
+ }
+ if(mod_digitizeEvent == "delBasePoint" && activeButton == 'delBasePoint'){
+ mod_digitize_timeout();
+ Obj.style.cursor = 'crosshair';
+ Obj.onmousedown = parent.window.frames[mod_digitize_elName].delete_bp;
+ }
+ }
+
+ function delete_bp(e){
+ if (D[bp_geom].x.length - bp_p == 1 && D[bp_geom].type == 'polygon') {
+ D[bp_geom].x.length = D[bp_geom].x.length -1;
+ D[bp_geom].y.length = D[bp_geom].y.length -1;
+ if (bp_p != 0) {
+ D[bp_geom].x[0] = D[bp_geom].x[D[bp_geom].x.length-1];
+ D[bp_geom].y[0] = D[bp_geom].y[D[bp_geom].x.length-1];
+ }
+ }
+ else {
+
+ for(var i= bp_p; i<D[bp_geom].x.length; i++){
+ D[bp_geom].x[i] = D[bp_geom].x[i+1];
+ D[bp_geom].y[i] = D[bp_geom].y[i+1];
+ }
+ D[bp_geom].x.length = D[bp_geom].x.length -1;
+ D[bp_geom].y.length = D[bp_geom].y.length -1;
+ }
+ drawDashedLine();
+ }
+
+ function close_Pol(e){
+ if(!isOn){ return; };
+ D[bp_geom].complete = true;
+ D[bp_geom].x[D[bp_geom].x.length] = D[bp_geom].x[0];
+ D[bp_geom].y[D[bp_geom].y.length] = D[bp_geom].y[0];
+ close_D();
+ drawDashedLine();
+ }
+
+ function lp2bp(obj,geom,p){
+ if(!isOn){ return false; };
+ if(mod_digitizeEvent == "setBasePoint" && activeButton == 'setBasePoint'){
+ mod_digitize_timeout();
+ obj.style.cursor = 'crosshair';
+ obj.onclick = set_bp;
+ bp_obj = obj;
+ bp_geom = geom;
+ bp_p = p;
+ }
+ }
+
+ function set_bp(e){
+ parent.mb_getMousePos(e, mod_digitize_target);
+ var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX, parent.clickY);
+ for(var i=D[bp_geom].x.length; i>bp_p; i--){
+ D[bp_geom].x[i] = D[bp_geom].x[i-1];
+ D[bp_geom].y[i] = D[bp_geom].y[i-1];
+ }
+ D[bp_geom].x[bp_p] = pos[0];
+ D[bp_geom].y[bp_p] = pos[1];
+ drawDashedLine();
+ }
+
+ function set_D(obj){
+ register_D(obj.id);
+ }
+
+ function close_D(){
+ if(D.length > 0){
+ D[D.length -1].complete = true;
+ }
+ for(var i=0; i<D.length; i++){
+ if(D[i].complete == true && D[i].type == 'polygon' && D[i].x[0] != D[i].x[D[i].x.length-1]){
+ D[i].x[D[i].x.length] = D[i].x[0];
+ D[i].y[D[i].y.length] = D[i].y[0];
+ drawDashedLine();
+ }
+
+ }
+ parent.mb_obj2gml("mapframe1");
+ }
+
+ function del_D(){
+ D = new Array();
+ drawDashedLine();
+ document.getElementById("del").src = digitize_del_disabled.src;
+ document.getElementById("delBasePoint").src = digitize_delNode_disabled.src;
+ document.getElementById("dragBasePoint").src = digitize_move_disabled.src;
+ document.getElementById("setBasePoint").src = digitize_addNode_disabled.src;
+ activeButton = null;
+ }
+
+ function bp_down(e){
+ if(bp_active == false && mod_digitizeEvent == "dragBasePoint"){
+ bp_obj.onmouseup = bp_up;
+ bp_obj.onmousemove = bp_drag;
+ parent.mb_getMousePos(e, mod_digitize_target);
+ start_x = parent.clickX;
+ start_y = parent.clickY;
+ end_x = parent.clickX;
+ end_y = parent.clickY;
+ bp_active = true;
+ return false;
+ }
+ }
+
+ function bp_up(e){
+ //document.onmouseup = null;
+ //document.onmousemove = null;
+ bp_active = false;
+ parent.mb_getMousePos(e, mod_digitize_target);
+ end_x = parent.clickX;
+ end_y = parent.clickY;
+ var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target,end_x, end_y);
+
+ if ( (bp_p == D[bp_geom].x.length - 1 || bp_p == 0) && D[bp_geom].complete == true && D[bp_geom].type == 'polygon') {
+ D[bp_geom].x[0] = pos[0];
+ D[bp_geom].y[0] = pos[1];
+ }
+
+ D[bp_geom].x[bp_p] = pos[0];
+ D[bp_geom].y[bp_p] = pos[1];
+ drawDashedLine();
+ }
+
+ function bp_drag(e){
+ if(bp_active){
+ parent.mb_getMousePos(e, mod_digitize_target);
+ end_x = parent.clickX;
+ end_y = parent.clickY;
+ bp_obj.style.width = mod_digitize_width;
+ bp_obj.style.height = mod_digitize_height;
+ bp_obj.style.left = 0;
+ bp_obj.style.top = 0;
+ if (parent.ie) {
+ bp_obj.style.background = "url(/../img/button_digitize/trans.png)";
+ }
+ else{
+ bp_obj.style.backgroundColor = 'transparent';
+ }
+ }
+ }
+
+ function setEvent(obj){
+ mod_digitizeEvent = obj.id;
+ }
+
+ function delEvent(){
+ mod_digitizeEvent = false;
+ mod_digitize_go();
+ }
+
+
+
+
+ </script>
+ </head>
+ <body>
+ <table cellpadding='0' cellspacing='0'>
+ <tr>
+ <td>
+ <form name='dig'>
+ <table cellpadding='0' cellspacing='0'>
+ <tr>
+ <td>
+ <img name='geomType' id='text' title="Text" src = '../img/button_digitize/text_up.png' onclick='mod_addText(this)'>
+ </td>
+ <td>
+ <img name='geomType' onclick='mod_addLine(this)' id='line' title="Add line" src = '../img/button_digitize/line_up.png'>
+ </td>
+ <td>
+ <img name='geomType' onclick='mod_addPolygon(this)' id='polygon' title="Add polygon" src = '../img/button_digitize/poly_up.png'>
+ </td>
+ <td>
+ <img name='move' onclick='mod_moveNode(this)' id='dragBasePoint' title="Move node" src = '../img/button_digitize/move_disabled.png'>
+ </td>
+ <td>
+ <img name='addNode' onclick='mod_addNode(this)' id='setBasePoint' title="Add node" src = '../img/button_digitize/newNode_disabled.png'>
+ </td>
+ <td>
+ <img name='delNode' onclick='mod_delNode(this)' id='delBasePoint' title="Delete node" src = '../img/button_digitize/delNode_disabled.png'>
+ </td>
+ <td>
+ <img name='del' onclick='mod_delGeom()' id='del' title="Delete all" src = '../img/button_digitize/del_disabled.png'>
+ </td>
+ </tr>
+ <tr>
+ <td colspan = 7>
+ <img name='gml' onclick='mod_addGml()' id='gml' title="Add GML" src = '../img/button_digitize/load_bonn.png'>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+ </html>
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_displayObj.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_displayObj.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_displayObj.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,155 @@
+//$Id: mod_displayObj.js,v 1.9 2006/03/10 08:10:45 astrid_emde Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_displayObj.js,v 1.9 2006/03/10 08:10:45 astrid_emde Exp $
+function mod_displayObj(){
+ var tg = "";
+ tg +="<head><style type='text/css'>";
+ tg +="<!-- body{font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:10pt}";
+ tg +="hr{color:blue;}";
+ tg +="table{border-width:1;font-size:10pt}";
+ tg +="th{background-color:#F08080;text-align:left;}";
+ tg +="tr{background-color:white;}";
+ tg +=".tr_head{font-weight:bold;background-color:silver;}";
+ tg +=".th_wfs{font-weight:bold;background-color:#BDBAF7;text-align:left;}";
+ tg +="--></style></head>";
+
+ var myWin = null;
+ tg += "<body><h3 >Mapbender Metadata</h3>";
+ tg += "<h4 >active maps</h4>";
+
+ for(var i=0; i<mb_mapObj.length; i++){
+ tg += "<h4 >frame: "+ mb_mapObj[i].frameName+"</h4>";
+ tg += "<table border='1' width='98%' rules='rows'><tr>";
+ tg += "<th width='200'>wms:</th><th>request</th></tr>";
+ for(var ii=0; ii<mb_mapObj[i].wms.length; ii++){
+ tg +="<tr><td width='200'>"+mb_mapObj[i].wms[ii].wms_title+"</td><td>";
+ // if the mapURL is not defined or false, don't add a link
+ if (mb_mapObj[i].mapURL[ii] == false || typeof(mb_mapObj[i].mapURL[ii]) == 'undefined' ) {
+ tg += mb_mapObj[i].mapURL[ii];
+ }
+ else {
+ tg += "<a href='"+ mb_mapObj[i].mapURL[ii]+"' target='_blank'>"+ mb_mapObj[i].mapURL[ii]+"</a>";
+ }
+ tg +="</td></tr>";
+ }
+ tg += "</table><br>";
+ }
+
+ tg += "<hr>";
+
+
+ for(var cnt=0; cnt<wms.length;cnt++){
+ tg += "<h4 >WMS: "+ cnt+ ": "+wms[cnt].wms_title+" ("+wms[cnt].wms_abstract+") </h4>";
+ tg += "<table border='1' rules='rows'><tr>";
+ tg += "<th >WMS nr:</th><th>" + cnt+ "</th></tr>";
+ tg += "<tr><td>wms_id:</td><td>" + wms[cnt].wms_id + "</td></tr>";
+ tg += "<tr><td>wms_version:</td><td>" + wms[cnt].wms_version + "</td></tr>";
+ tg += "<tr><td>wms_title: </td><td>" + wms[cnt].wms_title + "</td></tr>";
+ tg += "<tr><td>wms_abstract:</td><td>" + wms[cnt].wms_abstract + "</td></tr>";
+ tg += "<tr><td>wms_getmap: </td><td>" + wms[cnt].wms_getmap + "</td></tr>";
+ tg += "<tr><td>wms_getfeatureinfo: </td><td>" + wms[cnt].wms_getfeatureinfo + "</td></tr>";
+ tg += "<tr><td>wms_getlegendurl: </td><td>" + wms[cnt].wms_getlegendurl + "</td></tr>";
+ tg += "<tr><td>gui_wms_mapformat: </td><td>" + wms[cnt].gui_wms_mapformat + "</td></tr>";
+ tg += "<tr><td>gui_wms_featureinfoformat: </td><td>" + wms[cnt].gui_wms_featureinfoformat + "</td></tr>";
+ tg += "<tr><td>gui_wms_exceptionformat: </td><td>" + wms[cnt].gui_wms_exceptionformat + "</td></tr>";
+ tg += "<tr><td>gui_wms_epsg: </td><td>" + wms[cnt].gui_wms_epsg + "</td></tr>";
+ tg += "<tr><td>gui_wms_visible: </td><td>" + wms[cnt].gui_wms_visible + "</td></tr>" ;
+
+ tg += "<tr class='tr_head'><td>Data: </td><td>.</td></tr>";
+ for(var i=0; i<wms[cnt].data_type.length; i++){
+ tg += "<tr><td>" + wms[cnt].data_type[i] + "</td><td>" + wms[cnt].data_format[i] + "</td></tr>" ;
+ }
+ for(var i=0; i<wms[cnt].gui_epsg.length; i++){
+ tg += "<tr class='tr_head'><td>epsg : </td><td>" + wms[cnt].gui_epsg[i] + "</td></tr>" ;
+ tg += "<tr><td>minx : </td><td>" + wms[cnt].gui_minx[i] + "</td></tr>" ;
+ tg += "<tr><td>miny : </td><td>" + wms[cnt].gui_miny[i] + "</td></tr>" ;
+ tg += "<tr><td>maxx : </td><td>" + wms[cnt].gui_maxx[i] + "</td></tr>" ;
+ tg += "<tr><td>maxy : </td><td>" + wms[cnt].gui_maxy[i]+"</td></tr>" ;
+ }
+
+ tg += "</table><br>";
+
+ tg += "<table border='1' rules='rows'><tr class='tr_head'>";
+ tg += "<td>layer_id</td>";
+ tg += "<td>layer_pos</td>";
+ tg += "<td>layer_parent</td>";
+ tg += "<td>layer_name</td>";
+ tg += "<td>layer_title</td>";
+ tg += "<td>layer_dataurl</td>";
+ tg += "<td>layer_queryable</td>";
+ tg += "<td>layer_minscale</td>";
+ tg += "<td>layer_maxscale</td>";
+ tg += "<td>gui_layer_wms_id</td>";
+ tg += "<td>gui_layer_status</td>";
+ tg += "<td>gui_layer_selectable</td>";
+ tg += "<td>gui_layer_visible</td>";
+ tg += "<td>gui_layer_queryable</td>";
+ tg += "<td>gui_layer_querylayer</td>";
+ tg += "<td>gui_layer_minscale</td>";
+ tg += "<td>gui_layer_maxscale</td>";
+ tg += "</tr>";
+
+ for(var i=0; i<wms[cnt].objLayer.length; i++){
+ tg += "<tr>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_id + "</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_pos + "</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_parent+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_name+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_title+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_dataurl_href+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_queryable+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_minscale+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].layer_maxscale+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].gui_layer_wms_id+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].gui_layer_status+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].gui_layer_selectable+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].gui_layer_visible+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].gui_layer_queryable+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].gui_layer_querylayer+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].gui_layer_minscale+"</td>";
+ tg += "<td>"+wms[cnt].objLayer[i].gui_layer_maxscale+"</td>";
+
+ tg += "</tr>";
+ }
+ tg += "</table><br><br>";
+ }
+
+ if(wfs){
+ tg += "<hr>";
+
+ for(var cnt=0; cnt<wfs.length;cnt++){
+ tg += "<br><h4 style='font-color:blue'>WFS: "+ cnt+ ": "+wfs[cnt].wfs_title+" ("+wfs[cnt].wfs_abstract+") </h4>";
+ tg+="<table border='1' rules='rows'><tr>";
+
+ tg += "<th class='th_wfs' width='200'>WFS nr: </th><th class='th_wfs'>" + cnt+ "</th></tr>";
+ tg += "<tr><td>wfs_id:</td><td> " + wfs[cnt].wfs_id + "</td></tr>";
+ tg += "<tr><td>wfs_version: </td><td>" + wfs[cnt].wfs_version + "</td></tr>";
+ tg += "<tr><td>wfs_title: </td><td>" + wfs[cnt].wfs_title + "</td></tr>";
+ tg += "<tr><td>wfs_abstract:</td><td>" + wfs[cnt].wfs_abstract + "</td></tr>";
+ tg += "<tr><td>wfs_getcapabilities: </td><td><a href='"+ wfs[cnt].wfs_getcapabilities + "&VERSION=1.0.0&request=getcapabilities' target='_blank'>" + wfs[cnt].wfs_getcapabilities + "</a></td></tr>";
+ tg += "<tr><td>wfs_describefeaturetype:</td><td>" + wfs[cnt].wfs_describefeaturetype + "</td></tr>";
+
+ tg += "</table><br>";
+
+
+ tg += "<table border='1' rules='rows' ><tr class='tr_head'>";
+ tg += "<td width='200'>wfs_featuretype</td>";
+ tg += "<td>featuretype_name</td></tr>";
+
+ for(var i=0; i<wfs[cnt].wfs_featuretype.length; i++){
+ tg += "<tr><td>"+i+"</td>";
+ tg += "<td>" + wfs[cnt].wfs_featuretype[i].featuretype_name + "</td>";
+ tg += "<tr>";
+ }
+
+ tg += "</table><br>";
+ }
+
+ }
+ //
+ tg += "<BR></body>";
+ myWin = window.open("","myWin","");
+ myWin.document.open("text/html");
+ myWin.document.write(tg);
+ myWin.document.close();
+ myWin.focus();
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_displayWmc.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_displayWmc.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_displayWmc.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,42 @@
+<?php
+#$Id: mod_displayWmc.php,v 1.7 2006/03/09 08:50:43 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_displayWmc.php,v 1.7 2006/03/09 08:50:43 uli_rothstein Exp $
+# 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.
+
+include_once("../../conf/mapbender.conf");
+
+ $wmc_id = $_GET["wmc_id"];
+
+ if ($wmc_id) {
+ require_once("../classes/class_administration.php");
+ $admin = new administration();
+ $wmc_gml = $admin->getWmcById($wmc_id);
+
+ if ($wmc_gml) {
+ //Display WMC
+
+ header("Content-type: application/xhtml+xml; charset=".CHARSET);
+ echo $wmc_gml;
+ }
+ else {
+ echo "Invalid document!";
+ }
+ }
+
+
+?>
+
Added: trunk/mapbender/http/javascripts/mod_dragMapSize.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_dragMapSize.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_dragMapSize.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,93 @@
+<?php
+#$Id: mod_dragMapSize.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_dragMapSize.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'dragMapSize' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+echo "var mod_dragMapSize_target = '".$e_target."';";
+if($cnt > 1){ echo "alert('dragMapSize: ID not unique!');";}
+?>
+var mod_dagMapSize_offset = 15;
+var mod_dagMapSize_active = false;
+mb_registerInitFunctions("mod_dragMapSize_init()");
+mb_registerSubFunctions("mod_dragMapSize_arrange()");
+function mod_dragMapSize_arrange(){
+ var left = parseInt(document.getElementById(mod_dragMapSize_target).style.left) + parseInt(document.getElementById(mod_dragMapSize_target).style.width) + mod_dagMapSize_offset - (parseInt(document.getElementById('dragMapSize').style.width)/2);
+ var top = parseInt(document.getElementById(mod_dragMapSize_target).style.top) + parseInt(document.getElementById(mod_dragMapSize_target).style.height) + mod_dagMapSize_offset - (parseInt(document.getElementById('dragMapSize').style.height)/2);
+ mb_arrangeElement('','dragMapSize' , left, top);
+}
+function mod_dragMapSize_init(){
+ var el = document.getElementById("dragMapSize");
+ el.onmousedown = mod_dragMapSize_down;
+ mod_dragMapSize_arrange();
+}
+
+function mod_dragMapSize_down(e){
+ if(mod_dagMapSize_active == false){
+ document.onmouseup = mod_dragMapSize_up;
+ document.onmousemove = mod_dragMapSize_drag;
+ mb_getMousePos(e);
+ mb_start_x=clickX;
+ mb_start_y=clickY;
+ mb_end_x = clickX;
+ mb_end_y = clickY;
+ mod_dagMapSize_active = true;
+ return false;
+ }
+}
+function mod_dragMapSize_up(e){
+ document.onmouseup = null;
+ document.onmousemove = null;
+ mod_dagMapSize_active = false;
+ mb_getMousePos(e);
+ mb_end_x = clickX;
+ mb_end_y = clickY;
+ var ind = getMapObjIndexByName(mod_dragMapSize_target);
+ var dif_x = (parseFloat(mb_end_x) - parseFloat(mb_start_x));
+ var dif_y = (parseFloat(mb_end_y) - parseFloat(mb_start_y));
+ var pos = makeClickPos2RealWorldPos(mod_dragMapSize_target, (parseFloat(mb_mapObj[ind].width) + parseFloat(dif_x)), (parseFloat(mb_mapObj[ind].height) + parseFloat(dif_y)));
+ mb_mapObj[ind].width = parseFloat(mb_mapObj[ind].width) + parseFloat(dif_x);
+ mb_mapObj[ind].height = parseFloat(mb_mapObj[ind].height) + parseFloat(dif_y);
+ document.getElementById(mod_dragMapSize_target).style.width = mb_mapObj[ind].width;
+ document.getElementById(mod_dragMapSize_target).style.height = mb_mapObj[ind].height;
+ window.frames[mod_dragMapSize_target].document.getElementById("maps").style.width = mb_mapObj[ind].width;
+ window.frames[mod_dragMapSize_target].document.getElementById("maps").style.height = mb_mapObj[ind].height;
+ var mybbox = mb_mapObj[ind].extent.split(",");
+ mb_mapObj[ind].extent = mybbox[0] + "," + pos[1] + "," + pos[0] + "," + mybbox[3];
+ setMapRequest(mod_dragMapSize_target);
+}
+function mod_dragMapSize_drag(e){
+ if(mod_dagMapSize_active){
+ mb_getMousePos(e);
+ mb_end_x = clickX;
+ mb_end_y = clickY;
+ var dif_x = mb_start_x + (mb_end_x - mb_start_x) - (parseInt(document.getElementById('dragMapSize').style.width)/2);
+ var dif_y = mb_start_y + (mb_end_y - mb_start_y) - (parseInt(document.getElementById('dragMapSize').style.height)/2);
+ mb_arrangeElement('', "dragMapSize", dif_x, dif_y);
+ }
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_embedded_legend.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_embedded_legend.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_embedded_legend.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,66 @@
+<?php
+#$Id: mod_embedded_legend.php,v 1.11 2006/03/09 08:56:36 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_embedded_legend.php,v 1.11 2006/03/09 08:56:36 uli_rothstein Exp $
+# 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.
+session_start();
+require_once("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Legend</title>
+<?php
+
+$gui_id = $_SESSION["mb_user_gui"];
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+include_once '../include/dyn_css.php';
+
+$sql = "SELECT DISTINCT e_target, e_width, e_height FROM gui_element WHERE e_id = 'legend_embedded' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('legend: ID not unique!');";}
+#target position, with and height...
+$sql = "SELECT e_left,e_top,e_width,e_height FROM gui_element WHERE e_id = '".$e_target."' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+
+echo "<script type='text/javascript'>";
+echo "var mod_legend_target = '".$e_target."';";
+echo "var mod_legend_target_left = ".db_result($res,0,"e_left").";";
+echo "var mod_legend_target_top = ".db_result($res,0,"e_top").";";
+echo "var mod_legend_target_width = ".db_result($res,0,"e_width").";";
+echo "var mod_legend_target_height = ".db_result($res,0,"e_height").";";
+
+echo "</script>";
+?>
+</head>
+<body onload='mod_legend_init()'>
+<form><span class='switch'>Legende ON/OFF<input type='checkbox' name='sw' onclick='mod_legend_repaint(this)'></span></form>
+<div name='leg' id='leg'></div>
+</body>
+</html>
Added: trunk/mapbender/http/javascripts/mod_export_image.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_export_image.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_export_image.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,255 @@
+<?php
+#$Id: mod_export_image.php,v 1.8 2006/03/09 08:55:45 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_export_image.php,v 1.8 2006/03/09 08:55:45 uli_rothstein Exp $
+# 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.
+include("../../conf/mapbender.conf");
+session_start();
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Druck</title>
+</head>
+<style type="text/css">
+ <!--
+
+ select{
+ width:180px;
+ }
+ .textField{
+ width: 180px;
+ }
+ body{
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ }
+ -->
+</style>
+<?php
+/******Name of this module**************/
+$mb_module_id = "print1";
+/**********************************/
+include("../../conf/print.conf");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT * from gui_element WHERE fkey_gui_id = '".$_SESSION["mb_user_gui"]."' AND e_id = '".$mb_module_id."'";
+$res = db_query($sql);
+
+echo "<script type='text/javascript'>";
+#echo "var mb_user_resolution = ".$_SESSION["mb_user_resolution"]." / 2.54;";
+echo "var deformation = ".$deformation.";";
+#echo "var DPC = 28.35 * deformation;";
+echo "var DPC = 28.35;";
+echo "var a4_width = " . $a4_width . " * DPC;";
+echo "var a4_height = " . $a4_height . " * DPC;";
+echo "var a3_width = " . $a3_width . " * DPC;";
+echo "var a3_height = " . $a3_height . " * DPC;";
+
+
+
+echo "var border_Portrait_a4_left = " . $border_Portrait_a4_left . " * DPC;";
+echo "var border_Portrait_a4_top = " . $border_Portrait_a4_top . " * DPC;";
+echo "var border_Portrait_a4_right = " . $border_Portrait_a4_right . " * DPC;";
+echo "var border_Portrait_a4_bottom = " . $border_Portrait_a4_bottom . " * DPC;";
+echo "var header_Portrait_a4_height = " . $header_Portrait_a4_height . " * DPC;";
+
+echo "var border_Landscape_a4_left = " . $border_Landscape_a4_left . " * DPC;";
+echo "var border_Landscape_a4_top = " . $border_Landscape_a4_top . " * DPC;";
+echo "var border_Landscape_a4_right = " . $border_Landscape_a4_right . " * DPC;";
+echo "var border_Landscape_a4_bottom = " . $border_Landscape_a4_bottom . " * DPC;";
+echo "var header_Landscape_a4_height = " . $header_Landscape_a4_height . " * DPC;";
+
+echo "var border_Portrait_a3_left = " . $border_Portrait_a3_left . " * DPC;";
+echo "var border_Portrait_a3_top = " . $border_Portrait_a3_top . " * DPC;";
+echo "var border_Portrait_a3_right = " . $border_Portrait_a3_right . " * DPC;";
+echo "var border_Portrait_a3_bottom = " . $border_Portrait_a3_bottom . " * DPC;";
+echo "var header_Portrait_a3_height = " . $header_Portrait_a3_height . " * DPC;";
+
+echo "var border_Landscape_a3_left = " . $border_Landscape_a3_left . " * DPC;";
+echo "var border_Landscape_a3_top = " . $border_Landscape_a3_top . " * DPC;";
+echo "var border_Landscape_a3_right = " . $border_Landscape_a3_right . " * DPC;";
+echo "var border_Landscape_a3_bottom = " . $border_Landscape_a3_bottom . " * DPC;";
+echo "var header_Landscape_a3_height = " . $header_Landscape_a3_height . " * DPC;";
+
+echo "var mod_print1_target = '".db_result($res,0,"e_target")."';";
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+/******PARAMS********************/
+var mb_resolution = null;
+var ind_size = null;
+var ind_format = null;
+
+/**END*PARAMS********************/
+
+function validate(){
+ //window.opener.mb_resolution = DPC;
+ ind_size = document.form1.size.selectedIndex;
+ ind_format = document.form1.format.selectedIndex;
+
+ if(ind_size != 0 && ind_format != 0){
+ var ind = window.opener.getMapObjIndexByName(mod_print1_target);
+ var coord = window.opener.mb_mapObj[ind].extent.split(",");
+ var centerX = parseInt(coord[0]) + (parseInt(coord[2]) - parseInt(coord[0]))/2
+ var centerY = parseInt(coord[1]) + (parseInt(coord[3]) - parseInt(coord[1]))/2
+ if(document.form1.size.options[ind_size].value == "A4" && document.form1.format.options[ind_format].value == "portrait"){
+ document.form1.page_width.value = a4_width;
+ document.form1.page_height.value = a4_height;
+ document.form1.printOffset_left.value = border_Portrait_a4_left;
+ document.form1.printOffset_top.value = border_Portrait_a4_top;
+ document.form1.map_width.value = Math.round(a4_width - border_Portrait_a4_left - border_Portrait_a4_right);
+ document.form1.map_height.value = Math.round(a4_height - border_Portrait_a4_top - border_Portrait_a4_bottom - header_Portrait_a4_height);
+ document.form1.header_height.value = header_Portrait_a4_height;
+ }
+ if(document.form1.size.options[ind_size].value == "A4" && document.form1.format.options[ind_format].value == "landscape"){
+ document.form1.page_width.value = a4_height;
+ document.form1.page_height.value = a4_width;
+ document.form1.printOffset_left.value = border_Landscape_a4_left;
+ document.form1.printOffset_top.value = border_Landscape_a4_top;
+ document.form1.map_width.value = Math.round(a4_height - border_Landscape_a4_left - border_Landscape_a4_right);
+ document.form1.map_height.value = Math.round(a4_width - border_Landscape_a4_top - border_Landscape_a4_bottom - header_Landscape_a4_height);
+ document.form1.header_height.value = header_Landscape_a4_height;
+ }
+ if(document.form1.size.options[ind_size].value == "A3" && document.form1.format.options[ind_format].value == "portrait"){
+ document.form1.page_width.value = a3_width;
+ document.form1.page_height.value = a3_height;
+ document.form1.printOffset_left.value = border_Portrait_a3_left;
+ document.form1.printOffset_top.value = border_Portrait_a3_top;
+ document.form1.map_width.value = Math.round(a3_width - border_Portrait_a3_left - border_Portrait_a3_right);
+ document.form1.map_height.value = Math.round(a3_height - border_Portrait_a3_top - border_Portrait_a3_bottom - header_Portrait_a3_height);
+ document.form1.header_height.value = header_Portrait_a3_height;
+ }
+ if(document.form1.size.options[ind_size].value == "A3" && document.form1.format.options[ind_format].value == "landscape"){
+ document.form1.page_width.value = a3_height;
+ document.form1.page_height.value = a3_width;
+ document.form1.printOffset_left.value = border_Landscape_a3_left;
+ document.form1.printOffset_top.value = border_Landscape_a3_top;
+ document.form1.map_width.value = Math.round(a3_height - border_Landscape_a3_left - border_Landscape_a3_right);
+ document.form1.map_height.value = Math.round(a3_width - border_Landscape_a3_top - border_Landscape_a3_bottom - header_Landscape_a3_height);
+ document.form1.header_height.value = header_Landscape_a3_height;
+ }
+ var pos = window.opener.makeClickPos2RealWorldPos(mod_print1_target, document.form1.map_width.value , document.form1.map_height.value );
+ window.opener.mb_mapObj[ind].width = document.form1.map_width.value;
+ window.opener.mb_mapObj[ind].height = document.form1.map_height.value;
+ window.opener.document.getElementById(mod_print1_target).style.width = document.form1.map_width.value;
+ window.opener.document.getElementById(mod_print1_target).style.height = document.form1.map_height.value;
+ window.opener.window.frames[mod_print1_target].document.getElementById("maps").style.width = document.form1.map_width.value;
+ window.opener.window.frames[mod_print1_target].document.getElementById("maps").style.height = document.form1.map_height.value;
+
+ window.opener.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," + coord[3];
+ window.opener.setMapRequest(mod_print1_target);
+ }
+}
+function refreshParams(){
+ var ind = window.opener.getMapObjIndexByName(mod_print1_target);
+ document.form1.map_url.value = "";
+ var cnt_urls = 0;
+ for(var i=0; i<window.opener.mb_mapObj[ind].wms.length; i++){
+ if(window.opener.mb_mapObj[ind].wms[i].mapURL != false){
+ if(cnt_urls > 0){document.form1.map_url.value += "###";}
+ if(window.opener.mb_mapObj[ind].wms[i].mapURL.charAt(0) == '/' && window.opener.mb_mapObj[ind].wms[i].mapURL.charAt(1) == 'c')
+ {
+ document.form1.map_url.value += 'http://localhost' + window.opener.mb_mapObj[ind].wms[i].mapURL;
+ }
+ else
+ {
+ document.form1.map_url.value += window.opener.mb_mapObj[ind].wms[i].mapURL;
+ }
+ cnt_urls++;
+ }
+ }
+ document.form1.map_extent.value = window.opener.mb_mapObj[ind].extent;
+ document.form1.map_scale.value = window.opener.mb_getScale(mod_print1_target);
+}
+function printMap(){
+ // if(ind_size > 0 && ind_format >0){
+ refreshParams();
+ document.form1.submit();
+ //disablePrinting();
+ //}
+ //else{
+ // alert("Das Format ist noch nicht ausgewählt.");
+ //}
+ // window.opener.mod_back_set();
+}
+function disablePrinting(){
+ //window.opener.mb_resolution = mb_user_resolution;
+ window.close();
+}
+// -->
+</script>
+<body onunload="disablePrinting()">
+<form name='form1' method='POST' action='../php/mod_export_image.php?<?php echo SID; ?>' >
+<table border='0'>
+<tr>
+ <td align="center">
+ <table border='0'>
+ <tr>
+ <td class="text">
+ Vergrößerungsfaktor
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ <select name='quality'>
+ <option value='1'>gering</option>
+ <option value='2'>mittel</option>
+ <option value='4'>hoch</option>
+ <option value='16.6'>sehr hoch</option>
+ <!-- <option value='<?php #echo $printFactor; ?>'>hoch</option> -->
+ </select>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <input type='button' class="button" name='print' value="Speichern" onclick='printMap()'>
+ </td>
+</tr>
+<tr>
+<td>
+
+</td>
+</tr>
+
+</table>
+</table>
+<input type='hidden' name='printOffset_left' value=''>
+<input type='hidden' name='printOffset_top' value=''>
+<input type='hidden' name='map_width' value=''>
+<input type='hidden' name='map_height' value=''>
+<input type='hidden' name='page_width' value=''>
+<input type='hidden' name='page_height' value=''>
+<input type='hidden' name='header_height' value=''>
+<input type='hidden' name='map_url' value=''>
+<input type='hidden' name='map_extent' value=''>
+<input type='hidden' name='map_scale' value=''>
+<!-- <input type='hidden' name='footer' value='<?php echo $footer ?>'> -->
+
+</form>
+</body>
+</html>
Added: trunk/mapbender/http/javascripts/mod_featureInfo.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_featureInfo.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_featureInfo.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,72 @@
+<?php
+#$Id: mod_featureInfo.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_featureInfo.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'featureInfo1' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('featureInfo1: ID not unique!');";}
+?>
+var mod_featureInfo_elName = "featureInfo1";
+var mod_featureInfo_frameName = "";
+var mod_featureInfo_target = "<?php echo $e_target; ?>";
+
+var mod_featureInfo_img_on = new Image(); mod_featureInfo_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_featureInfo_img_off = new Image(); mod_featureInfo_img_off.src ="<?php echo $e_src; ?>";
+var mod_featureInfo_img_over = new Image(); mod_featureInfo_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_featureInfo1(ind){
+ mb_button[ind] = document.getElementById(mod_featureInfo_elName);
+ mb_button[ind].img_over = mod_featureInfo_img_over.src;
+ mb_button[ind].img_on = mod_featureInfo_img_on.src;
+ mb_button[ind].img_off = mod_featureInfo_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_featureInfo_elName;
+ mb_button[ind].fName = mod_featureInfo_frameName;
+ mb_button[ind].go = new Function ("mod_featureInfo_click()");
+ mb_button[ind].stop = new Function ("mod_featureInfo_disable()");
+}
+function mod_featureInfo_click(){
+ window.frames[mod_featureInfo_target].document.onclick = mod_featureInfo_event;
+}
+function mod_featureInfo_disable(){
+ window.frames[mod_featureInfo_target].document.onclick = null;
+}
+function mod_featureInfo_event(e){
+ if(ie){
+ clickX = window.frames[mod_featureInfo_target].event.clientX;
+ clickY = window.frames[mod_featureInfo_target].event.clientY;
+
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ setFeatureInfoRequest(mod_featureInfo_target,clickX,clickY);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_featureInfoRedirect.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_featureInfoRedirect.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_featureInfoRedirect.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,67 @@
+<?php
+#$Id: mod_featureInfoRedirect.php,v 1.2 2005/09/13 14:38:11 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_featureInfoRedirect.php,v 1.2 2005/09/13 14:38:11 bjoern_heuser Exp $
+# 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.
+?>
+
+/*
+* sticky IFRAME, right from the main mapframe "mapframe1"
+*/
+
+mb_registerSubFunctions("mod_featureInfoRedirect_position()");
+mb_registerFeatureInfoPreFunctions("mod_featureInfoRedirect_set(fName)");
+
+function mod_featureInfoRedirect_set(fName){
+ var ind = getMapObjIndexByName("mapframe1");
+ var res = new Array();
+ for(var i=0; i<mb_mapObj[ind].wms.length; i++){
+ if(mb_mapObj[ind].querylayers[i] != ""){
+ res[res.length] = mb_mapObj[ind].wms[i].wms_id;
+ }
+ }
+
+ var newWin = document.getElementById("FeatureInfoRedirect").style;
+ var width = parseInt(newWin.width);
+ var height = parseInt(newWin.height) / res.length;
+
+ window.frames["FeatureInfoRedirect"].document.open("text/html");
+ for(i=0; i<res.length; i++){
+ var top = i * height;
+ window.frames["FeatureInfoRedirect"].document.write("<iframe src='' id='"+res[i]+"' style='position:absolute;top:"+top+"px;left:0px;width:"+width+"px;height:"+height+"px' frameborder='0'></iframe>");
+ }
+ window.frames["FeatureInfoRedirect"].document.close();
+}
+
+function mod_featureInfoRedirect_position(){
+ var leftOffset = 10;
+ var borderOffset = 10;
+ var width = 450;
+
+ var newWin = document.getElementById("FeatureInfoRedirect").style;
+ var mapframe = document.getElementById("mapframe1").style;
+
+ newWin.left = parseInt(mapframe.left) + parseInt(mapframe.width) + leftOffset;
+ newWin.top = parseInt(mapframe.top) - borderOffset;
+ newWin.width = width;
+ newWin.height = parseInt(mapframe.height) + 2 * borderOffset;
+
+ var resWin = window.frames["FeatureInfoRedirect"].document.getElementsByTagName("iframe");
+
+ for(var i=0; i<resWin.length; i++){
+ resWin[i].style.height = parseInt(newWin.height) / resWin.length;
+ }
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_featureInfoTunnel.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,71 @@
+<?php
+#$Id: mod_featureInfoTunnel.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_featureInfoTunnel.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'featureInfoTunnel' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('featureInfoTunnel: ID not unique!');";}
+?>
+var mod_featureInfoTunnel_elName = "featureInfoTunnel";
+var mod_featureInfoTunnel_frameName = "";
+var mod_featureInfoTunnel_target = "<?php echo $e_target; ?>";
+
+var mod_featureInfoTunnel_img_on = new Image(); mod_featureInfoTunnel_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_featureInfoTunnel_img_off = new Image(); mod_featureInfoTunnel_img_off.src ="<?php echo $e_src; ?>";
+var mod_featureInfoTunnel_img_over = new Image(); mod_featureInfoTunnel_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_featureInfoTunnel(ind){
+ mb_button[ind] = document.getElementById(mod_featureInfoTunnel_elName);
+ mb_button[ind].img_over = mod_featureInfoTunnel_img_over.src;
+ mb_button[ind].img_on = mod_featureInfoTunnel_img_on.src;
+ mb_button[ind].img_off = mod_featureInfoTunnel_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_featureInfoTunnel_elName;
+ mb_button[ind].fName = mod_featureInfoTunnel_frameName;
+ mb_button[ind].go = new Function ("mod_featureInfoTunnel_click()");
+ mb_button[ind].stop = new Function ("mod_featureInfoTunnel_disable()");
+}
+function mod_featureInfoTunnel_click(){
+ window.frames[mod_featureInfoTunnel_target].document.onclick = mod_featureInfoTunnel_event;
+}
+function mod_featureInfoTunnel_disable(){
+ window.frames[mod_featureInfoTunnel_target].document.onclick = null;
+}
+function mod_featureInfoTunnel_event(e){
+ if(ie){
+ clickX = window.frames[mod_featureInfoTunnel_target].event.clientX;
+ clickY = window.frames[mod_featureInfoTunnel_target].event.clientY;
+
+ }
+ else{
+ clickX = e.pageX;
+ clickY = e.pageY;
+ }
+ setFeatureInfoRequest(mod_featureInfoTunnel_target,clickX,clickY, '../extensions/ext_featureInfoTunnel.php');
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_forward.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_forward.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_forward.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,133 @@
+<?php
+#$Id: mod_forward.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_forward.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'forward' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = split(",",$row["e_target"]);
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('forward: ID not unique!');";}
+echo "var mod_forward_map = '".$e_target[0]."';";
+echo "var mod_forward_overview = '".$e_target[1]."';";
+
+?>
+var mb_MapFutureObj = new Array();
+var mod_forward_img_off = new Image(); mod_forward_img_off.src = "<?php echo preg_replace("/_off_disabled/","_off",$e_src); ?>";
+var mod_forward_img_off_disabled = new Image(); mod_forward_img_off_disabled.src = "<?php echo $e_src; ?>";
+var mod_forward_img_over = new Image(); mod_forward_img_over.src = "<?php echo preg_replace("/_off_disabled/","_over",$e_src); ?>";
+var mod_forward_img_previous = mod_forward_img_off_disabled.src;
+var mod_forward_cnt = 0;
+var mod_forward_hist_cnt = 0;
+mb_registerSubFunctions("mod_forward_check(frameName)");
+function mod_forward_check(frameName){
+ if(mb_MapFutureObj[frameName] == null){
+ mb_MapFutureObj[frameName] = new Array();
+ }
+ if(frameName == mod_forward_map){
+ if(mb_MapFutureObj[mod_forward_map].length > 0){
+ document.getElementById("forward").src = mod_forward_img_off.src;
+ }
+ else{
+ document.getElementById("forward").src = mod_forward_img_off_disabled.src;
+ mod_forward_img_previous = document.getElementById("forward").src;
+ }
+ }
+ if(mb_MapHistoryObj[mod_forward_map]){
+ if(mb_MapHistoryObj[mod_forward_map].length > mod_forward_hist_cnt && mb_MapFutureObj[mod_forward_map].length == mod_forward_cnt){
+ mod_forward_reset();
+ }
+ mod_forward_cnt = mb_MapFutureObj[mod_forward_map].length;
+ mod_forward_hist_cnt = mb_MapHistoryObj[mod_forward_map].length;
+ }
+}
+function mod_forward_reset(){
+ if(mb_MapHistoryObj[mod_forward_map].length > 0){
+ mb_MapFutureObj[mod_forward_map] = new Array();
+ document.getElementById("forward").src = mod_forward_img_off_disabled.src;
+ mod_forward_img_previous = document.getElementById("forward").src;
+ }
+}
+function mod_forward_over(obj){
+ mod_forward_img_previous = document.getElementById("forward").src;
+ if(document.getElementById("forward").src == mod_forward_img_off.src){
+ document.getElementById("forward").src = mod_forward_img_over.src;
+ }
+}
+function mod_forward_out(obj){
+ document.getElementById("forward").src = mod_forward_img_previous;
+}
+function mod_forward_set(){
+ if(mod_forward_img_previous == mod_forward_img_off.src){
+ var ind = getMapObjIndexByName(mod_forward_map);
+ var cnt = mb_MapFutureObj[mod_forward_map].length - 1;
+ if(mb_mapObj[ind].epsg != mb_MapFutureObj[mod_forward_map][cnt].epsg){
+ var oind = getMapObjIndexByName(mod_forward_overview);
+ for(var i=0; i<mb_MapHistoryObj[mod_forward_overview].length; i++){
+ if(mb_MapHistoryObj[mod_forward_overview][i].epsg == mb_MapFutureObj[mod_forward_map][cnt].epsg){
+ mb_mapObj[oind].epsg = mb_MapHistoryObj[mod_forward_overview][i].epsg;
+ mb_mapObj[oind].extent = mb_MapHistoryObj[mod_forward_overview][i].extent;
+ setMapRequest(mod_forward_overview);
+ break;
+ }
+ }
+ }
+ document.getElementById(mod_forward_map).style.width = mb_MapFutureObj[mod_forward_map][cnt].width;
+ document.getElementById(mod_forward_map).style.height = mb_MapFutureObj[mod_forward_map][cnt].height;
+ mb_mapObj[ind].width = mb_MapFutureObj[mod_forward_map][cnt].width;
+ mb_mapObj[ind].height = mb_MapFutureObj[mod_forward_map][cnt].height;
+ mb_mapObj[ind].epsg = mb_MapFutureObj[mod_forward_map][cnt].epsg;
+ mb_mapObj[ind].extent = mb_MapFutureObj[mod_forward_map][cnt].extent;
+ mb_mapObj[ind].layers = mb_MapFutureObj[mod_forward_map][cnt].layers;
+ mb_mapObj[ind].styles = mb_MapFutureObj[mod_forward_map][cnt].styles;
+ mb_mapObj[ind].querylayers = mb_MapFutureObj[mod_forward_map][cnt].querylayers;
+ mb_MapFutureObj[mod_forward_map].length = (mb_MapFutureObj[mod_forward_map].length - 1);
+ setMapRequest(mod_forward_map);
+ }
+}
+function mb_setFutureObj(frameName){
+ var ind = getMapObjIndexByName(frameName);
+ var cnt = mb_MapFutureObj[frameName].length;
+ mb_MapFutureObj[frameName][cnt] = new Object();
+ mb_MapFutureObj[frameName][cnt].reqCnt = mod_back_cnt;
+ mb_MapFutureObj[frameName][cnt].width = mb_mapObj[ind].width;
+ mb_MapFutureObj[frameName][cnt].height = mb_mapObj[ind].height;
+ mb_MapFutureObj[frameName][cnt].epsg = mb_mapObj[ind].epsg;
+ mb_MapFutureObj[frameName][cnt].extent = mb_mapObj[ind].extent;
+ mb_MapFutureObj[frameName][cnt].layers = new Array();
+ for(var i=0; i<mb_mapObj[ind].layers.length;i++){
+ mb_MapFutureObj[frameName][cnt].layers[i] = mb_mapObj[ind].layers[i];
+ }
+ mb_MapFutureObj[frameName][cnt].styles = new Array();
+ for(var i=0; i<mb_mapObj[ind].styles.length;i++){
+ mb_MapFutureObj[frameName][cnt].styles[i] = mb_mapObj[ind].styles[i];
+ }
+ mb_MapFutureObj[frameName][cnt].querylayers = new Array();
+ for(var i=0; i<mb_mapObj[ind].querylayers.length;i++){
+ mb_MapFutureObj[frameName][cnt].querylayers[i] = mb_mapObj[ind].querylayers[i];
+ }
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_getArea.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_getArea.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_getArea.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,84 @@
+<?php
+#$Id: mod_getArea.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_getArea.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'getArea' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('copyright: ID not unique!');";}
+echo "var mod_getArea_target = '".$e_target."';";
+?>
+var mod_getArea_img = new Image();
+mod_getArea_img.src = "../img/button_gray/getArea_off.gif";
+register_measureSubFunctions("mod_getArea()");
+
+function mod_getArea(){
+ var str = "<div style='position:absolute;top:50px' onmouseup='parent.mod_getArea_go()' ";
+ str += "onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_disableTimeout()'><img src='"+mod_getArea_img.src+"'></div>";
+ return str;
+}
+function mod_getArea_go(){
+ if(mod_measure_RX[mod_measure_RX.length -1] == mod_measure_RX[0] && mod_measure_RY[mod_measure_RY.length -1] == mod_measure_RY[0]){
+ var ind = getMapObjIndexByName(mod_getArea_target);
+ var url = "../php/mod_evalArea.php?x=";
+ for(var i=0; i<mod_measure_RX.length;i++){
+ if(i>0){ url += ",";}
+ url += mod_measure_RX[i];
+ }
+ url += "&y=";
+ for(var i=0; i<mod_measure_RY.length;i++){
+ if(i>0){ url += ",";}
+ url += mod_measure_RY[i];
+ }
+ var srs = mb_mapObj[ind].epsg.split(":");
+ url += "&srs="+ escape(srs[1]);
+ url += "&length=" + mod_measure_TotalDist[mod_measure_TotalDist.length-1];
+ url += "&distance=" + mod_measure_TotalDist[mod_measure_TotalDist.length-2];
+ if(!mod_measure_win || mod_measure_win == null || mod_measure_win.closed == true){
+ mod_measure_win = window.open(url,"mod_measure_win","width=200,height=150,resizable=yes");
+ }
+ else{
+ mod_measure_win.document.location.href = url;
+ }
+ mod_measure_win.focus();
+ }
+ else{
+ if(!mod_measure_win || mod_measure_win == null || mod_measure_win.closed == true){
+ mod_measure_win = window.open("","mod_measure_win","width=200,height=150,resizable=yes");
+ mod_measure_win.document.open("text/html");
+ mod_measure_win.document.write("<span style = 'font-family : Arial, Helvetica, sans-serif;font-size : 12px;font-weight : bold;';>Strecke: " +mod_measure_TotalDist[mod_measure_TotalDist.length-1]+" m</span>");
+ mod_measure_win.document.close();
+ }
+ else{
+ mod_measure_win.document.open("text/html");
+ mod_measure_win.document.write("<span style = 'font-family : Arial, Helvetica, sans-serif;font-size : 12px;font-weight : bold;';>Strecke: " +mod_measure_TotalDist[mod_measure_TotalDist.length-1]+" m</span>");
+ mod_measure_win.document.close();
+ }
+ mod_measure_win.focus();
+ }
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_insertWmcIntoDb.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,77 @@
+<?php
+#$Id: mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein Exp $
+# 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.
+
+include("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<!--
+Licensing: See the GNU General Public License for more details.
+http://www.gnu.org/copyleft/gpl.html
+or:
+mapbender/licence/
+-->
+
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>MB2 - <?php echo $_REQUEST["gui_id"];?></title>
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+</head>
+<body>
+</body>
+</html>
+<?php
+if ($_POST["data"]) {
+ $d = explode("____", $_POST["data"]);
+ // Display WMC
+ //echo "<pre>" . stripslashes($d[2]) . "</pre>";
+
+ $sql = "INSERT INTO mb_user_wmc VALUES ('" . $d[3] . "', '" . $d[0] . "', '" . char_encode(str_replace("&", "&" , html_entity_decode($d[2]))) . "', '" . $d[1] . "', '" . time() . "')";
+
+
+ $res = db_query($sql);
+ if ($d[1]) {
+ $wmc_title = "'" . $d[1] . "' ";
+ }
+ if (db_error()) {
+ echo "<script>var title = \"" . $wmc_title . "\";alert(\"Error while saving WMC document \" + title + \"!\");</script>";
+ }
+ else {
+ echo "<script>var title = \"" . $wmc_title . "\";alert(\"WMC document \" + title + \"has been saved!\")</script>";
+ }
+}
+function char_encode($s){
+ if(CHARSET == 'UTF-8'){
+ $s = utf8_encode($s);
+ }
+ return $s;
+}
+?>
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_key.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_key.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_key.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,68 @@
+<?php
+#$Id: mod_key.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_key.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+require_once("../../conf/mapbender.conf");
+$gui_id = $_REQUEST["gui_id"];
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'keyHandler' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('keyHandler: ID not unique!');";}
+echo "var mod_key_map = '".$e_target."';";
+
+$sql = "SELECT e_id,e_element FROM gui_element WHERE (e_element = 'body' or e_element = 'iframe') AND fkey_gui_id = '".$gui_id."' AND e_public = 1";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $ids[$cnt] = $row["e_id"];
+ $elements[$cnt] = $row["e_element"];
+ $cnt++;
+}
+
+echo "var mb_key_elements = new Array(";
+for($i=0; $i < count($elements); $i++){
+ if($i > 0){ echo ",";}
+ echo "'".$elements[$i]."'";
+}
+echo ");";
+echo "var mb_key_ids = new Array(";
+for($i=0; $i < count($ids); $i++){
+ if($i > 0){ echo ",";}
+ echo "'".$ids[$i]."'";
+}
+echo ");";
+?>
+if(ie){
+ mb_registerInitFunctions('mod_key_init()');
+}
+function mod_key_init(){
+ for(var i=0; i<mb_key_elements.length; i++){
+ if(mb_key_elements[i] == "body"){
+ document.getElementById(mb_key_ids[i]).onkeydown = mod_key_Keyhandler;
+ }
+ else{
+ window.frames[mb_key_ids[i]].document.getElementsByTagName("body")[0].onkeydown = new Function("mod_key_Keyhandler('" +mb_key_ids[i] + "');");
+ }
+ }
+}
+function mod_key_Keyhandler(frameName){
+ if(frameName){
+ var code = eval("window.frames['"+frameName+"'].event.keyCode");
+ focus();
+ }
+ else{
+ var code = event.keyCode;
+ }
+ if(code == 187 || code == 107){ zoom(mod_key_map,true, '2.0'); }
+ if(code == 189 || code == 109){ zoom(mod_key_map,false, '2.0');}
+ if(code == 32 || code == 13){setMapRequest(mod_key_map);}
+ if(code == 37){mb_panMap(mod_key_map,"W");}
+ if(code == 38){mb_panMap(mod_key_map,"N");}
+ if(code == 39){mb_panMap(mod_key_map,"E");}
+ if(code == 40){mb_panMap(mod_key_map,"S");}
+}
Added: trunk/mapbender/http/javascripts/mod_legend.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_legend.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_legend.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,218 @@
+<?php
+# Copyright (C) 2005 CCGIS / terrestris
+#
+# 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("../../conf/mapbender.conf");
+session_start();
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Legend</title>
+<?php
+include '../include/dyn_css.php';
+
+$sql = "SELECT DISTINCT e_target, e_width, e_height FROM gui_element WHERE e_id = '".$_REQUEST["e_id_css"]."' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('legend: ID not unique!');";}
+#target position, with and height...
+$sql2 = "SELECT e_left,e_top,e_width,e_height FROM gui_element WHERE e_id = '".$e_target."' AND fkey_gui_id = '".$gui_id."'";
+$res2 = db_query($sql2);
+echo "<script type='text/javascript'>\n";
+echo "var mod_legend_target = '".$e_target."';\n";
+echo "var mod_legend_target_left = ".db_result($res2,0,"e_left").";\n";
+echo "var mod_legend_target_top = ".db_result($res2,0,"e_top").";\n";
+echo "var mod_legend_target_width = ".db_result($res2,0,"e_width").";\n";
+echo "var mod_legend_target_height = ".db_result($res2,0,"e_height").";\n";
+echo "</script>\n";
+?>
+
+<script type="text/javascript">
+<!--
+mod_legend_offsetLeft = 25;
+mod_legend_offsetTop = -10;
+
+try{
+ if (checkbox_on_off){}
+}
+catch(e){
+ checkbox_on_off = 'false';
+}
+
+try{
+ if (stickylegend){}
+}
+catch(e){
+ stickylegend = 'false';
+}
+
+parent.mb_registerSubFunctions("window.frames['legend'].mod_legend_pos()");
+
+
+function mod_legend_init(){
+ var obj = parent.document.getElementById("legend");
+ obj.style.top = mod_legend_target_top + mod_legend_offsetTop;
+ obj.style.left = mod_legend_target_left + mod_legend_target_width + mod_legend_offsetLeft;
+ var checkobj = document.getElementById("checkboxstyle");
+ if (checkbox_on_off == 'false'){
+ checkobj.style.visibility = "hidden";
+ checkobj.style.width = 0;
+ checkobj.style.height = 0;
+ }
+}
+function mod_legend_repaint(obj){
+ var checkobj = document.getElementById("checkboxstyle");
+ if(checkobj.style.visibility == "visible"){
+ mod_legend_pos();
+ }
+}
+function mod_legend_pos(){
+ var ind = parent.getMapObjIndexByName(mod_legend_target);
+ var obj = parent.document.getElementById("legend");
+
+ if(stickylegend == 'true'){
+ obj.style.left = parseInt(parent.mb_mapObj[ind].width) + mod_legend_target_left + mod_legend_offsetLeft;
+ }
+
+ if(document.forms[0].sw.checked == false){
+ parent.writeTag("legend", "leg", "");
+ return true;
+ }
+
+ var layers;
+ var str = "";
+
+ //str += "<a href='' title='Legende anzeigen' target='_blank'>Legende</a>";
+
+ for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+ var img_format = parent.mb_mapObj[ind].wms[i].gui_wms_mapformat;
+ if(parent.mb_mapObj[ind].wms[i].wms_getlegendurl != ""){
+
+ //header
+ layers = parent.mb_checkScale(mod_legend_target,ind,i);
+
+ if(layers[0] != ""){
+ if (showwmstitle == 'true'){
+ str += "<span class='header'>" +parent.mb_mapObj[ind].wms[i].wms_title+ "</span>";
+ }
+ var layer = layers[0].split(",");
+ var titles = layers[2].split(",");
+ var legendurl = layers[3].split(",");
+ var layerparent= layers[4].split(",");
+ var tmp_name = "";
+
+
+
+ for(var j=0; j<layer.length; j++){
+
+ var l = parent.mb_getchildsbyname(ind,i,layer[j]);
+
+ //str += "test:"+ layer[j]+"/"+titles[j]+"<br>";
+ // handle grouped layers
+ if (l) {
+ if (showlayertitle == 'true'){
+ str += "<div><span class='titles'>" + titles[j]+ "</span></div>";
+ }
+ for (var k=0; k<l["name"].length; k++){
+ if (l["legendurl"][k]!='' && l["legendurl"][k]!=0){
+ if (tmp_name != l["title"][k]) {
+ if (showgroupedlayertitle == 'true'){
+ str += "<div><span class='titles'>" +l["title"][k]+ "</span></div>";
+ }
+ str += "<div>";
+ if(legendlink == 'true'){
+ str += "<a href='../php/result.php?lingo=deutsch&layer="+layer[j]+l["name"][k]+"' class='legendlink' title='Zeigt Liste zum Thema: "+titles[j]+"' target='result'>";
+ }
+ str += "<img border=0 src = '";
+ str += l["legendurl"][k];
+ str += "'></img>";
+ //str += l["legendurl"][k];
+ if (legendlink == 'true'){
+ str += "</a>";
+ }
+ str += "</div>";
+ tmp_name = l["title"][k];
+ } // if
+ } // if legendurl
+ } // for var k=0
+ } // if (l)
+ else {
+ if (legendurl[j]!='' && legendurl[j]!=0){
+ if(layerparent[j] == 0){
+ if(showlayertitle == 'true'){
+ str += "<div><span class='titles'>" + titles[j]+ "</span></div>";
+ }
+ str += "<div>";
+ if(legendlink == 'true'){
+ str += "<a href='../php/result.php?lingo=deutsch&layer="+layer[j]+"' class='link_metadata' title='Zeigt Liste zum Thema: "+titles[j]+"' target='result'>";
+ }
+ str += "<img border=0 src = '";
+ str += legendurl[j];
+ //str += parent.mb_mapObj[ind].wms[i].wms_getlegendurl + "&format=image/png&REQUEST=getlegendgraphic&VERSION=1.1.1&SERVICE=WMS&layer=";
+ str += "'></img>";
+
+ //str += "legend:"+legendurl[j];
+ if (legendlink == 'true'){
+ str += "</a>";
+ }
+ str += "</div>";
+ }//layerparent
+ } // legendurl[j]!='' && legendurl[j]!=0
+ } // else
+ }// for
+ } // if (layers[0...
+ } // if (parent.mb_mapObj[ind].wms[i].wms_getlegendurl != "")
+ }// for
+
+ if(str != ""){
+ parent.writeTag("legend", "leg", str);
+ //prompt('',str);
+ }
+ else{
+ parent.writeTag("legend", "leg", "");
+ }
+ return true;
+} // function mod_legend_pos()
+
+// -->
+</script>
+
+</head>
+<body onload='mod_legend_init()'>
+<form>
+
+<span class='switch'>
+<div id="checkboxstyle" style="visibility:visible;">on/off<input type='checkbox' name='sw' checked='true' onclick='mod_legend_repaint(this)'></div>
+</span>
+<div name='leg' id='leg' ></div>
+
+</form>
+</body>
+</html>
Added: trunk/mapbender/http/javascripts/mod_legend_tab.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_legend_tab.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_legend_tab.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,133 @@
+<?php
+#$Id: mod_legend_tab.php,v 1.13 2006/03/09 08:54:41 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_legend_tab.php,v 1.13 2006/03/09 08:54:41 uli_rothstein Exp $
+# 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.
+
+session_start();
+require_once("../../conf/mapbender.conf");
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Legend</title>
+<link rel="stylesheet" type="text/css" href="../css/legend.css">
+<?php
+
+$gui_id = $_SESSION["mb_user_gui"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target, e_width, e_height FROM gui_element WHERE e_id = 'legend' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('legend: ID not unique!');";}
+#target position, with and height...
+$sql = "SELECT e_left,e_top,e_width,e_height FROM gui_element WHERE e_id = '".$e_target."' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+
+echo "<script type='text/javascript'>";
+echo "var mod_legend_target = '".$e_target."';";
+echo "var mod_legend_target_left = ".db_result($res,0,"e_left").";";
+echo "var mod_legend_target_top = ".db_result($res,0,"e_top").";";
+echo "var mod_legend_target_width = ".db_result($res,0,"e_width").";";
+echo "var mod_legend_target_height = ".db_result($res,0,"e_height").";";
+
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+mod_legend_offsetLeft = 25;
+mod_legend_offsetTop = -10;
+
+parent.mb_registerSubFunctions("window.frames['legend'].mod_legend_pos()");
+function mod_legend_init(){
+ var obj = parent.document.getElementById("legend");
+ /*obj.style.top = mod_legend_target_top + mod_legend_offsetTop;*/
+ /*obj.style.left = mod_legend_target_left + mod_legend_target_width + mod_legend_offsetLeft;*/
+}
+function mod_legend_repaint(obj){
+// if(obj.checked == true){
+ mod_legend_pos();
+// }
+}
+function mod_legend_pos(){
+ /**/
+
+ var ind = parent.getMapObjIndexByName(mod_legend_target);
+ var obj = parent.document.getElementById("legend");
+ /*obj.style.left = parseInt(parent.mb_mapObj[ind].width) + mod_legend_target_left + mod_legend_offsetLeft;*/
+
+ /*if(document.forms[0].sw.checked == false){
+ parent.writeTag("legend", "leg", "");
+ return true;
+ }*/
+ var layers;
+ var str = "";
+ for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+ if(parent.mb_mapObj[ind].wms[i].wms_getlegendurl != ""){
+ //header
+ layers = parent.mb_checkScale(mod_legend_target,ind,i);
+ if(layers[0] != ""){
+ str += "<span class='header'>" +parent.mb_mapObj[ind].wms[i].wms_title+ "</span>";
+
+ var layer = layers[0].split(",");
+ var titles = layers[2].split(",");
+
+ for(var j=0; j<layer.length; j++){
+ str += "<div><span class='titles'>" +titles[j]+ "</span></div>";
+ str += "<div><img src = '";
+ str += parent.mb_mapObj[ind].wms[i].wms_getlegendurl + "&format=image/png&REQUEST=getlegendgraphic&VERSION=1.1.1&SERVICE=WMS&layer=";
+ str += layer[j];
+ str += "'></div>";
+ }
+ } str += "<br>";
+ }
+
+ }
+ if(str != ""){
+ parent.writeTag("legend", "leg", str);
+ }
+ else{
+ parent.writeTag("legend", "leg", "");
+ }
+ return true;
+}
+
+// -->
+</script>
+
+</head>
+<body onload='mod_legend_init()'>
+<form>
+<!--<span class='switch'>Legende ON/OFF<input type='checkbox' name='sw' checked='true' onclick='mod_legend_repaint(this)'>
+</span>
+-->
+</form>
+<div name='leg' id='leg'></div>
+</body>
+</html>
Added: trunk/mapbender/http/javascripts/mod_loadwmc.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_loadwmc.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,63 @@
+<?php
+#$Id: mod_loadwmc.php,v 1.11 2005/10/24 12:34:32 c_baudson Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_loadwmc.php,v 1.11 2005/10/24 12:34:32 c_baudson Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'savewmc' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('loadwmc: ID not unique!');";}
+
+
+echo "mod_loadwmc_target = '".$e_target."';";
+
+?>
+
+var mod_loadwmc_img = new Image(); mod_loadwmc_img.src = "<?php echo $e_src; ?>";
+//var mod_loadwmc_img_over = new Image(); mod_loadwmc_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function mod_importWmc(id) {
+alert(id);
+}
+
+function mod_loadwmc(obj){
+
+ windowWmc = window.open("../php/mb_listWMCs.php?<?php echo SID;?>","displayWmc","width=500, dependent=yes");
+ windowWmc.focus();
+
+}
+function mod_loadwmc_init(obj) {
+ //document.getElementById("loadwmc").src = mod_zoom1_img_over.src;
+
+}
+
+
+
+
+
+
Added: trunk/mapbender/http/javascripts/mod_log.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_log.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_log.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,20 @@
+//$Id: mod_log.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_log.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+mb_registerInitFunctions("mb_log_init()");
+function mb_log_init(){
+ mb_log = "mb_log_set";
+ var logdisplay = document.createElement("div");
+ var tmp = document.getElementById("log").appendChild(logdisplay);
+ tmp.setAttribute("id","logdisplay");
+}
+function mb_log_set(req, time_client){
+ var my = "../php/mod_log.php" + "?<?php echo SID; ?>&req=" + escape(req);
+ my += "&time_client=" + time_client;
+
+ var newdiv = document.createElement("div");
+ newdiv.innerHTML = "<img src='"+my+"'>";
+ document.getElementById("log").appendChild(newdiv);
+ var cnt = parseInt(document.getElementById("log").childNodes.length) - 2;
+ writeTag("","logdisplay", cnt);
+ return true;
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_measure.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_measure.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_measure.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,214 @@
+<?php
+#$Id: mod_measure.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_measure.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'measure' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('measure: ID not unique!');";}
+echo "var mod_measure_target = '".$e_target."';";
+?>
+var mod_measure_color1 = "white";
+var mod_measure_color2 = "black";
+var mod_measure_font = "Arial, Helvetica, sans-serif";
+var mod_measure_fontsize = "9px";
+var mod_measure_basepoint = "#8a2be2";
+var mod_measure_linepoint = "#ff00ff";
+var mod_measure_bg = "";
+var mod_measure_pgsql = true;
+
+var mod_measure_win = null;
+
+var mod_measure_elName = "measure";
+var mod_measure_frameName = "";
+var mod_measure_epsg;
+var mod_measure_width;
+var mod_measure_height;
+var mod_measure_RX = new Array();
+var mod_measure_RY = new Array();
+var mod_measure_Dist = new Array();
+var mod_measure_TotalDist = new Array();
+var mod_measureSubFunctions = new Array();
+
+var mod_measure_img_on = new Image(); mod_measure_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_measure_img_off = new Image(); mod_measure_img_off.src = "<?php echo $e_src; ?>";
+var mod_measure_img_over = new Image(); mod_measure_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_mod_measure(ind){
+ mb_button[ind] = document.getElementById(mod_measure_elName);
+ mb_button[ind].img_over = mod_measure_img_over.src;
+ mb_button[ind].img_on = mod_measure_img_on.src;
+ mb_button[ind].img_off = mod_measure_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_measure_elName;
+ mb_button[ind].fName = mod_measure_frameName;
+ mb_button[ind].go = new Function ("mod_measure_go()");
+ mb_button[ind].stop = new Function ("mod_measure_disable()");
+ var ind = getMapObjIndexByName(mod_measure_target);
+ mod_measure_width = mb_mapObj[ind].width;
+ mod_measure_height = mb_mapObj[ind].height;
+ mod_measure_epsg = mb_mapObj[ind].epsg;
+ mb_registerSubFunctions("drawDashedLine()");
+ mb_registerPanSubElement("measuring");
+}
+function register_measureSubFunctions(stringFunction){
+ mod_measureSubFunctions[mod_measureSubFunctions.length] = stringFunction;
+}
+function mod_measure_go(){
+ var el = window.frames[mod_measure_target].document;
+ el.onmousedown = mod_measure_start;
+ el.onmousemove = mod_measure_run;
+ var measureSub = "";
+ for(var i=0; i<mod_measureSubFunctions.length; i++){
+ measureSub += eval(mod_measureSubFunctions[i]);
+ }
+ writeTag(mod_measure_target,"measure_sub",measureSub);
+}
+function mod_measure_disable(){
+ var el = window.frames[mod_measure_target].document;
+ el.onmousedown = null;
+ el.onmousemove = null;
+ writeTag(mod_measure_target,"measure_display","");
+ writeTag(mod_measure_target,"measure_sub","");
+}
+function mod_measure_timeout(){
+ var el = window.frames[mod_measure_target].document;
+ el.onmousedown = null;
+ el.ondblclick = null;
+ el.onmousemove = null;
+}
+function mod_measure_disableTimeout(){
+ var el = window.frames[mod_measure_target].document;
+ el.onmousedown = mod_measure_start;
+ el.onmousemove = mod_measure_run;
+}
+function mod_measure_start(e){
+ mb_getMousePos(e,mod_measure_target);
+ var realWorldPos = makeClickPos2RealWorldPos(mod_measure_target,clickX,clickY);
+ mod_measure_RX[mod_measure_RX.length] = Math.round(realWorldPos[0] * 100)/100;
+ mod_measure_RY[mod_measure_RY.length] = Math.round(realWorldPos[1] * 100)/100;
+ if(mod_measure_RX.length > 1){
+ var dist_x = Math.abs(mod_measure_RX[mod_measure_RX.length-2] - mod_measure_RX[mod_measure_RX.length-1]);
+ var dist_y = Math.abs(mod_measure_RY[mod_measure_RY.length-2] - mod_measure_RY[mod_measure_RY.length-1]);
+ var dist = Math.round(Math.sqrt(Math.pow(dist_x,2) + Math.pow(dist_y,2))*100)/100;
+ mod_measure_Dist[mod_measure_Dist.length] = dist;
+ var totalDist = mod_measure_TotalDist[mod_measure_TotalDist.length-1] + dist;
+ mod_measure_TotalDist[mod_measure_TotalDist.length] = Math.round(totalDist * 100)/100;
+ }
+ else{
+ mod_measure_Dist[mod_measure_Dist.length] = 0;
+ mod_measure_TotalDist[mod_measure_TotalDist.length] = 0;
+ }
+ drawDashedLine();
+}
+function drawDashedLine(){
+ var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mod_measure_width+"' height='0'></div>";
+ str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mod_measure_height+"'></div>";
+ for(var i=0; i<mod_measure_RX.length; i++){
+ var pos = makeRealWorld2mapPos(mod_measure_target,mod_measure_RX[i],mod_measure_RY[i]);
+ str_mPoints += "<div style='font-size:1px;position:absolute;top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;width:4px;height:4px;background-color:"+mod_measure_basepoint+"'></div>";
+ if(i>0){
+ str_mPoints += "<div style='font-family:"+mod_measure_font+";font-size:"+mod_measure_fontsize+";color:"+mod_measure_color1+";";
+ if(mod_measure_bg != ""){
+ str_mPoints += "background-color:"+mod_measure_bg+";";
+ }
+ str_mPoints += "position:absolute;top:"+(pos[1] + 3)+"px;left:"+(pos[0]+3)+"px;z-index:20'>"+mod_measure_TotalDist[i]+"</div>";
+ str_mPoints += "<div style='font-family:"+mod_measure_font+";font-size:"+mod_measure_fontsize+";color:"+mod_measure_color2+";position:absolute;top:"+(pos[1] + 4)+"px;left:"+(pos[0]+4)+"px;z-index:21'>"+mod_measure_TotalDist[i]+"</div>";
+ }
+ }
+ if(mod_measure_RX.length>1){
+ for(var k=1; k<mod_measure_RX.length; k++){
+ var pos0 = makeRealWorld2mapPos(mod_measure_target,mod_measure_RX[k], mod_measure_RY[k]);
+ var pos1 = makeRealWorld2mapPos(mod_measure_target,mod_measure_RX[k-1], mod_measure_RY[k-1]);
+ str_mPoints += evaluateDashes(pos1[0],pos1[1],pos0[0],pos0[1],k);
+ }
+ }
+ writeTag(mod_measure_target,"measuring",str_mPoints);
+}
+function evaluateDashes(x1,y1,x2,y2,count){
+ var str_dashedLine = "";
+ var s = 10;
+ var d = Math.sqrt(Math.pow((y1-y2),2) + Math.pow((x1-x2),2)) ;
+ var n = Math.round(d/s);
+ var s_x = (x2 - x1)/n;
+ var s_y = (y2 - y1)/n;
+ for(var i=1; i<n; i++){
+ var x = Math.round(x1 + i * s_x)-2;
+ var y = Math.round(y1 + i * s_y)-2;
+ if(x >= 0 && x <= mod_measure_width && y >= 0 && y <= mod_measure_height){
+ str_dashedLine += "<div style='font-size:1px;position:absolute;top:"+y+"px;left:"+x+"px;width:4px;height:4px;background-color:"+mod_measure_linepoint+"'></div>";
+ }
+ }
+ str_dashedLine += "<div style='font-family:"+mod_measure_font+";font-size:"+mod_measure_fontsize+";color:"+mod_measure_color1+";";
+ if(mod_measure_bg != ""){
+ str_dashedLine += "background-color:"+mod_measure_bg+";";
+ }
+ str_dashedLine += "position:absolute;top:"+(Math.round(y1 + (y2-y1)/2 +3))+"px;left:"+(Math.round(x1 + (x2-x1)/2 +3))+"px'>"+mod_measure_Dist[count]+"</div>";
+ str_dashedLine += "<div style='font-family:"+mod_measure_font+";font-size:"+mod_measure_fontsize+";color:"+mod_measure_color2+";position:absolute;top:"+(Math.round(y1 + (y2-y1)/2 + 4))+"px;left:"+(Math.round(x1 + (x2-x1)/2+4))+"px'>"+mod_measure_Dist[count]+"</div>";
+ return str_dashedLine;
+}
+function mod_measure_run(e){
+ mb_getMousePos(e,mod_measure_target);
+ var pos = makeClickPos2RealWorldPos(mod_measure_target,clickX,clickY);
+ var dist_x = Math.abs(mod_measure_RX[mod_measure_RX.length-1] - pos[0]);
+ var dist_y = Math.abs(mod_measure_RY[mod_measure_RY.length-1] - pos[1]);
+ if(isNaN(dist_x) == false && clickX > 0 && clickX < mod_measure_width && clickY > 0 && clickY < mod_measure_height){
+ var str_display = "<span style='font-family:"+mod_measure_font+";font-size:"+mod_measure_fontsize+";color:"+mod_measure_color2+";'>"+(Math.round(Math.sqrt(Math.pow(dist_x,2) + Math.pow(dist_y,2))*100)/100)+" m</span>";
+ writeTag(mod_measure_target,"measure_display",str_display);
+ mb_arrangeElement(mod_measure_target,"measure_display",clickX +2, clickY - 10);
+ }
+ else{
+ writeTag(mod_measure_target,"measure_display","");
+ }
+}
+function mod_measure_close(){
+ if(mod_measure_RX.length < 3 || (mod_measure_RX[mod_measure_RX.length-1] == mod_measure_RX[0] && mod_measure_RY[mod_measure_RY.length-1] == mod_measure_RY[0])){return;}
+ mod_measure_RX[mod_measure_RX.length] = mod_measure_RX[0];
+ mod_measure_RY[mod_measure_RY.length] = mod_measure_RY[0];
+ if(mod_measure_RX.length > 1){
+ // circumference
+ var dist_x = Math.abs(mod_measure_RX[mod_measure_RX.length-2] - mod_measure_RX[mod_measure_RX.length-1]);
+ var dist_y = Math.abs(mod_measure_RY[mod_measure_RY.length-2] - mod_measure_RY[mod_measure_RY.length-1]);
+ var dist = Math.round(Math.sqrt(Math.pow(dist_x,2) + Math.pow(dist_y,2))*100)/100;
+ mod_measure_Dist[mod_measure_Dist.length] = dist;
+ var totalDist = mod_measure_TotalDist[mod_measure_TotalDist.length-1] + dist;
+ mod_measure_TotalDist[mod_measure_TotalDist.length] = Math.round(totalDist * 100)/100;
+ }
+ else{
+ mod_measure_Dist[mod_measure_Dist.length] = 0;
+ mod_measure_TotalDist[mod_measure_TotalDist.length] = 0;
+ }
+ drawDashedLine();
+}
+function mod_measure_delete(){
+ mod_measure_RX = new Array();
+ mod_measure_RY = new Array();
+ mod_measure_Dist = new Array();
+ mod_measure_TotalDist = new Array();
+ writeTag(mod_measure_target,"measuring","");
+ writeTag(mod_measure_target,"measure_display","");
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_navFrame.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_navFrame.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_navFrame.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,68 @@
+<?php
+#$Id: mod_navFrame.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_navFrame.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target,e_src FROM gui_element WHERE e_id = 'navFrame' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+echo "var mod_navFrame_target = '".$e_target."';";
+if($cnt > 1){ echo "alert('navFrame: ID not unique!');";}
+echo "var mod_navFrame_src = '".db_result($res,0,"e_src")."';";
+?>
+var mod_navFrame_ext = 10;
+mb_registerSubFunctions("mod_navFrame_arrange()");
+function mod_navFrame_arrange(){
+ var el = document.getElementById(mod_navFrame_target).style;
+ var ext = mod_navFrame_ext;
+ var myLeft = parseInt(el.left);
+ var myTop = parseInt(el.top);
+ var myWidth = parseInt(el.width);
+ var myHeight = parseInt(el.height);
+ //left,top,width,height
+ mod_navFrame_pos("mbN",(myLeft),(myTop - ext),(myWidth),(ext));
+ document.getElementById("arrow_n").style.left = myWidth/2 - document.getElementById("arrow_n").width/2;
+ mod_navFrame_pos("mbNE",(myLeft + myWidth),(myTop - ext),(ext),(ext));
+ mod_navFrame_pos("mbE",(myLeft + myWidth),(myTop),(ext),(myHeight));
+ document.getElementById("arrow_e").style.top = myHeight/2 - document.getElementById("arrow_n").height/2;
+ mod_navFrame_pos("mbSE",(myLeft + myWidth),(myTop + myHeight),(ext),(ext));
+ mod_navFrame_pos("mbS",(myLeft),(myTop + myHeight),(myWidth),(ext));
+ document.getElementById("arrow_s").style.left = myWidth/2 - document.getElementById("arrow_s").width/2;
+ mod_navFrame_pos("mbSW",(myLeft - ext),(myTop + myHeight),(ext),(ext));
+ mod_navFrame_pos("mbW",(myLeft - ext),(myTop),(ext),(myHeight));
+ document.getElementById("arrow_w").style.top = myHeight/2 - document.getElementById("arrow_w").height/2;
+ mod_navFrame_pos("mbNW",(myLeft - ext),(myTop -ext),(ext),(ext));
+}
+function mod_navFrame(val){
+ mb_panMap(mod_navFrame_target,val);
+}
+function mod_navFrame_pos(el,left,top,width,height){
+//alert(el + " , " +left + " , " +top + " , " +width + " , " +height)
+ document.getElementById(el).style.left = left;
+ document.getElementById(el).style.top = top;
+ document.getElementById(el).style.width = width;
+ document.getElementById(el).style.height = height;
+}
Added: trunk/mapbender/http/javascripts/mod_pan.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_pan.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_pan.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,113 @@
+<?php
+#$Id: mod_pan.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_pan.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'pan1' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('pan1: ID not unique!');";}
+echo "var mod_pan_target = '".$e_target."';";
+?>
+var mod_pan_elName = "pan1";
+var mod_pan_frameName = "";
+
+
+var mod_pan_img_on = new Image(); mod_pan_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_pan_img_off = new Image(); mod_pan_img_off.src = "<?php echo $e_src; ?>";
+var mod_pan_img_over = new Image(); mod_pan_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_mod_pan(ind){
+ mb_button[ind] = document.getElementById(mod_pan_elName);
+ mb_button[ind].img_over = mod_pan_img_over.src;
+ mb_button[ind].img_on = mod_pan_img_on.src;
+ mb_button[ind].img_off = mod_pan_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_pan_elName;
+ mb_button[ind].fName = mod_pan_frameName;
+ mb_button[ind].go = new Function ("mod_pan_click()");
+ mb_button[ind].stop = new Function ("mod_pan_disable()");
+}
+function mod_pan_click(){
+ var el = window.frames[mod_pan_target].document;
+ el.onmousedown = mod_pan_start;
+ el.onmouseup = mod_pan_stop;
+ el.onmousemove = mod_pan_run;
+}
+function mod_pan_disable(){
+ var el = window.frames[mod_pan_target].document;
+ el.onmousedown = null;
+ el.onmouseup = null;
+ el.onmousemove = null;
+}
+function mod_pan_start(e){
+ mb_panActive = true;
+ mb_getMousePos(e,mod_pan_target);
+ mb_start_x=clickX;
+ mb_start_y=clickY;
+ mb_end_x = clickX;
+ mb_end_y = clickY;
+ return false;
+}
+function mod_pan_run(e){
+ if(mb_panActive){
+ mb_getMousePos(e,mod_pan_target);
+ mb_end_x = clickX;
+ mb_end_y = clickY;
+ mod_pan_move_map();
+ if(ie){ return false;}
+ else{return true;}
+ }
+}
+function mod_pan_stop(e){
+ mb_panActive = false;
+ var dif_x = mb_end_x - mb_start_x;
+ var dif_y = mb_end_y - mb_start_y;
+ for(var i=0; i<mb_mapObj.length; i++){
+ if(mb_mapObj[i].frameName == mod_pan_target){
+ var width = mb_mapObj[i].width;
+ var height = mb_mapObj[i].height;
+ }
+ }
+
+ var center_x = (width / 2) - dif_x;
+ var center_y = (height / 2) - dif_y;
+ var real_center = makeClickPos2RealWorldPos(mod_pan_target,center_x, center_y);
+ mb_arrangeElement(mod_pan_target, "maps", 0, 0);
+ for(var i=0; i<mb_PanSubElements.length; i++){
+ mb_arrangeElement(mod_pan_target, mb_PanSubElements[i], 0, 0);
+ }
+ zoom(mod_pan_target,false, 1.0, real_center[0], real_center[1]);
+}
+function mod_pan_move_map(){
+ var dif_x = mb_end_x - mb_start_x;
+ var dif_y = mb_end_y - mb_start_y;
+ mb_arrangeElement(mod_pan_target, "maps", dif_x, dif_y);
+ for(var i=0; i<mb_PanSubElements.length; i++){
+ mb_arrangeElement(mod_pan_target, mb_PanSubElements[i], dif_x, dif_y);
+ }
+ return false;
+}
Added: trunk/mapbender/http/javascripts/mod_permanentHighlight.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_permanentHighlight.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_permanentHighlight.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,17 @@
+//$Id: mod_permanentHighlight.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_permanentHighlight.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+var mod_permanentHighlight_target = "mapframe1";
+var mod_permanentHighlight_x = false;
+var mod_permanentHighlight_y = false;
+
+mb_registerSubFunctions("mod_permanentHighlight_init()");
+mb_registerPanSubElement("permanent");
+function mod_permanentHighlight_init(){
+ if(mod_permanentHighlight_x && mod_permanentHighlight_y){
+ mb_permanentHighlight("mapframe1",parseFloat(mod_permanentHighlight_x),parseFloat(mod_permanentHighlight_y));
+ }
+}
+function mb_permanentHighlight(frameName,x,y){
+ var pos = makeRealWorld2mapPos(frameName,x, y);
+ mb_arrangeElement(frameName,"permanent",pos[0]-7, pos[1]-7);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_print1.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_print1.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_print1.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,264 @@
+<?php
+#$Id: mod_print1.php,v 1.12 2006/03/09 10:28:47 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_print1.php,v 1.12 2006/03/09 10:28:47 uli_rothstein Exp $
+# 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.
+
+session_start();
+include("../../conf/print.conf");
+include("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Print</title>
+</head>
+<style type="text/css">
+<!--
+
+ select{
+ width:180px;
+ }
+ .textField{
+ width: 180px;
+ }
+ body{
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ }
+-->
+</style>
+<?php
+/******Name of this module**************/
+$mb_module_id = "print1";
+/**********************************/
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT * from gui_element WHERE fkey_gui_id = '".$_SESSION["mb_user_gui"]."' AND e_id = '".$mb_module_id."'";
+$res = db_query($sql);
+
+echo "<script type='text/javascript'>";
+#echo "var mb_user_resolution = ".$_SESSION["mb_user_resolution"]." / 2.54;";
+echo "var deformation = ".$deformation.";";
+#echo "var DPC = 28.35 * deformation;";
+echo "var DPC = 28.35;";
+echo "var a4_width = " . $a4_width . " * DPC;";
+echo "var a4_height = " . $a4_height . " * DPC;";
+echo "var a3_width = " . $a3_width . " * DPC;";
+echo "var a3_height = " . $a3_height . " * DPC;";
+
+
+
+echo "var border_Portrait_a4_left = " . $border_Portrait_a4_left . " * DPC;";
+echo "var border_Portrait_a4_top = " . $border_Portrait_a4_top . " * DPC;";
+echo "var border_Portrait_a4_right = " . $border_Portrait_a4_right . " * DPC;";
+echo "var border_Portrait_a4_bottom = " . $border_Portrait_a4_bottom . " * DPC;";
+echo "var header_Portrait_a4_height = " . $header_Portrait_a4_height . " * DPC;";
+
+echo "var border_Landscape_a4_left = " . $border_Landscape_a4_left . " * DPC;";
+echo "var border_Landscape_a4_top = " . $border_Landscape_a4_top . " * DPC;";
+echo "var border_Landscape_a4_right = " . $border_Landscape_a4_right . " * DPC;";
+echo "var border_Landscape_a4_bottom = " . $border_Landscape_a4_bottom . " * DPC;";
+echo "var header_Landscape_a4_height = " . $header_Landscape_a4_height . " * DPC;";
+
+echo "var border_Portrait_a3_left = " . $border_Portrait_a3_left . " * DPC;";
+echo "var border_Portrait_a3_top = " . $border_Portrait_a3_top . " * DPC;";
+echo "var border_Portrait_a3_right = " . $border_Portrait_a3_right . " * DPC;";
+echo "var border_Portrait_a3_bottom = " . $border_Portrait_a3_bottom . " * DPC;";
+echo "var header_Portrait_a3_height = " . $header_Portrait_a3_height . " * DPC;";
+
+echo "var border_Landscape_a3_left = " . $border_Landscape_a3_left . " * DPC;";
+echo "var border_Landscape_a3_top = " . $border_Landscape_a3_top . " * DPC;";
+echo "var border_Landscape_a3_right = " . $border_Landscape_a3_right . " * DPC;";
+echo "var border_Landscape_a3_bottom = " . $border_Landscape_a3_bottom . " * DPC;";
+echo "var header_Landscape_a3_height = " . $header_Landscape_a3_height . " * DPC;";
+
+echo "var mod_print1_target = '".db_result($res,0,"e_target")."';";
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+/******PARAMS********************/
+var mb_resolution = null;
+var ind_size = null;
+var ind_format = null;
+
+/**END*PARAMS********************/
+
+function validate(){
+ //window.opener.mb_resolution = DPC;
+ ind_size = document.form1.size.selectedIndex;
+ ind_format = document.form1.format.selectedIndex;
+
+ if(ind_size != 0 && ind_format != 0){
+ var ind = window.opener.getMapObjIndexByName(mod_print1_target);
+ var coord = window.opener.mb_mapObj[ind].extent.split(",");
+ var centerX = parseInt(coord[0]) + (parseInt(coord[2]) - parseInt(coord[0]))/2
+ var centerY = parseInt(coord[1]) + (parseInt(coord[3]) - parseInt(coord[1]))/2
+ if(document.form1.size.options[ind_size].value == "A4" && document.form1.format.options[ind_format].value == "portrait"){
+ document.form1.page_width.value = a4_width;
+ document.form1.page_height.value = a4_height;
+ document.form1.printOffset_left.value = border_Portrait_a4_left;
+ document.form1.printOffset_top.value = border_Portrait_a4_top;
+ document.form1.map_width.value = Math.round(a4_width - border_Portrait_a4_left - border_Portrait_a4_right);
+ document.form1.map_height.value = Math.round(a4_height - border_Portrait_a4_top - border_Portrait_a4_bottom - header_Portrait_a4_height);
+ document.form1.header_height.value = header_Portrait_a4_height;
+ }
+ if(document.form1.size.options[ind_size].value == "A4" && document.form1.format.options[ind_format].value == "landscape"){
+ document.form1.page_width.value = a4_height;
+ document.form1.page_height.value = a4_width;
+ document.form1.printOffset_left.value = border_Landscape_a4_left;
+ document.form1.printOffset_top.value = border_Landscape_a4_top;
+ document.form1.map_width.value = Math.round(a4_height - border_Landscape_a4_left - border_Landscape_a4_right);
+ document.form1.map_height.value = Math.round(a4_width - border_Landscape_a4_top - border_Landscape_a4_bottom - header_Landscape_a4_height);
+ document.form1.header_height.value = header_Landscape_a4_height;
+ }
+ if(document.form1.size.options[ind_size].value == "A3" && document.form1.format.options[ind_format].value == "portrait"){
+ document.form1.page_width.value = a3_width;
+ document.form1.page_height.value = a3_height;
+ document.form1.printOffset_left.value = border_Portrait_a3_left;
+ document.form1.printOffset_top.value = border_Portrait_a3_top;
+ document.form1.map_width.value = Math.round(a3_width - border_Portrait_a3_left - border_Portrait_a3_right);
+ document.form1.map_height.value = Math.round(a3_height - border_Portrait_a3_top - border_Portrait_a3_bottom - header_Portrait_a3_height);
+ document.form1.header_height.value = header_Portrait_a3_height;
+ }
+ if(document.form1.size.options[ind_size].value == "A3" && document.form1.format.options[ind_format].value == "landscape"){
+ document.form1.page_width.value = a3_height;
+ document.form1.page_height.value = a3_width;
+ document.form1.printOffset_left.value = border_Landscape_a3_left;
+ document.form1.printOffset_top.value = border_Landscape_a3_top;
+ document.form1.map_width.value = Math.round(a3_height - border_Landscape_a3_left - border_Landscape_a3_right);
+ document.form1.map_height.value = Math.round(a3_width - border_Landscape_a3_top - border_Landscape_a3_bottom - header_Landscape_a3_height);
+ document.form1.header_height.value = header_Landscape_a3_height;
+ }
+ var pos = window.opener.makeClickPos2RealWorldPos(mod_print1_target, document.form1.map_width.value , document.form1.map_height.value );
+ window.opener.mb_mapObj[ind].width = document.form1.map_width.value;
+ window.opener.mb_mapObj[ind].height = document.form1.map_height.value;
+ window.opener.document.getElementById(mod_print1_target).style.width = document.form1.map_width.value;
+ window.opener.document.getElementById(mod_print1_target).style.height = document.form1.map_height.value;
+ window.opener.window.frames[mod_print1_target].document.getElementById("maps").style.width = document.form1.map_width.value;
+ window.opener.window.frames[mod_print1_target].document.getElementById("maps").style.height = document.form1.map_height.value;
+
+ window.opener.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," + coord[3];
+ window.opener.setMapRequest(mod_print1_target);
+ }
+}
+function refreshParams(){
+ var ind = window.opener.getMapObjIndexByName(mod_print1_target);
+ document.form1.map_url.value = "";
+ var cnt_urls = 0;
+ for(var i=0; i<window.opener.mb_mapObj[ind].wms.length; i++){
+ if(window.opener.mb_mapObj[ind].wms[i].mapURL != false){
+ if(cnt_urls > 0){document.form1.map_url.value += "###";}
+ //hack for relativ WMS_ONLINERESOURCE
+ if(window.opener.mb_mapObj[ind].wms[i].mapURL.charAt(0) == '/' && window.opener.mb_mapObj[ind].wms[i].mapURL.charAt(1) == 'c')
+ {
+ document.form1.map_url.value += 'http://localhost' + window.opener.mb_mapObj[ind].wms[i].mapURL;
+ }
+ else
+ {
+ document.form1.map_url.value += window.opener.mb_mapObj[ind].wms[i].mapURL;
+ }
+ cnt_urls++;
+ }
+ }
+ document.form1.map_extent.value = window.opener.mb_mapObj[ind].extent;
+ document.form1.map_scale.value = window.opener.mb_getScale(mod_print1_target);
+}
+function printMap(){
+ if(ind_size > 0 && ind_format >0){
+ refreshParams();
+ document.form1.submit();
+ disablePrinting();
+ }
+ else{
+ alert("Das Format ist noch nicht ausgewählt.");
+ }
+ window.opener.mod_back_set();
+}
+function disablePrinting(){
+ //window.opener.mb_resolution = mb_user_resolution;
+ window.close();
+}
+// -->
+</script>
+<body onunload="disablePrinting()">
+<form name='form1' method='POST' action='../php/mod_printView1.php?<?php echo SID; ?>' target="_blank">
+<table border='0'>
+<tr>
+ <td>
+ Format:<br />
+
+ <select name='size' onchange='validate()'>
+ <option value=''>Paper size...</option>
+ <option value='A4'>A4</option>
+ <!-- <option value='A3'>A3</option> -->
+ </select>
+ </td>
+</tr>
+<tr>
+ <td>
+ <select name='format' onchange='validate()'>
+ <option value=''>Orientation...(portrait,landscape)</option>
+ <option value='portrait'>Portrait</option>
+ <option value='landscape'>Landscape</option>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td>
+ <br />Resolution:<br />
+ <select name='quality'>
+ <option value='1'>Standard</option>
+ <!-- <option value='<?php #echo $printFactor; ?>'>hoch</option> -->
+ </select>
+ </td>
+</tr>
+<tr>
+ <td>
+ <br />Titel: <br />
+ <input type="text" class="textField" name="printTitle" value= "Preview">
+ </td>
+</tr>
+<tr>
+ <td>
+ <br />Text: <br />
+ <textarea name="printComment" rows="4" cols="20"></textarea>
+ </td>
+</tr>
+<table>
+<input type='hidden' name='printOffset_left' value=''>
+<input type='hidden' name='printOffset_top' value=''>
+<input type='hidden' name='map_width' value=''>
+<input type='hidden' name='map_height' value=''>
+<input type='hidden' name='page_width' value=''>
+<input type='hidden' name='page_height' value=''>
+<input type='hidden' name='header_height' value=''>
+<input type='hidden' name='map_url' value=''>
+<input type='hidden' name='map_extent' value=''>
+<input type='hidden' name='map_scale' value=''>
+<!-- <input type='hidden' name='footer' value='<?php echo $footer ?>'> -->
+<input type='button' name='print' value="Preview" onclick='printMap()'>
+</form>
+</body>
+</html>
Added: trunk/mapbender/http/javascripts/mod_repaint.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_repaint.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_repaint.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,49 @@
+<?php
+#$Id: mod_repaint.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_repaint.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'repaint' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('repaint: ID not unique!');";}
+?>
+var mod_repaint_img = new Image(); mod_repaint_img.src = "<?php echo $e_src; ?>";
+var mod_repaint_img_over = new Image(); mod_repaint_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function mod_repaint(){
+ zoom("<?php echo $e_target; ?>", true,0.999);
+}
+function mod_repaint_init(obj){
+ document.getElementById("repaint").src = mod_repaint_img_over.src;
+ obj.onmouseover = new Function("mod_repaint_over()");
+ obj.onmouseout = new Function("mod_repaint_out()");
+}
+function mod_repaint_over(){
+ document.getElementById("repaint").src = mod_repaint_img_over.src;
+}
+function mod_repaint_out(){
+ document.getElementById("repaint").src = mod_repaint_img.src;
+}
Added: trunk/mapbender/http/javascripts/mod_rubber.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_rubber.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_rubber.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,13 @@
+//$Id: mod_rubber.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_rubber.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+var mod_rubber_img = new Image();
+mod_rubber_img.src = "../img/button_gray/rubber_off.gif";
+register_measureSubFunctions("mod_rubber()");
+
+function mod_rubber(){
+ var str = "<div onmouseup='parent.mod_rubber_go()' onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_go()'><img src='"+mod_rubber_img.src+"'></div>";
+ return str;
+}
+function mod_rubber_go(){
+ mod_measure_delete();
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_rubberExt.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_rubberExt.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_rubberExt.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,15 @@
+//$Id: mod_rubberExt.js,v 1.2 2006/03/17 12:38:36 c_baudson Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_rubberExt.js,v 1.2 2006/03/17 12:38:36 c_baudson Exp $
+var mod_rubberExt_img = new Image();
+mod_rubberExt_img.src = "../img/button_gray/rubber_off.gif";
+register_setExtRequestSubFunctions("mod_rubberExt()");
+
+function mod_rubberExt(){
+ var str = "<div onmouseup='parent.mod_wfs_SpatialRequest_delete()' onmouseover='parent.mod_wfs_SpatialRequest_timeout()' onmouseout='parent.mod_wfs_SpatialRequest_go()'><img src='"+mod_rubberExt_img.src+"'></div>";
+ return str;
+}
+/*
+function mod_rubberExt_go(){
+ mod_setExtRequest_delete();
+}
+*/
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_sandclock.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_sandclock.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_sandclock.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,50 @@
+<?php
+#$Id: mod_sandclock.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_sandclock.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'sandclock' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('sandclock: ID not unique!');";}
+echo "var mod_sandclock_target = '".$e_target."';";
+?>
+
+var mod_sandclock_img = new Image();
+mod_sandclock_img.src = "../img/sandclock.gif";
+mb_registerSubFunctions("mod_sandclock(true,myMapId)");
+
+function mod_sandclock(start,myMapId){
+ var ind = getMapObjIndexByName(mod_sandclock_target);
+ if(start){
+ var temp = "<img src='"+mod_sandclock_img.src+"'>";
+ writeTag(mod_sandclock_target, "sandclock", temp);
+ mb_arrangeElement(mod_sandclock_target, "sandclock", (mb_mapObj[ind].width/2 - 16), (mb_mapObj[ind].height/2 - 16));
+ }
+ aktiv = setTimeout("mod_sandclock('','"+myMapId+"')",100);
+ if(window.frames[mod_sandclock_target].document.getElementById(myMapId) && window.frames[mod_sandclock_target].document.getElementById(myMapId).complete){
+ clearTimeout(aktiv);
+ writeTag(mod_sandclock_target, "sandclock", "");
+ }
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_sandclock2.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_sandclock2.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_sandclock2.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,70 @@
+<?php
+#$Id: mod_sandclock2.php,v 1.6 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_sandclock2.php,v 1.6 2005/09/13 18:16:42 bjoern_heuser Exp $
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'sandclock2' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = db_result($res,0,"e_target");
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('sandclock2: ID not unique!');";}
+echo "var mod_sandclock_target = '".$e_target."';";
+?>
+var mod_sandclock_maxWait = 1000 * 60;
+var mod_sandclock_minWait = 1000 * 0;
+
+var mod_sandclock_count;
+var mod_sandclock_img = new Image();
+mod_sandclock_img.src = "../img/sandclock.gif";
+mb_registerSubFunctions("mod_sandclock(true,myMapId)");
+
+
+function mod_sandclock(start,myMapId){
+ var ind = getMapObjIndexByName(mod_sandclock_target);
+ if(start){
+ mod_sandclock_count = mod_sandclock_maxWait;
+ var temp = "<img src='"+mod_sandclock_img.src+"'>";
+ writeTag(mod_sandclock_target, "sandclock", temp);
+
+ mb_arrangeElement(mod_sandclock_target, "sandclock", (mb_mapObj[ind].width/2 - 16), (mb_mapObj[ind].height/2 - 16));
+
+ var dim = mod_sandclock_getWSize();
+ document.getElementById("sandclock2").style.width = dim[0];
+ document.getElementById("sandclock2").style.height = dim[1];
+ }
+
+ // check images:
+ aktiv = setTimeout("mod_sandclock('','"+myMapId+"')",100);
+ mod_sandclock_count -= 1000;
+
+ var allMaps = window.frames[mod_sandclock_target].document.getElementsByName("mapimage");
+ var cnt = 1;
+ for(var i=0; i<allMaps.length; i++){
+ if(allMaps[i].complete == true){
+ cnt++;
+
+ }
+ }
+ if((mod_sandclock_count <= 0 || cnt >= allMaps.length) && mod_sandclock_count < (mod_sandclock_maxWait - mod_sandclock_minWait)){
+ clearTimeout(aktiv);
+ writeTag(mod_sandclock_target, "sandclock", "");
+ document.getElementById("sandclock2").style.width = 1;
+ document.getElementById("sandclock2").style.height = 1;
+ }
+
+}
+function mod_sandclock_getWSize(){
+ if(ie){
+ var dim = new Array(window.document.body.offsetWidth, window.document.body.offsetHeight);
+ }
+ else{
+ var dim = new Array(window.innerWidth, window.innerHeight);
+ }
+ return dim;
+}
Added: trunk/mapbender/http/javascripts/mod_saveWKT.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_saveWKT.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_saveWKT.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,20 @@
+//$Id: mod_saveWKT.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_saveWKT.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+var mod_saveWKT_img = new Image();
+var mod_saveWKT_win = null;
+mod_saveWKT_img.src = "../img/button_gray/save.gif";
+register_measureSubFunctions("mod_saveWKT()");
+
+function mod_saveWKT(){
+ var str = "<div style='position:absolute;top:75px' onmouseup='parent.mod_saveWKT_go()' ";
+ str += "onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_go()'><img src='"+mod_saveWKT_img.src+"'></div>";
+ return str;
+}
+function mod_saveWKT_go(){
+ if(mod_saveWKT_win == null || mod_saveWKT_win.closed == true){
+ mod_saveWKT_win = window.open("../php/mod_saveWKT.php","mod_saveWKT_win","width=400, height=400, resizable=yes, dependent=yes");
+ }
+ else{
+ mod_saveWKT_win.focus();
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_savewmc.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_savewmc.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_savewmc.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,447 @@
+<?php
+#$Id$
+#$Header$
+# 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.
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'savewmc' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('savewmc: ID not unique!');";}
+
+
+echo "mod_savewmc_target = '".$e_target."';";
+
+?>
+
+
+var mod_savewmc_img = new Image(); mod_savewmc_img.src = "<?php echo $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(obj){
+
+ var user = "<?php echo $_SESSION["mb_user_id"]; ?>";
+ var ind = getMapObjIndexByName(mod_savewmc_target);
+ var generalTitle = prompt("Save WMC as...");
+
+ if (generalTitle != null) {
+ var wmc = "";
+
+ //
+ //
+ // ViewContext variables
+ //
+ //
+ var version = "1.0.0";
+ var id = "<?php echo $_SESSION["mb_user_id"] . "_";?>";
+ var jetzt = new Date();
+ id += jetzt.getTime();
+
+
+
+ //
+ //
+ // General variables
+ //
+ //
+ var generalWidth = mb_mapObj[ind].width;
+ var generalHeight = mb_mapObj[ind].height;
+ var generalBboxSrs = mb_mapObj[ind].epsg;
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ var generalBboxMinx = parseFloat(arrayBBox[0]);
+ var generalBboxMiny = parseFloat(arrayBBox[1]);
+ var generalBboxMaxx = parseFloat(arrayBBox[2]);
+ var generalBboxMaxy = parseFloat(arrayBBox[3]);
+ var generalName = "Mapbender WMC"; // TO do : insert proper data
+ var generalKeywords = ""; // TO do : insert proper data
+ var generalAbstract = ""; // TO do : insert proper data
+ var generalLogoUrl = ""; // TO do : insert proper data
+ var generalLogoUrlWidth = ""; // TO do : insert proper data
+ var generalLogoUrlHeight = ""; // TO do : insert proper data
+ var generalLogoUrlFormat = ""; // TO do : insert proper data
+ var generalDescriptionUrl = ""; // TO do : insert proper data
+
+ var generalContactPerson = "";
+ var generalContactOrganization = "";
+ var generalContactPosition = "";
+ var generalContactAddressType = "";
+ var generalContactAddress = "";
+ var generalContactCity = "";
+ var generalContactStateOrProvince = "";
+ var generalContactPostCode = "";
+ var generalContactCountry = "";
+ var generalContactVoiceTelephone = "";
+ var generalContactFacsimileTelephone = "";
+ var generalContactElectronicMailAddress = "";
+
+ // Missing: Extension
+
+
+
+ //
+ //
+ // LayerList variables
+ //
+ //
+ var layerHidden = "";
+ var layerQueryable = "";
+ var layerAbstract = "";
+ var layerName = "";
+ var layerSrs = "";
+ var layerDataUrl = "";
+ var layerMetadataUrl = "";
+ var layerFormat = "";
+ var layerFormat_current = "";
+ var layerStyle_current = "";
+ var layerStyle_name = "";
+ var layerStyle_title = "";
+ var layerStyle_legendURL = "";
+ var layerStyle_legendURL_width = "";
+ var layerStyle_legendURL_height = "";
+ var layerStyle_legendURL_format = "";
+ // Missing: Extension
+
+ //
+ //
+ //ViewContext
+ //
+ //
+ wmc += "<?xml version=\"1.0\" encoding=\"<?php echo CHARSET; ?>\" ?>\n";
+// wmc += "<!ENTITY amp \"&#38;#38;\">\n";
+ wmc += "<ViewContext version=\"" + version + "\" ";
+ wmc += "id = \"" + id + "\" ";
+ wmc += "xmlns=\"http://www.opengis.net/context\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:SchemaLocation=\"http://schemas.opengis.net/context/1.0.0/context.xsd\" ";
+ wmc += ">\n";
+
+ //
+ //
+ //General
+ //
+ //
+ wmc += "\t<General>\n";
+
+ if (generalWidth && generalHeight) {
+ wmc += "\t\t<Window width=\"" + generalWidth + "\" height=\"" + generalHeight + "\" />\n";
+ }
+
+ wmc += "\t\t<BoundingBox SRS=\"" + generalBboxSrs + "\" minx =\"" + generalBboxMinx + "\" ";
+ wmc += "miny =\"" + generalBboxMiny + "\" maxx =\"" + generalBboxMaxx + "\" maxy =\"" + generalBboxMaxy + "\" />\n";
+ wmc += "\t\t<Name>" + generalName + "</Name>\n";
+ wmc += "\t\t<Title>" + generalTitle + "</Title>\n";
+
+ if (generalKeywords) {
+ wmc += "\t\t<KeywordList>\n";
+ wmc += "\t\t\t<Keyword>" + generalKeywords + "</Keyword>\n";
+ wmc += "\t\t<KeywordList>\n";
+ }
+
+ if (generalAbstract) {
+ wmc += "\t\t<Abstract>" + generalAbstract + "</Abstract>\n";
+ }
+
+ if (generalLogoUrlWidth && generalLogoUrlHeight && generalLogoUrlFormat && generalLogoUrl) {
+ wmc += "\t\t<LogoURL width = \"" + generalLogoUrlWidth + "\" ";
+ wmc += "height = \"" + generalLogoUrlHeight + "\" ";
+ wmc += "format = \"" + generalLogoUrlFormat + "\">\n";
+ wmc += "\t\t\t<OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type = \"simple\" xlink:href=\"" + generalLogoUrl + "\" />\n";
+ wmc += "\t\t</LogoUrl>\n";
+ }
+
+ if (generalDescriptionUrl) {
+ wmc += "\t\t<DescriptionURL>\n";
+ wmc += "\t\t\t<OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type = \"simple\" xlink:href=\"" + generalDescriptionUrl + "\" />\n";
+ wmc += "\t\t</DescriptionUrl>\n";
+ }
+
+ if (generalContactElectronicMailAddress || generalContactOrganization ||
+ generalContactPerson || generalContactPosition || generalContactAddressType ||
+ generalContactAddress || generalContactCity || generalContactStateOrProvince ||
+ generalContactPostCode || generalContactCountry || generalContactVoiceTelephone ||
+ generalContactFacsimileTelephone || generalContactElectronicMailAddress
+ ) {
+ wmc += "\t\t<ContactInformation>\n";
+
+ if (generalContactPerson || generalContactOrganization) {
+ wmc += "\t\t\t<ContactPersonPrimary>\n";
+ if (generalContactPerson) {
+ wmc += "\t\t\t\t<ContactPerson>" + generalContactPerson + "</ContactPerson>\n";
+ }
+ if (generalContactOrganization) {
+ wmc += "\t\t\t\t<ContactOrganization>" + generalContactOrganization + "</ContactOrganization>\n";
+ }
+ wmc += "\t\t\t</ContactPersonPrimary>\n";
+ }
+
+ if (generalContactPosition) {
+ wmc += "\t\t\t<ContactPosition>" + generalContactPosition + "</ContactPosition>\n";
+ }
+
+ if (generalContactAddressType || generalContactAddress || generalContactCity || generalContactStateOrProvince ||
+ generalContactPostCode || generalContactCountry) {
+ wmc += "\t\t\t<ContactAddress>\n";
+
+ if (generalContactAddressType) {
+ wmc += "\t\t\t\t<AddressType>" + generalContactAddressType + "</AddressType>\n";
+ }
+ if (generalContactAddress) {
+ wmc += "\t\t\t\t<Address>" + generalContactAddress + "</Address>\n";
+ }
+ if (generalContactCity) {
+ wmc += "\t\t\t\t<City>" + generalContactCity + "</City>\n";
+ }
+ if (generalContactStateOrProvince) {
+ wmc += "\t\t\t\t<StateOrProvince>" + generalContactStateOrProvince + "</StateOrProvince>\n";
+ }
+ if (generalContactPostCode) {
+ wmc += "\t\t\t\t<PostCode>" + generalContactPostCode + "</PostCode>\n";
+ }
+ if (generalContactCountry) {
+ wmc += "\t\t\t\t<Country>" + generalContactCountry + "</Country>\n";
+ }
+ wmc += "\t\t\t</ContactAddress>\n";
+ }
+ wmc += "\t\t\t<ContactVoiceTelephone>" + generalContactVoiceTelephone + "</ContactVoiceTelephone>\n";
+ wmc += "\t\t\t<ContactFacsimileTelephone>" + generalContactFacsimileTelephone + "</ContactFacsimileTelephone>\n";
+ wmc += "\t\t\t<ContactElectronicMailAddress>" + generalContactElectronicMailAddress + "</ContactElectronicMailAddress>\n";
+ wmc += "\t\t</ContactInformation>\n";
+ }
+
+ wmc += "\t</General>\n";
+
+ //
+ //
+ //layerList
+ //
+ //
+ wmc += "\t<LayerList>\n";
+ for (var i = 0; i < mb_mapObj[ind].wms.length; i++){
+ //
+ //
+ // BEGIN: new code
+ //
+ //
+
+ // in the end, this array contains all epsg´s of this wms
+ var wms_epsg = new Array();
+
+ // the gui_wms_epsg is always the first epsg in this layer´s epsg list
+ wms_epsg[0] = mb_mapObj[ind].wms[i].gui_wms_epsg;
+
+ // the epsg of the mapObj has to be in this list
+ if (mb_mapObj[ind].wms[i].gui_wms_epsg != mb_mapObj[ind].epsg) {
+ wms_epsg[1] = mb_mapObj[ind].epsg;
+ }
+
+ // add all gui_epsg if not already in the array
+ for (q = 0; q < mb_mapObj[ind].wms[i].gui_epsg.length ; q ++) {
+ var isInArray = false;
+ for (r = 0 ; r < wms_epsg.length ; r ++) {
+ if (wms_epsg[r] == mb_mapObj[ind].wms[i].gui_epsg[q]) {
+ isInArray = true;
+ }
+ }
+ if (isInArray == false) {
+ wms_epsg[wms_epsg.length] = mb_mapObj[ind].wms[i].gui_epsg[q];
+ }
+ }
+
+ //
+ //
+ // END: new code
+ //
+ //
+
+ for (var j = 0; j < mb_mapObj[ind].wms[i].objLayer.length; j++) {
+ if (mb_mapObj[ind].wms[i].objLayer[j].layer_parent != '') {
+ if (mb_mapObj[ind].wms[i].objLayer[j].gui_layer_visible == '1') {
+ layerHidden = 0;
+ }
+ else {
+ layerHidden = 1;
+ }
+ layerQueryable = mb_mapObj[ind].wms[i].objLayer[j].layer_queryable;
+ layerName = mb_mapObj[ind].wms[i].objLayer[j].layer_name;
+ layerTitle = mb_mapObj[ind].wms[i].objLayer[j].layer_title;
+ layerAbstract = mb_mapObj[ind].wms[i].wms_abstract; //To Do: insert actual abstract
+ layerDataUrl = mb_mapObj[ind].wms[i].objLayer[j].layer_dataurl_href;
+ //layerDataUrl = mb_mapObj[ind].wms[i].objLayer[j].layer_dataurl_href;
+ layerMetadataUrl = mb_mapObj[ind].wms[i].objLayer[j].layer_metadataurl;
+ //layerMetadataUrl = mb_mapObj[ind].wms[i].objLayer[j].layer_metadataurl;
+ wmsVersion = mb_mapObj[ind].wms[i].wms_version;
+ wmsTitle = mb_mapObj[ind].wms[i].wms_title;
+ wmsOnlineResource = mb_mapObj[ind].wms[i].wms_getmap;
+ //wmsOnlineResource = mb_mapObj[ind].wms[i].wms_getmap;
+
+ wmc += "\t\t<Layer queryable = \"" + layerQueryable + "\" hidden = \"" + layerHidden + "\">\n";
+ wmc += "\t\t\t<Server service = \"OGC:WMS\" version = \"" + wmsVersion + "\" title = \"" + wmsTitle + "\">\n";
+ wmc += "\t\t\t\t<OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"" + wmsOnlineResource + "\" />\n";
+ wmc += "\t\t\t</Server>\n";
+
+ wmc += "\t\t\t<Name>" + layerName + "</Name>\n";
+ wmc += "\t\t\t<Title>" + layerTitle + "</Title>\n";
+
+ if (layerAbstract) {
+ wmc += "\t\t\t<Abstract>" + layerAbstract + "</Abstract>\n";
+ }
+
+ wmc += "\t\t\t<SRS>";
+ for (var k = 0; k < wms_epsg.length ; k ++) {
+ wmc += wms_epsg[k];
+ if (k < wms_epsg.length-1) {
+ wmc += " ";
+ }
+ }
+ wmc += "</SRS>\n";
+
+ if (layerDataUrl) {
+ wmc += "\t\t\t<DataURL>\n";
+ wmc += "\t\t\t\t<OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type = \"simple\" xlink:href=\"" + layerDataUrl + "\" />\n";
+ wmc += "\t\t\t</DataURL>\n";
+ }
+
+ if (layerMetadataUrl) {
+ wmc += "\t\t\t<MetadataURL>\n";
+ wmc += "\t\t\t\t<OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type = \"simple\" xlink:href=\"" + layerMetadataUrl + "\" />\n";
+ wmc += "\t\t\t</MetadataURL>\n";
+ }
+
+
+ //
+ //layerFormat
+ //
+ wmc += "\t\t\t<FormatList>\n";
+
+ for (var k = 0; k < 1; k++) {
+
+ if (k == 0) {
+ layerFormat_current = 1; // To do: insert proper data
+ }
+ else {
+ layerFormat_current = 0; // To do: insert proper data
+ }
+ layerFormat = mb_mapObj[ind].wms[i].gui_wms_mapformat;
+
+ wmc += "\t\t\t\t<Format ";
+
+ if (layerFormat_current == 1) {
+ wmc += "current = \"1\"";
+ }
+ wmc += ">" + layerFormat + "</Format>\n";
+ }
+
+ wmc += "\t\t\t</FormatList>\n";
+
+ //
+ // LayerStyle
+ //
+ wmc += "\t\t\t<StyleList>\n";
+
+ for (var k = 0; k < 1; k++) {
+
+ if (k == 0) {
+ layerStyle_current = 1; // To do: insert proper data
+ }
+ else {
+ layerStyle_current = 0; // To do: insert proper data
+ }
+
+ wmc += "\t\t\t\t<Style";
+
+ layerStyleSLD = "";
+
+ if (layerStyleSLD) {
+ layerStyleSLDUrl = ""; // To Do: Insert Proper Data
+ wmc += "\t\t\t\t\t\t<OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"" + layerStyleSLDUrl + "\" />\n";
+ }
+ else {
+ if (mb_mapObj[ind].wms[i].objLayer[j].layer_style[k]) {
+ layerStyle_name = mb_mapObj[ind].wms[i].objLayer[j].layer_style[k]['name'];
+ layerStyle_title = mb_mapObj[ind].wms[i].objLayer[j].layer_style[k]['title'];
+ layerStyle_legendUrl = mb_mapObj[ind].wms[i].objLayer[j].layer_style[k]["legendurl"];
+
+ }
+ else {
+ layerStyle_name = "default";
+ layerStyle_title = "default";
+ layerStyle_legendUrl = "";
+ }
+
+ layerStyle_legendUrl_width = ""; // To Do: add proper data
+ layerStyle_legendUrl_height = ""; // To Do: add proper data
+ layerStyle_legendUrl_format = ""; // To Do: add proper data
+
+// layerStyle_legendUrl = stripAmpersand(mb_mapObj[ind].wms[i].wms_getlegendurl);
+
+ if (layerStyle_current == 1) {
+ wmc += " current = \"1\"";
+ }
+ wmc += ">\n\t\t\t\t\t<Name>" + layerStyle_name + "</Name>\n";
+ wmc += "\t\t\t\t\t<Title>" + layerStyle_title + "</Title>\n";
+ wmc += "\t\t\t\t\t<LegendUrl ";
+ wmc += "width = \"" + layerStyle_legendUrl_width + "\" ";
+ wmc += "height = \"" + layerStyle_legendUrl_height + "\" ";
+ wmc += "format = \"" + layerStyle_legendUrl_format + "\">\n";
+ wmc += "\t\t\t\t\t\t<OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"" + layerStyle_legendUrl + "\" />\n";
+ wmc += "\t\t\t\t\t</LegendUrl>\n";
+ }
+
+ wmc += "\t\t\t\t</Style>\n";
+ //
+ // Missing: Describe Style via SLD (see: http://center.ccgis/phprojekt/addons/ewiki/index.php?id=links/SLD)
+ //
+ }
+
+ wmc += "\t\t\t</StyleList>\n";
+ wmc += "\t\t</Layer>\n";
+ }
+ }
+ }
+ wmc += "\t</LayerList>\n";
+ wmc += "</ViewContext>\n";
+
+
+
+ //document.sendData.target = "_blank";
+ document.sendData.action = "../javascripts/mod_insertWmcIntoDb.php";
+ document.sendData.data.value = user + "____" + generalTitle + "____" + wmc + "____" + id;
+ document.sendData.submit();
+ }
+}
+function mod_savewmc_init(obj) {
+ //document.getElementById("savewmc").src = mod_zoom1_img_over.src;
+ //obj.onmouseover = new Function("mod_zoomIn1_over()");
+ //obj.onmouseout = new Function("mod_zoomIn1_out()");
+}
+
+function mod_zoomIn1_over(){
+ // document.getElementById("zoomIn1").src = mod_zoom1_img_over.src;
+}
+function mod_zoomIn1_out(){
+ // document.getElementById("zoomIn1").src = mod_zoom1_img.src;
+}
+
+
+
Added: trunk/mapbender/http/javascripts/mod_scaleHint.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_scaleHint.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_scaleHint.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,62 @@
+<?php
+#$Id: mod_scaleHint.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_scaleHint.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'setScaleHint' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('mod_scaleHint: ID not unique!');";}
+$params = split(",",$e_target);
+
+echo "var mod_scaleHint_target = '".$params[0]."';";
+echo "var mod_scaleHint_min = '".$params[1]."';";
+echo "var mod_scaleHint_max = '".$params[2]."';";
+
+?>
+
+
+
+mb_registerPreFunctions("mod_scaleHint_init(frameName)");
+function mod_scaleHint_init(frameName){
+ if(frameName == mod_scaleHint_target){
+ var scale = mb_getScale(frameName);
+ if(scale < mod_scaleHint_min || scale > mod_scaleHint_max){
+ if(scale < mod_scaleHint_min){var newScale = mod_scaleHint_min; }
+ if(scale > mod_scaleHint_max){var newScale = mod_scaleHint_max; }
+ var ind = getMapObjIndexByName(frameName);
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ var x = parseFloat(arrayBBox[0]) + ((parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0]))/2);
+ var y = parseFloat(arrayBBox[1]) + ((parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]))/2);
+ var minx = parseFloat(x) - (mb_mapObj[ind].width / (mb_resolution * 100 *2) * newScale);
+ var miny = parseFloat(y) - (mb_mapObj[ind].height / (mb_resolution * 100 *2) * newScale);
+ var maxx = parseFloat(x) + (mb_mapObj[ind].width / (mb_resolution * 100 *2) * newScale);
+ var maxy = parseFloat(y) + (mb_mapObj[ind].height / (mb_resolution * 100 *2) * newScale);
+ mb_mapObj[ind].extent = minx + "," + miny + "," + maxx + "," + maxy;
+ }
+ }
+ return true;
+}
Added: trunk/mapbender/http/javascripts/mod_scaleSel.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_scaleSel.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_scaleSel.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,30 @@
+<?php
+#$Id: mod_scaleSel.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_scaleSel.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'scaleSelect' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+echo "var mod_scaleSelect_target = '".$e_target."';";
+if($cnt > 1){ echo "alert('scaleSelect: ID not unique!');";}
+?>
+mb_registerSubFunctions("mod_scaleSelect_val(frameName)");
+function mod_scaleSelect(obj){
+ var ind = obj.selectedIndex;
+ mb_repaintScale(mod_scaleSelect_target,null,null,obj.options[ind].value);
+}
+function mod_scaleSelect_val(frameName){
+ if(frameName == mod_scaleSelect_target){
+ var scale = mb_getScale(frameName);
+ document.getElementById("scaleSelect").options[0].text = "1 : " + scale;
+ document.getElementById("scaleSelect").options[0].selected = true;
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_scaleText.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_scaleText.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_scaleText.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,42 @@
+<?php
+#$Id: mod_scaleText.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_scaleText.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'scaleText' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+echo "var mod_scaleText_target = '".$e_target."';";
+if($cnt > 1){ echo "alert('scaleSelect: ID not unique!');";}
+?>
+function mod_scaleText(){
+ mod_scaleText_val(mod_scaleText_target);
+ return false;
+}
+function mod_scaleText_val(frameName){
+
+ var scale = document.getElementById("scaleText").elements[0];
+ if(scale.value.search(/\D/) != -1 || scale.value == ""){
+ scale.value = "";
+ return;
+ }
+ var ind = getMapObjIndexByName(frameName);
+ var arrayBBox = mb_mapObj[ind].extent.split(",");
+ var x = parseFloat(arrayBBox[0]) + ((parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0]))/2);
+ var y = parseFloat(arrayBBox[1]) + ((parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]))/2);
+
+ var minx = parseFloat(x) - (mb_mapObj[ind].width / (mb_resolution * 100 *2) * scale.value);
+ var miny = parseFloat(y) - (mb_mapObj[ind].height / (mb_resolution * 100 *2) * scale.value);
+ var maxx = parseFloat(x) + (mb_mapObj[ind].width / (mb_resolution * 100 *2) * scale.value);
+ var maxy = parseFloat(y) + (mb_mapObj[ind].height / (mb_resolution * 100 *2) * scale.value);
+ mb_mapObj[ind].extent = minx + "," + miny + "," + maxx + "," + maxy;
+ setMapRequest(frameName);
+ scale.value = "";
+}
Added: trunk/mapbender/http/javascripts/mod_scalebar.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_scalebar.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_scalebar.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,84 @@
+<?php
+#$Id: mod_scalebar.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_scalebar.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'scalebar' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('scalebar: ID not unique!');";}
+echo "var mod_scalebar_target = '".$e_target."';";
+?>
+
+var mod_scalebar_left = 5;
+var mod_scalebar_bottom = 17;
+
+var mod_scalebar_color1 = "white";
+var mod_scalebar_color2 = "black";
+var mod_scalebar_font = "Arial, Helvetica, sans-serif";
+var mod_scalebar_fontsize = "9px";
+
+mb_registerSubFunctions("mod_scalebar()");
+function mod_scalebar(){
+ var scale = mb_getScale(mod_scalebar_target);
+ var ind = getMapObjIndexByName(mod_scalebar_target);
+ if(scale < 10){
+ var unit = '10 cm';
+ var factor = 10/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ if(scale >= 10 && scale < 100){
+ var unit = '1 m';
+ var factor = 100/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ if(scale < 1000 && scale >= 100){
+ var unit = '10 m';
+ var factor = 1000/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ if(scale < 10000 && scale >= 1000){
+ var unit = '100 m';
+ var factor = 10000/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ if(scale < 100000 && scale >= 10000){
+ var unit = '1 km';
+ var factor = 100000/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ if(scale < 1000000 && scale >= 100000){
+ var unit = '10 km';
+ var factor = 1000000/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ if(scale < 10000000 && scale >= 1000000){
+ var unit = '100 km';
+ var factor = 10000000/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ if(scale < 100000000 && scale >= 10000000){
+ var unit = '1000 km';
+ var factor = 100000000/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ if(scale >= 100000000){
+ var unit = '1000 km';
+ var factor = 100000000/scale;
+ var img_width = Math.round(factor * mb_resolution);
+ }
+ var scalebarTag = "<img src='../img/scalebar_bw.gif' width='"+ img_width +"' height='6'> ";
+ scalebarTag += "<div style='position:absolute;left:"+(img_width + 4)+"px;top:5px;color:"+mod_scalebar_color1+";font-family:"+mod_scalebar_font+";font-size:"+mod_scalebar_fontsize+";'><nobr>"+ unit+"</nobr></div>";
+ scalebarTag += "<div style='position:absolute;left:"+(img_width + 2)+"px;top:7px;color:"+mod_scalebar_color1+";font-family:"+mod_scalebar_font+";font-size:"+mod_scalebar_fontsize+";'><nobr>"+ unit+"</nobr></div>";
+ scalebarTag += "<div style='position:absolute;left:"+(img_width + 2)+"px;top:5px;color:"+mod_scalebar_color1+";font-family:"+mod_scalebar_font+";font-size:"+mod_scalebar_fontsize+";'><nobr>"+ unit+"</nobr></div>";
+ scalebarTag += "<div style='position:absolute;left:"+(img_width + 3)+"px;top:6px;color:"+mod_scalebar_color2+";font-family:"+mod_scalebar_font+";font-size:"+mod_scalebar_fontsize+";'>"+ unit+"</div>";
+ mb_arrangeElement(mod_scalebar_target, "scalebar", mod_scalebar_left, (mb_mapObj[ind].height - mod_scalebar_bottom));
+ writeTag(mod_scalebar_target, "scalebar", scalebarTag);
+}
Added: trunk/mapbender/http/javascripts/mod_selArea.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_selArea.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_selArea.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,54 @@
+<?php
+#$Id: mod_selArea.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_selArea.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'selArea1' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('selArea1: ID not unique!');";}
+?>
+var mod_selArea_elName = "selArea1";
+var mod_selArea_frameName = "";
+var mod_selArea_target = "<?php echo $e_target; ?>";
+
+var mod_selArea_img_on = new Image(); mod_selArea_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_selArea_img_off = new Image(); mod_selArea_img_off.src = "<?php echo $e_src; ?>";
+var mod_selArea_img_over = new Image(); mod_selArea_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_selArea1(ind){
+ mb_button[ind] = document.getElementById(mod_selArea_elName);
+ mb_button[ind].img_over = mod_selArea_img_over.src;
+ mb_button[ind].img_on = mod_selArea_img_on.src;
+ mb_button[ind].img_off = mod_selArea_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_selArea_elName;
+ mb_button[ind].fName = mod_selArea_frameName;
+ mb_button[ind].go = new Function ("mod_selArea_click()");
+ mb_button[ind].stop = new Function ("mod_selArea_disable()");
+}
+function mod_selArea_click(){
+ var el = window.frames[mod_selArea_target].document;
+ el.onmouseover = mod_selArea_init;
+ el.onmousedown = mod_box_start;
+ el.onmouseup = mod_box_stop;
+ el.onmousemove = mod_box_run;
+}
+function mod_selArea_disable(){
+ var el = window.frames[mod_selArea_target].document;
+ el.onmousedown = null;
+ el.onmouseup = null;
+ el.onmousemove = null;
+}
+function mod_selArea_init(e){
+ mb_isBF = mod_selArea_target;
+ mb_zF = mod_selArea_target;
+}
Added: trunk/mapbender/http/javascripts/mod_selArea1.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_selArea1.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_selArea1.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,84 @@
+<?php
+#$Id: mod_selArea1.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_selArea1.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'selArea1' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('selArea1: ID not unique!');";}
+?>
+var mod_selArea_elName = "selArea1";
+var mod_selArea_frameName = "";
+var mod_selArea_target = "<?php echo $e_target; ?>";
+
+var mod_selArea_img_on = new Image(); mod_selArea_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_selArea_img_off = new Image(); mod_selArea_img_off.src = "<?php echo $e_src; ?>";
+var mod_selArea_img_over = new Image(); mod_selArea_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_selArea1(ind){
+ mb_button[ind] = document.getElementById(mod_selArea_elName);
+ mb_button[ind].img_over = mod_selArea_img_over.src;
+ mb_button[ind].img_on = mod_selArea_img_on.src;
+ mb_button[ind].img_off = mod_selArea_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_selArea_elName;
+ mb_button[ind].fName = mod_selArea_frameName;
+ mb_button[ind].go = new Function ("mod_selArea_click()");
+ mb_button[ind].stop = new Function ("mod_selArea_disable()");
+}
+function mod_selArea_click(){
+ var el = window.frames[mod_selArea_target].document;
+ el.onmouseover = mod_selArea_init;
+ el.onmousedown = mod_box_start;
+ el.onmouseup = mod_selArea_get;
+ el.onmousemove = mod_box_run;
+}
+function mod_selArea_disable(){
+ var el = window.frames[mod_selArea_target].document;
+ el.onmousedown = null;
+ el.onmouseup = null;
+ el.onmousemove = null;
+}
+function mod_selArea_init(e){
+ mb_isBF = mod_selArea_target;
+ mb_zF = mod_selArea_target;
+}
+function mod_selArea_get(e){
+ mod_selArea_setValidClipping(mod_box_stop(e));
+ mb_isBF = mod_selArea_target;
+ mb_zF = mod_selArea_target;
+}
+function mod_selArea_setValidClipping(coords){
+ if(coords.length > 2){
+ mb_calculateExtent(mb_zF,coords[0],coords[1],coords[2],coords[3]);
+ setMapRequest(mb_zF);
+ }
+ else{
+ zoom(mb_zF,true,1.0,coords[0], coords[1]);
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_selectMapsize.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_selectMapsize.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_selectMapsize.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,50 @@
+<?php
+#$Id: mod_selectMapsize.php,v 1.6 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_selectMapsize.php,v 1.6 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'selectMapsize' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('selectMapsize: ID not unique!');";}
+echo "var mod_selectMapsize_target = '".$e_target."';";
+?>
+
+function mod_selectMapsize(obj){
+ var ind = getMapObjIndexByName(mod_selectMapsize_target);
+ var p = obj.value.split(",");
+ var w = parseInt(p[0]) ;
+ var h = parseInt(p[1]);
+ var pos = makeClickPos2RealWorldPos(mod_selectMapsize_target,w,h);
+ var coords = mb_mapObj[ind].extent.split(",");
+ mb_mapObj[ind].extent = coords[0] + "," + pos[1] + "," + pos[0] + "," + coords[3];
+ mb_mapObj[ind].width = w;
+ mb_mapObj[ind].height = h;
+ document.getElementById(mod_selectMapsize_target).style.width = mb_mapObj[ind].width;
+ document.getElementById(mod_selectMapsize_target).style.height = mb_mapObj[ind].height;
+ window.frames[mod_selectMapsize_target].document.getElementById("maps").style.width = mb_mapObj[ind].width;
+ window.frames[mod_selectMapsize_target].document.getElementById("maps").style.height = mb_mapObj[ind].height;
+ setMapRequest(mod_selectMapsize_target);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_setBBOX1.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_setBBOX1.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_setBBOX1.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,29 @@
+<?php
+#$Id: mod_setBBOX1.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_setBBOX1.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+
+$gui_id = $_REQUEST["gui_id"];
+include("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'setBBOX' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('setBBOX: ID not unique!');";}
+echo "var mod_setBBOX_target = '".$e_target."';";
+?>
+mb_registerInitFunctions("mod_setBBOX_init()");
+function mod_setBBOX_init(){
+ var my_target = mod_setBBOX_target.split(",");
+ var myBBOX = "<?php echo $_SESSION['mb_myBBOX'] ?>";
+ for(var i=0; i<my_target.length; i++){
+ if(myBBOX != ""){
+ var coord = myBBOX.split(",");
+ mb_calculateExtent(my_target[i],parseFloat(coord[0]),parseFloat(coord[1]),parseFloat(coord[2]),parseFloat(coord[3]));
+ }
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_setBackground.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_setBackground.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_setBackground.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,77 @@
+<?php
+#$Id: mod_setBackground.php,v 1.10 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_setBackground.php,v 1.10 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'setBackground' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('setBackground: ID not unique!');";}
+
+if(isset($_REQUEST["wms"])){
+ $wms = $_REQUEST["wms"];
+}
+else{
+ $wms = 0;
+}
+echo "var mod_setBackground_wms = ".$wms.";";
+echo "var mod_setBackground_target = '".$e_target."';";
+?>
+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 cnt = 0;
+ var selInd;
+
+ document.setBackground.mod_setBackground_list.options[document.setBackground.mod_setBackground_list.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 newO = new Option(title, i, false,false);
+
+ document.setBackground.mod_setBackground_list.options[document.setBackground.mod_setBackground_list.length] = newO;
+ if (ind == i) {
+ selInd = cnt;
+ }
+ cnt++;
+ }
+ }
+ if (cnt >0) {
+ wms[ind].gui_wms_visible = 2;
+ document.setBackground.mod_setBackground_list.selectedIndex = selInd;
+ }
+ mod_setBackground_active = ind;
+}
+
+function mod_setBackground_change(obj){
+ wms[mod_setBackground_active].gui_wms_visible = 0;
+ wms[obj.value].gui_wms_visible = 2;
+ mod_setBackground_active = obj.value;
+ zoom(mod_setBackground_target,true, 1.0);
+}
Added: trunk/mapbender/http/javascripts/mod_setBackground_all.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_setBackground_all.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_setBackground_all.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,60 @@
+<?php
+#$Id: mod_setBackground_all.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_setBackground_all.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'setBackground_all' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('setBackground_all: ID not unique!');";}
+
+echo "var mod_setBackground_all_target = '".$e_target."';";
+?>
+
+var mod_setBackground_all_wms = new Array();
+function mod_setBackground_all_init(obj){
+ var ind = getMapObjIndexByName(mod_setBackground_all_target);
+ var cnt = 0;
+ if(obj.checked == true){
+ for(var i=0; i<mb_mapObj[ind].wms.length; i++){
+ if(wms[i].gui_wms_visible == '0'){
+ mod_setBackground_all_wms[cnt] = mb_mapObj[ind].wms[i].wms_id;
+ mb_mapObj[ind].wms[i].gui_wms_visible = "1";
+ cnt++;
+ }
+ }
+ }
+ else{
+ for(var i=0; i<mb_mapObj[ind].wms.length; i++){
+ for(var ii = 0; ii<mod_setBackground_all_wms.length; ii++){
+ if(mb_mapObj[ind].wms[i].wms_id == mod_setBackground_all_wms[ii]){
+ mb_mapObj[ind].wms[i].gui_wms_visible = "0";
+ }
+ }
+ }
+ }
+ zoom(mod_setBackground_all_target,true, 0.99);
+}
Added: trunk/mapbender/http/javascripts/mod_setTimeout.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_setTimeout.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_setTimeout.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,67 @@
+<?php
+#$Id: mod_setTimeout.php,v 1.3 2005/09/13 16:30:43 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_setTimeout.php,v 1.3 2005/09/13 16:30:43 uli_rothstein Exp $
+# 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.
+
+# requires a session-variable 'ttl'
+session_start();
+echo "var mod_timeout_ttl = '".(intval($_SESSION["ttl"])/60)."';";
+?>
+
+mod_timeout_cnt = false;
+
+/*
+* alert: a confirm - window to reload the application when timeout "ttl" is reached
+* logout: request mod_logout after timeout "ttl"
+*/
+mod_timeout_action = "alert";
+
+mb_registerSubFunctions("mod_setTimeout_set()"); // maprequest
+mb_registerInitFunctions("mod_setTimeout_interval()");
+function mod_setTimeout_interval(){
+ var aktiv = window.setInterval("mod_setTimeout_check()",60000);
+ mod_setTimeout_set();
+ mod_setTimeout_check();
+}
+
+function mod_setTimeout_set(){
+ mod_timeout_cnt = parseInt(mod_timeout_ttl);
+ mod_setTimeout_check();
+}
+
+function mod_setTimeout_check(){
+ var str = "<span style='font-family: Arial, Helvetica, sans-serif;font-size:10px;'>";
+ str += "Automatische Abmeldung: ";
+
+ if(mod_timeout_cnt >= 0){
+ str += mod_timeout_cnt;
+ }
+ else { str += "0"; }
+
+ str += " min";
+ str += "</span>";
+ writeTag("", "timeout", str );
+
+ if(mod_timeout_cnt == 0 && mod_timeout_action == 'alert'){
+ var go = confirm("Bitte beachten Sie, dass Ihre Session abgelaufen sein kann...\n Mit OK laden Sie die Anwendung neu!");
+ if(go == true){
+ document.location.href = "../frames/login.php";
+ }
+ }
+ if(mod_timeout_cnt == 0 && mod_timeout_action == 'logout'){ document.location.href = "../php/mod_logout.php";}
+ mod_timeout_cnt--;
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_state.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_state.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_state.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,60 @@
+<?php
+#$Id: mod_state.php,v 1.9 2006/03/09 08:43:56 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_state.php,v 1.9 2006/03/09 08:43:56 uli_rothstein Exp $
+# 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("mb_validateSession.php");
+$gui_id = $_SESSION["mb_user_gui"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<HTML>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>image map generator</title>
+<STYLE TYPE="text/css">
+ <!--
+ body{
+ background-color:#ffffff;
+ text-decoration: none;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size:9pt;
+ color: #003366;
+ margin-left: 0px;
+ margin-top: 0px;
+}
+
+ table{
+ font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+ color: #0066cc;
+ font-size:10pt
+ }
+
+ -->
+</STYLE>
+<BODY bgcolor='#ffffff'>
+<?php
+$sql = "SELECT stand FROM layer_metadata;";
+$res = db_query($sql);
+
+echo "Daten der Vertriebsplattform sind vom Stand: ".db_result($res,0,"stand");
+?>
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_tab.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_tab.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_tab.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,127 @@
+//$Id: mod_tab.js,v 1.7 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_tab.js,v 1.7 2005/09/13 14:38:11 bjoern_heuser Exp $
+/********** Configuration*************************************************/
+var tab_ids = new Array("frame1", "frame2", "frame3", "frame4");
+var tab_titles = new Array("Tab #1","Tab #2","Tab #3","Tab #4");
+var tab_frameHeight = new Array(300, 200, 300, 50);
+
+var tab_style = "position:absolute;background-color:lightGrey;font-family: 'Times New Roman', Times, serif;;font-size:12px;font-weight:bold;cursor:pointer;";
+var tab_prefix = " ";
+
+var tab_height = false;
+var tab_width = false;
+var tab_topOffset = false;
+var tab_leftOffset = false;
+
+var tab_active = -1;
+var tab_check = new Array();
+var tab_iv1 = false;
+var tab_wait = false;
+/********** Configuration*************************************************/
+mb_registerInitFunctions('tab_init()');
+function tab_init(){
+ var obj = document.getElementById("tabs").style;
+ tab_topOffset = parseInt(obj.top);
+ tab_leftOffset = parseInt(obj.left);
+ tab_width = parseInt(obj.width);
+ tab_height = parseInt(obj.height);
+ var str = "";
+ for(var i = 0; i<tab_ids.length; i++){
+ document.getElementById(tab_ids[i]).style.visibility = 'hidden';
+ tab_titles[i] = tab_prefix + tab_titles[i];
+ var newId = "tab_" + i;
+ str += "<div id='"+newId+"'";
+ str += "style='" + tab_style;
+ str += "top:" + ((i * tab_height)) + "px;";
+ str += "width:" + tab_width + "px;";
+ str += "'";
+ str += " onclick='tab_set("+i+")'>";
+ str += tab_titles[i];
+ str += "</div>";
+ }
+ document.getElementById("tabs").innerHTML = str;
+}
+
+function tab_set(ind){
+ if(tab_wait){
+ return;
+ }
+ tab_unsetFrame();
+ if(ind == tab_active){
+ tab_wait = true;
+ tab_active = -1;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+ else{
+ tab_wait = true;
+ tab_active = ind;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+}
+function tab_setFrame(ind){
+ var obj = document.getElementById(tab_ids[ind]).style;
+ var newpos = ((ind+1) * tab_height) + parseInt(tab_topOffset);
+ obj.top = (newpos + 1) + "px";
+ obj.left = (tab_leftOffset) + "px";
+ obj.width = tab_width;
+ obj.height = (tab_frameHeight[ind] - 2);
+ obj.visibility = 'visible';
+}
+function tab_unsetFrame(){
+ for(var i = 0; i<tab_ids.length; i++){
+ var obj = document.getElementById(tab_ids[i]).style;
+ obj.visibility = 'hidden';
+ }
+}
+function tab_open(tabid){
+ var t = false;
+ for(var i = 0; i<tab_ids.length; i++){
+ if(tab_ids[i] == tabid){
+ t = i;
+ }
+ }
+ if(tab_active != t){
+ tab_set(t);
+ }
+}
+function tab_move(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ var newpos = (i * tab_height);
+ if(i > ind && tab_active >= 0){
+ newpos += tab_frameHeight[ind];
+ }
+ var myid = "tab_" + i;
+ var pos = parseInt(document.getElementById(myid).style.top);
+ if(pos == newpos){
+ tab_check[i] = true;
+ }
+ else if(pos < newpos){
+ document.getElementById(myid).style.top = (pos + 10) + "px";
+ tab_check[i] = false;
+ }
+ else if(pos > newpos){
+ document.getElementById(myid).style.top = (pos - 10) + "px";
+ tab_check[i] = false;
+ }
+ }
+
+ var check = true;
+ for(var j=0; j<tab_check.length; j++){
+ if(tab_check[j] == false){
+ check = false;
+ }
+ }
+ if(check == true){
+ clearInterval(tab_iv1);
+ tab_check = new Array();
+ tab_wait = false;
+ if(ind >= 0){
+ tab_setFrame(ind);
+ }
+ return;
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_tab.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_tab.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_tab.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,143 @@
+//$Id: mod_tab.php,v 1.12 2006/01/23 16:17:48 astrid_emde Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_tab.php,v 1.12 2006/01/23 16:17:48 astrid_emde Exp $
+/********** Configuration*************************************************/
+<?php
+$gui_id = $_REQUEST["gui_id"];
+$e_id_css = 'tabs';
+include('../include/dyn_js.php');
+
+?>
+var tab_height = false;
+var tab_width = false;
+var tab_topOffset = false;
+var tab_leftOffset = false;
+var tab_active = -1;
+var tab_check = new Array();
+var tab_iv1 = false;
+var tab_wait = false;
+
+try{
+ if (open_tab){}
+}
+catch(e){
+ open_tab = false;
+}
+
+/********** Configuration*************************************************/
+mb_registerInitFunctions('tab_init()');
+function tab_init(){
+ var obj = document.getElementById("tabs").style;
+ tab_topOffset = parseInt(obj.top);
+ tab_leftOffset = parseInt(obj.left);
+ tab_width = parseInt(obj.width);
+ tab_height = parseInt(obj.height);
+ var str = "";
+
+ for(var i = 0; i<tab_ids.length; i++){
+ document.getElementById(tab_ids[i]).style.visibility = 'hidden';
+ tab_titles[i] = tab_prefix + tab_titles[i];
+ var newId = "tab_" + i;
+ str += "<div id='"+newId+"' ";
+ str += "style='";
+ str += tab_style;
+ str += "width:"+tab_width+"px;";
+ str += "height:"+tab_height+"px;";
+ str += "top:" + ((i * tab_height)) + "px;";
+ str += "'";
+ str += " onclick='tab_set("+i+")'>";
+ str += tab_titles[i];
+ str += "</div>";
+ }
+ document.getElementById("tabs").innerHTML = str;
+
+ if (open_tab != 'false'){
+ tab_set(open_tab);
+ }
+}
+function tab_set(ind){
+ if(tab_wait){
+ return;
+ }
+ tab_unsetFrame();
+ if(ind == tab_active){
+ tab_wait = true;
+ tab_active = -1;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+ else{
+ tab_wait = true;
+ tab_active = ind;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+}
+function tab_setFrame(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ if(i == ind){
+ var obj = document.getElementById(tab_ids[i]).style;
+ var newpos = ((i+1) * tab_height) + parseInt(tab_topOffset);
+ obj.top = (newpos + 1) + "px";
+ obj.left = (tab_leftOffset) + "px";
+ obj.width = tab_width;
+ obj.height = (parseInt(tab_frameHeight[ind]) - 2);
+ obj.visibility = 'visible';
+ }
+ }
+}
+function tab_unsetFrame(){
+ for(var i = 0; i<tab_ids.length; i++){
+ var obj = document.getElementById(tab_ids[i]).style;
+ obj.visibility = 'hidden';
+ }
+}
+function tab_open(tabid){
+ var t = false;
+ for(var i = 0; i<tab_ids.length; i++){
+ if(tab_ids[i] == tabid){
+ t = i;
+ }
+ }
+ if(tab_active != t){
+ tab_set(t);
+ }
+}
+function tab_move(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ var newpos = (i * tab_height);
+ if(i > ind && tab_active >= 0){
+ newpos += parseInt(tab_frameHeight[ind]);
+ }
+ var myid = "tab_" + i;
+ var pos = parseInt(document.getElementById(myid).style.top);
+ if(pos == newpos){
+ tab_check[i] = true;
+ }
+ else if(pos < newpos){
+ document.getElementById(myid).style.top = (pos + 10) + "px";
+ tab_check[i] = false;
+ }
+ else if(pos > newpos){
+ document.getElementById(myid).style.top = (pos - 10) + "px";
+ tab_check[i] = false;
+ }
+ }
+
+ var check = true;
+ for(var j=0; j<tab_check.length; j++){
+ if(tab_check[j] == false){
+ check = false;
+ }
+ }
+ if(check == true){
+ clearInterval(tab_iv1);
+ tab_check = new Array();
+ tab_wait = false;
+ if(ind >= 0){
+ tab_setFrame(ind);
+ }
+ return;
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_tab_gui.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_tab_gui.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_tab_gui.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,136 @@
+//$Id: mod_tab_gui.js,v 1.5 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_tab_gui.js,v 1.5 2005/09/13 14:38:11 bjoern_heuser Exp $
+/********** Configuration*************************************************/
+var tab_ids = new Array("treeGDE","legend","printPDF","imprint");
+var tab_titles = new Array("Maps","Legend","Print","Imprint");
+var tab_frameHeight = new Array(250, 250, 200, 180);
+
+var tab_style = "position:absolute;visibility:visible;border: 1px solid white;font-size:12;color:#343434;background-color:#CFD2D4;cursor:pointer;";
+var tab_prefix = " ";
+
+var tab_height = false;
+var tab_width = false;
+var tab_topOffset = false;
+var tab_leftOffset = false;
+var tab_active = -1;
+var tab_check = new Array();
+var tab_iv1 = false;
+var tab_wait = false;
+/********** Configuration*************************************************/
+mb_registerInitFunctions('tab_init()');
+function tab_init(){
+ var obj = document.getElementById("tabs").style;
+ tab_topOffset = parseInt(obj.top);
+ tab_leftOffset = parseInt(obj.left);
+ tab_width = parseInt(obj.width);
+ tab_height = parseInt(obj.height);
+ var str = "";
+ for(var i = 0; i<tab_ids.length; i++){
+ document.getElementById(tab_ids[i]).style.visibility = 'hidden';
+ document.getElementById(tab_ids[i]).style.visibility = 'hidden';
+ document.getElementById(tab_ids[i]).style.left = '1px';
+ document.getElementById(tab_ids[i]).style.top = '1px';
+ document.getElementById(tab_ids[i]).style.width = '1px';
+ document.getElementById(tab_ids[i]).style.height = '1px';
+ tab_titles[i] = tab_prefix + tab_titles[i];
+ var newId = "tab_" + i;
+ str += "<div id='"+newId+"' ";
+ str += "style='";
+ str += tab_style;
+ str += "width:"+tab_width+"px;";
+ str += "height:"+tab_height+"px;";
+ str += "top:" + ((i * tab_height)) + "px;";
+ str += "'";
+ str += " onclick='tab_set("+i+")'>";
+ str += tab_titles[i];
+ str += "</div>";
+ }
+ document.getElementById("tabs").innerHTML = str;
+}
+function tab_set(ind){
+ if(tab_wait){
+ return;
+ }
+ tab_unsetFrame();
+ if(ind == tab_active){
+ tab_wait = true;
+ tab_active = -1;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+ else{
+ tab_wait = true;
+ tab_active = ind;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+}
+function tab_setFrame(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ if(i == ind){
+ var obj = document.getElementById(tab_ids[i]).style;
+ var newpos = ((i+1) * tab_height) + parseInt(tab_topOffset);
+ obj.top = (newpos + 1) + "px";
+ obj.left = (tab_leftOffset) + "px";
+ obj.width = tab_width;
+ obj.height = (tab_frameHeight[ind] - 2);
+ obj.visibility = 'visible';
+ }
+ }
+}
+function tab_unsetFrame(){
+ for(var i = 0; i<tab_ids.length; i++){
+ var obj = document.getElementById(tab_ids[i]).style;
+ obj.visibility = 'hidden';
+ }
+}
+function tab_open(tabid){
+ var t = false;
+ for(var i = 0; i<tab_ids.length; i++){
+ if(tab_ids[i] == tabid){
+ t = i;
+ }
+ }
+ if(tab_active != t){
+ tab_set(t);
+ }
+}
+function tab_move(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ var newpos = (i * tab_height);
+ if(i > ind && tab_active >= 0){
+ newpos += tab_frameHeight[ind];
+ }
+ var myid = "tab_" + i;
+ var pos = parseInt(document.getElementById(myid).style.top);
+ if(pos == newpos){
+ tab_check[i] = true;
+ }
+ else if(pos < newpos){
+ document.getElementById(myid).style.top = (pos + 10) + "px";
+ tab_check[i] = false;
+ }
+ else if(pos > newpos){
+ document.getElementById(myid).style.top = (pos - 10) + "px";
+ tab_check[i] = false;
+ }
+ }
+
+ var check = true;
+ for(var j=0; j<tab_check.length; j++){
+ if(tab_check[j] == false){
+ check = false;
+ }
+ }
+ if(check == true){
+ clearInterval(tab_iv1);
+ tab_check = new Array();
+ tab_wait = false;
+ if(ind >= 0){
+ tab_setFrame(ind);
+ }
+ return;
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_tab_gui_cb.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_tab_gui_cb.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_tab_gui_cb.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,122 @@
+//$Id: mod_tab_gui_cb.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_tab_gui_cb.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+/********** Configuration*************************************************/
+var tab_ids = new Array("treeGDE","legend","print_iframe","imprint","digitize");
+var tab_titles = new Array("Maps","Legend","Print","Imprint", "Digitize");
+var tab_frameHeight = new Array(200, 260, 110, 180, 200);
+var tab_style = "position:absolute;visibility:visible;border: 1px solid white;font-size:12;color:#343434;background-color:#CFD2D4;cursor:pointer;";
+var tab_prefix = " ";
+var tab_height = false;
+var tab_width = false;
+var tab_topOffset = false;
+var tab_leftOffset = false;
+var tab_active = -1;
+var tab_check = new Array();
+var tab_iv1 = false;
+var tab_wait = false;
+/********** Configuration*************************************************/
+mb_registerInitFunctions('tab_init()');
+function tab_init(){
+ var obj = document.getElementById("tabs").style;
+ tab_topOffset = parseInt(obj.top);
+ tab_leftOffset = parseInt(obj.left);
+ tab_width = parseInt(obj.width);
+ tab_height = parseInt(obj.height);
+ var str = "";
+ for(var i = 0; i<tab_ids.length; i++){
+ document.getElementById(tab_ids[i]).style.visibility = 'hidden';
+ document.getElementById(tab_ids[i]).style.left = '1px';
+ document.getElementById(tab_ids[i]).style.top = '1px';
+ document.getElementById(tab_ids[i]).style.width = '1px';
+ document.getElementById(tab_ids[i]).style.height = '1px';
+ tab_titles[i] = tab_prefix + tab_titles[i];
+ var newId = "tab_" + i;
+ str += "<div id='"+newId+"' ";
+ str += "style='";
+ str += tab_style;
+ str += "width:"+tab_width+"px;";
+ str += "height:"+tab_height+"px;";
+ str += "top:" + ((i * tab_height)) + "px;";
+ str += "'";
+ str += " onclick='tab_set("+i+")'>";
+ str += tab_titles[i];
+ str += "</div>";
+ }
+ document.getElementById("tabs").innerHTML = str;
+}
+function tab_set(ind){
+ if(tab_wait){
+ return;
+ }
+ tab_unsetFrame();
+ if(ind == tab_active){
+ tab_wait = true;
+ tab_active = -1;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+ else{
+ tab_wait = true;
+ tab_active = ind;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+}
+function tab_setFrame(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ if(i == ind){
+ var obj = document.getElementById(tab_ids[i]).style;
+ var newpos = ((i+1) * tab_height) + parseInt(tab_topOffset);
+ obj.top = (newpos + 1) + "px";
+ obj.left = (tab_leftOffset) + "px";
+ obj.width = tab_width;
+ obj.height = (tab_frameHeight[ind] - 2);
+ obj.visibility = 'visible';
+ }
+ }
+}
+function tab_unsetFrame(){
+ for(var i = 0; i<tab_ids.length; i++){
+ var obj = document.getElementById(tab_ids[i]).style;
+ obj.visibility = 'hidden';
+ }
+}
+function tab_move(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ var newpos = (i * tab_height);
+ if(i > ind && tab_active >= 0){
+ newpos += tab_frameHeight[ind];
+ }
+ var myid = "tab_" + i;
+ var pos = parseInt(document.getElementById(myid).style.top);
+ if(pos == newpos){
+ tab_check[i] = true;
+ }
+ else if(pos < newpos){
+ document.getElementById(myid).style.top = (pos + 10) + "px";
+ tab_check[i] = false;
+ }
+ else if(pos > newpos){
+ document.getElementById(myid).style.top = (pos - 10) + "px";
+ tab_check[i] = false;
+ }
+ }
+
+ var check = true;
+ for(var j=0; j<tab_check.length; j++){
+ if(tab_check[j] == false){
+ check = false;
+ }
+ }
+ if(check == true){
+ clearInterval(tab_iv1);
+ tab_check = new Array();
+ tab_wait = false;
+ if(ind >= 0){
+ tab_setFrame(ind);
+ }
+ return;
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_tab_gui_de.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_tab_gui_de.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_tab_gui_de.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,131 @@
+//$Id: mod_tab_gui_de.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_tab_gui_de.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
+/********** Configuration*************************************************/
+var tab_ids = new Array("treeGDE","legend","printPDF","imprint");
+var tab_titles = new Array("Karten","Legende","Druck","Impressum");
+var tab_frameHeight = new Array(250, 250, 200, 180);
+
+var tab_style = "position:absolute;visibility:visible;border: 1px solid white;font-size:12;color:#343434;background-color:#CFD2D4;cursor:pointer;";
+var tab_prefix = " ";
+
+var tab_height = false;
+var tab_width = false;
+var tab_topOffset = false;
+var tab_leftOffset = false;
+var tab_active = -1;
+var tab_check = new Array();
+var tab_iv1 = false;
+var tab_wait = false;
+/********** Configuration*************************************************/
+mb_registerInitFunctions('tab_init()');
+function tab_init(){
+ var obj = document.getElementById("tabs").style;
+ tab_topOffset = parseInt(obj.top);
+ tab_leftOffset = parseInt(obj.left);
+ tab_width = parseInt(obj.width);
+ tab_height = parseInt(obj.height);
+ var str = "";
+ for(var i = 0; i<tab_ids.length; i++){
+ document.getElementById(tab_ids[i]).style.visibility = 'hidden';
+ tab_titles[i] = tab_prefix + tab_titles[i];
+ var newId = "tab_" + i;
+ str += "<div id='"+newId+"' ";
+ str += "style='";
+ str += tab_style;
+ str += "width:"+tab_width+"px;";
+ str += "height:"+tab_height+"px;";
+ str += "top:" + ((i * tab_height)) + "px;";
+ str += "'";
+ str += " onclick='tab_set("+i+")'>";
+ str += tab_titles[i];
+ str += "</div>";
+ }
+ document.getElementById("tabs").innerHTML = str;
+}
+function tab_set(ind){
+ if(tab_wait){
+ return;
+ }
+ tab_unsetFrame();
+ if(ind == tab_active){
+ tab_wait = true;
+ tab_active = -1;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+ else{
+ tab_wait = true;
+ tab_active = ind;
+ tab_check = new Array();
+ tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+ return;
+ }
+}
+function tab_setFrame(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ if(i == ind){
+ var obj = document.getElementById(tab_ids[i]).style;
+ var newpos = ((i+1) * tab_height) + parseInt(tab_topOffset);
+ obj.top = (newpos + 1) + "px";
+ obj.left = (tab_leftOffset) + "px";
+ obj.width = tab_width;
+ obj.height = (tab_frameHeight[ind] - 2);
+ obj.visibility = 'visible';
+ }
+ }
+}
+function tab_unsetFrame(){
+ for(var i = 0; i<tab_ids.length; i++){
+ var obj = document.getElementById(tab_ids[i]).style;
+ obj.visibility = 'hidden';
+ }
+}
+function tab_open(tabid){
+ var t = false;
+ for(var i = 0; i<tab_ids.length; i++){
+ if(tab_ids[i] == tabid){
+ t = i;
+ }
+ }
+ if(tab_active != t){
+ tab_set(t);
+ }
+}
+function tab_move(ind){
+ for(var i = 0; i<tab_ids.length; i++){
+ var newpos = (i * tab_height);
+ if(i > ind && tab_active >= 0){
+ newpos += tab_frameHeight[ind];
+ }
+ var myid = "tab_" + i;
+ var pos = parseInt(document.getElementById(myid).style.top);
+ if(pos == newpos){
+ tab_check[i] = true;
+ }
+ else if(pos < newpos){
+ document.getElementById(myid).style.top = (pos + 10) + "px";
+ tab_check[i] = false;
+ }
+ else if(pos > newpos){
+ document.getElementById(myid).style.top = (pos - 10) + "px";
+ tab_check[i] = false;
+ }
+ }
+
+ var check = true;
+ for(var j=0; j<tab_check.length; j++){
+ if(tab_check[j] == false){
+ check = false;
+ }
+ }
+ if(check == true){
+ clearInterval(tab_iv1);
+ tab_check = new Array();
+ tab_wait = false;
+ if(ind >= 0){
+ tab_setFrame(ind);
+ }
+ return;
+ }
+}
Added: trunk/mapbender/http/javascripts/mod_toggleModule.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_toggleModule.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_toggleModule.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,39 @@
+<?php
+#$Id: mod_toggleModule.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_toggleModule.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+# 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.
+
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'toggleModule' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('toggleModule: ID not unique!');";}
+echo "var mod_toggleModule ='".$e_target."';";
+?>
+mb_registerInitFunctions('mod_toggleModule_init()');
+function mod_toggleModule_init(){
+ mb_regButton(mod_toggleModule);
+ mb_button_click(0);
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_treeConf.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_treeConf.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_treeConf.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,3 @@
+//$Id: mod_treeConf.js,v 1.2 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_treeConf.js,v 1.2 2005/09/13 14:38:11 bjoern_heuser Exp $
+mb_registerSubFunctions("window.frames['treeConfGDE'].checkLayer()");
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/mod_usemap.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_usemap.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_usemap.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,133 @@
+//$Id: mod_usemap.php,v 1.5 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_usemap.php,v 1.5 2005/09/13 14:38:11 bjoern_heuser Exp $
+var mod_usemap_target = 'mapframe1';
+var mod_usemap_wfs = "http://wms1.ccgis.de/cgi-bin/mapserv?map=/data/umn/wfs/germany_wfs_usemap.map&SERVICE=WFS&REQUEST=getFeature&TYPENAME=Staedtepunkte&VERSION=1.0.0";
+var mod_usemap_px = 10;
+var um_title;
+var um_draw;
+
+mb_registerSubFunctions('mod_usemap_init()');
+mb_registerInitFunctions("um_init()")
+
+function mod_usemap_init(){
+ var ind = getMapObjIndexByName(mod_usemap_target);
+ var extent = mb_mapObj[ind].extent;
+ var url = "../php/mod_usemap.php?url="
+ url += escape(mod_usemap_wfs + "&BBOX=" + extent);
+ url += "&extent=" + extent;
+ url += "&width=" + mb_mapObj[ind].width;
+ url += "&height=" + mb_mapObj[ind].height;
+ document.getElementById('usemap').src = url;
+ var myImg = window.frames[mod_usemap_target].document.getElementById("um_img").style;
+ myImg.width = mb_mapObj[ind].width;
+ myImg.height = mb_mapObj[ind].height;
+}
+function mod_usemap_set(title,x,y){
+ var str = "";
+ for(var i=0; i<title.length; i++){
+ var pos = makeRealWorld2mapPos(mod_usemap_target,x[i],y[i]);
+ str += "<AREA onmouseover='parent.over(event, \"" + title[i] + "\", this)' ";
+ str += "onmouseout=parent.out(this) shape='circle' coords='";
+ str += Math.round(pos[0]) + "," + Math.round(pos[1]) + "," + mod_usemap_px + "'";
+ str += " href='#'>";
+ }
+ writeTag(mod_usemap_target, 'um', str);
+}
+
+
+
+/* Opacity for hilighting */
+ cw_opacity = 0.5;
+/* Color for polygon boundary */
+ cw_bndcolor = "#ff0000";
+/* Color for polygon fill */
+ cw_fillcolor = "#ffff00";
+
+
+
+
+function polyXcoords(coords) {
+ var Xcoords = '';
+ for (var z = 0; z<coords.length; z=z+2) {
+ if (z > 0) { Xcoords += ', '; }
+ Xcoords += parseInt(coords[z]);
+ }
+ return Xcoords;
+ }
+
+function polyYcoords(coords) {
+ var Ycoords = '';
+ for (var z = 1; z<coords.length; z=z+2) {
+ if (z > 1) { Ycoords += ', '; }
+ Ycoords += parseInt(coords[z]);
+ }
+ return Ycoords;
+}
+
+function setFocus(objid) {
+ if (canvasHasDrawing == true) return true;
+ var coords = objid.coords.split(',');
+ if ((objid.shape.toUpperCase() == 'POLY') || (objid.shape.toUpperCase() == 'POLYGON')) {
+ var Xcoords = polyXcoords(coords);
+ var Ycoords = polyYcoords(coords);
+ var pgx = Xcoords.split(',');
+ var pgy = Ycoords.split(',');
+ for (var i=0 ; i<pgx.length ; i++ ) {
+ pgx[i] = parseInt(pgx[i]);
+ pgy[i] = parseInt(pgy[i]);
+ }
+ canvas.setColor(cw_fillcolor);
+ canvas.fillPolygon(pgx,pgy);
+ canvas.paint();
+ canvas.setColor(cw_bndcolor);
+ canvas.drawPolygon(pgx,pgy);
+ canvas.paint();
+ }
+ if ((objid.shape.toUpperCase() == 'CIRCLE')) {
+ var c = coords;
+ canvas.setColor(cw_fillcolor);
+ canvas.fillEllipse(parseInt(c[0])-mod_usemap_px/2,parseInt(c[1])-mod_usemap_px/2,parseInt(c[2]),parseInt(c[2]));
+ canvas.paint();
+ canvas.setColor(cw_bndcolor);
+ canvas.drawEllipse(parseInt(c[0])-mod_usemap_px/2,parseInt(c[1])-mod_usemap_px/2,parseInt(c[2]),parseInt(c[2]));
+ canvas.paint();
+ }
+ canvasHasDrawing = true;
+ return true;
+ }
+
+function clearFocus(objid) {
+ if (canvasHasDrawing) canvas.clear();
+ canvasHasDrawing = false;
+ return true;
+ }
+
+function over(e, id, area) {
+ var coords = area.coords.split(',');
+ area.setAttribute('title', "");
+ if (!isOver) {
+ um_title.innerHTML = id;
+ um_title.style.display = "block";
+ isOver = area;
+ setFocus(area);
+ }
+ mb_arrangeElement(mod_usemap_target, 'um_title', parseInt(coords[0])+mod_usemap_px, parseInt(coords[1])+mod_usemap_px);
+ canvasHasDrawing = true;
+}
+
+function out(area) {
+ um_title.innerHTML = "";
+ um_title.style.display = "none";
+ clearFocus(area);
+ isOver = false;
+ canvasHasDrawing = false;
+}
+
+function um_init() {
+ um_title = window.frames[mod_usemap_target].document.getElementById("um_title"); /* tooltip */
+ um_draw = window.frames[mod_usemap_target].document.getElementById("um_draw"); /* tooltip */
+ canvas = new jsGraphics('um_draw', window.frames['mapframe1']);
+ canvas.setStroke(2);
+ canvasHasDrawing = false;
+ isOver = false;
+}
Added: trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,357 @@
+ <?php
+#$Id: mod_wfs_SpatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
+#$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
+#
+# 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("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'setSpatialRequest' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('setExtRequest: ID not unique!');";}
+echo "var mod_wfs_SpatialRequest_target = '".$e_target."';";
+?>
+var mod_wfs_SpatialRequest_color1 = "white";
+var mod_wfs_SpatialRequest_color2 = "black";
+var mod_wfs_SpatialRequest_font = "Arial, Helvetica, sans-serif";
+var mod_wfs_SpatialRequest_fontsize = "9px";
+var mod_wfs_SpatialRequest_basepoint = "#8a2be2";
+var mod_wfs_SpatialRequest_linepoint = "#ff00ff";
+var mod_wfs_SpatialRequest_bg = "";
+var mod_wfs_SpatialRequest_pgsql = true;
+
+var mod_wfs_SpatialRequest_win = null;
+
+var mod_wfs_SpatialRequest_useExtent = true;
+
+var mod_wfs_SpatialRequest_elName = "setSpatialRequest";
+var mod_wfs_SpatialRequest_frameName = "";
+var mod_wfs_SpatialRequest_epsg;
+var mod_wfs_SpatialRequest_width;
+var mod_wfs_SpatialRequest_height;
+var mod_wfs_SpatialRequest_RX = new Array();
+var mod_wfs_SpatialRequest_RY = new Array();
+var mod_wfs_SpatialRequest_Dist = new Array();
+var mod_wfs_SpatialRequest_TotalDist = new Array();
+var mod_wfs_SpatialRequestSubFunctions = new Array();
+
+var mod_wfs_SpatialRequest_img_on = new Image(); mod_wfs_SpatialRequest_img_on.src = "<?php echo preg_replace("/_off/","_on",$e_src); ?>";
+var mod_wfs_SpatialRequest_img_off = new Image(); mod_wfs_SpatialRequest_img_off.src = "<?php echo $e_src; ?>";
+var mod_wfs_SpatialRequest_img_over = new Image(); mod_wfs_SpatialRequest_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function init_mod_wfs_SpatialRequest(ind){
+ mb_button[ind] = document.getElementById(mod_wfs_SpatialRequest_elName);
+ mb_button[ind].img_over = mod_wfs_SpatialRequest_img_over.src;
+ mb_button[ind].img_on = mod_wfs_SpatialRequest_img_on.src;
+ mb_button[ind].img_off = mod_wfs_SpatialRequest_img_off.src;
+ mb_button[ind].status = 0;
+ mb_button[ind].elName = mod_wfs_SpatialRequest_elName;
+ mb_button[ind].fName = mod_wfs_SpatialRequest_frameName;
+ mb_button[ind].go = new Function ("mod_wfs_SpatialRequest_do()");
+ mb_button[ind].stop = new Function ("mod_wfs_SpatialRequest_disable()");
+ var ind = getMapObjIndexByName(mod_wfs_SpatialRequest_target);
+ mod_wfs_SpatialRequest_width = mb_mapObj[ind].width;
+ mod_wfs_SpatialRequest_height = mb_mapObj[ind].height;
+ mod_wfs_SpatialRequest_epsg = mb_mapObj[ind].epsg;
+ mb_registerSubFunctions("drawDashedLineExt()");
+ mb_registerPanSubElement("measuring");
+}
+
+function useExtentIsSet () {
+ return mod_wfs_SpatialRequest_useExtent;
+}
+
+function register_setExtRequestSubFunctions(stringFunction){
+ mod_wfs_SpatialRequestSubFunctions[mod_wfs_SpatialRequestSubFunctions.length] = stringFunction;
+}
+function mod_wfs_SpatialRequest_do(){
+ mod_wfs_SpatialRequest_dialog();
+}
+function mod_wfs_SpatialRequest_decide(){
+ if(mod_wfs_SpatialRequest_geom == 'rectangle'){
+ mod_wfs_SpatialRequest_useExtent = false;
+ mod_selAreaExt_click();
+ }
+ else if (mod_wfs_SpatialRequest_geom == 'extent') {
+ mod_wfs_SpatialRequest_useExtent = true;
+ var ind = getMapObjIndexByName(mod_wfs_SpatialRequest_target);
+ var pos_a = makeClickPos2RealWorldPos(mod_wfs_SpatialRequest_target,0,0);
+ var pos_b = makeClickPos2RealWorldPos(mod_wfs_SpatialRequest_target,mb_mapObj[ind].width,mb_mapObj[ind].height);
+
+ mod_wfs_SpatialRequest_RX[0] = pos_a[0];
+ mod_wfs_SpatialRequest_RY[0] = pos_a[1];
+ mod_wfs_SpatialRequest_RX[1] = pos_b[0];
+ mod_wfs_SpatialRequest_RY[1] = pos_b[1];
+ mod_getAreaExt_send();
+ }
+ else{
+ mod_wfs_SpatialRequest_useExtent = false;
+ mod_wfs_SpatialRequest_go();
+ }
+}
+function mod_wfs_SpatialRequest_go(){
+ var el = window.frames[mod_wfs_SpatialRequest_target].document;
+ el.onmousedown = mod_wfs_SpatialRequest_start;
+ el.onmousemove = mod_wfs_SpatialRequest_run;
+ 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);
+}
+function mod_wfs_SpatialRequest_disable(){
+ var el = window.frames[mod_wfs_SpatialRequest_target].document;
+ el.onmousedown = null;
+ el.onmousemove = null;
+ writeTag(mod_wfs_SpatialRequest_target,"measure_display","");
+ writeTag(mod_wfs_SpatialRequest_target,"measure_sub","");
+}
+function mod_wfs_SpatialRequest_timeout(){
+ var el = window.frames[mod_wfs_SpatialRequest_target].document;
+ el.onmousedown = null;
+ el.ondblclick = null;
+ el.onmousemove = null;
+}
+function mod_wfs_SpatialRequest_disableTimeout(){
+ var el = window.frames[mod_wfs_SpatialRequest_target].document;
+ el.onmousedown = mod_wfs_SpatialRequest_start;
+ el.onmousemove = mod_wfs_SpatialRequest_run;
+}
+function mod_wfs_SpatialRequest_start(e){
+ mb_getMousePos(e,mod_wfs_SpatialRequest_target);
+ var realWorldPos = makeClickPos2RealWorldPos(mod_wfs_SpatialRequest_target,clickX,clickY);
+ mod_wfs_SpatialRequest_RX[mod_wfs_SpatialRequest_RX.length] = Math.round(realWorldPos[0] * 100)/100;
+ mod_wfs_SpatialRequest_RY[mod_wfs_SpatialRequest_RY.length] = Math.round(realWorldPos[1] * 100)/100;
+ if(mod_wfs_SpatialRequest_geom == 'point'){
+ mod_getAreaExt_send();
+ return;
+ }
+ if(mod_wfs_SpatialRequest_RX.length > 1){
+ var dist_x = Math.abs(mod_wfs_SpatialRequest_RX[mod_wfs_SpatialRequest_RX.length-2] - mod_wfs_SpatialRequest_RX[mod_wfs_SpatialRequest_RX.length-1]);
+ var dist_y = Math.abs(mod_wfs_SpatialRequest_RY[mod_wfs_SpatialRequest_RY.length-2] - mod_wfs_SpatialRequest_RY[mod_wfs_SpatialRequest_RY.length-1]);
+ var dist = Math.round(Math.sqrt(Math.pow(dist_x,2) + Math.pow(dist_y,2))*100)/100;
+ mod_wfs_SpatialRequest_Dist[mod_wfs_SpatialRequest_Dist.length] = dist;
+ var totalDist = mod_wfs_SpatialRequest_TotalDist[mod_wfs_SpatialRequest_TotalDist.length-1] + dist;
+ mod_wfs_SpatialRequest_TotalDist[mod_wfs_SpatialRequest_TotalDist.length] = Math.round(totalDist * 100)/100;
+ }
+ else{
+ mod_wfs_SpatialRequest_Dist[mod_wfs_SpatialRequest_Dist.length] = 0;
+ mod_wfs_SpatialRequest_TotalDist[mod_wfs_SpatialRequest_TotalDist.length] = 0;
+ }
+ drawDashedLineExt();
+}
+function drawDashedLineExt(){
+ var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mod_wfs_SpatialRequest_width+"' height='0'></div>";
+ str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mod_wfs_SpatialRequest_height+"'></div>";
+ for(var i=0; i<mod_wfs_SpatialRequest_RX.length; i++){
+ var pos = makeRealWorld2mapPos(mod_wfs_SpatialRequest_target,mod_wfs_SpatialRequest_RX[i],mod_wfs_SpatialRequest_RY[i]);
+ str_mPoints += "<div style='font-size:1px;position:absolute;top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;width:4px;height:4px;background-color:"+mod_wfs_SpatialRequest_basepoint+"'></div>";
+ if(i>0){
+// str_mPoints += "<div style='font-family:"+mod_wfs_SpatialRequest_font+";font-size:"+mod_wfs_SpatialRequest_fontsize+";color:"+mod_wfs_SpatialRequest_color1+";";
+// if(mod_wfs_SpatialRequest_bg != ""){
+// str_mPoints += "background-color:"+mod_wfs_SpatialRequest_bg+";";
+// }
+// str_mPoints += "position:absolute;top:"+(pos[1] + 3)+"px;left:"+(pos[0]+3)+"px;z-index:20'>"+mod_wfs_SpatialRequest_TotalDist[i]+"</div>";
+// str_mPoints += "<div style='font-family:"+mod_wfs_SpatialRequest_font+";font-size:"+mod_wfs_SpatialRequest_fontsize+";color:"+mod_wfs_SpatialRequest_color2+";position:absolute;top:"+(pos[1] + 4)+"px;left:"+(pos[0]+4)+"px;z-index:21'>"+mod_wfs_SpatialRequest_TotalDist[i]+"</div>";
+ }
+ }
+ if(mod_wfs_SpatialRequest_RX.length>1){
+ for(var k=1; k<mod_wfs_SpatialRequest_RX.length; k++){
+ var pos0 = makeRealWorld2mapPos(mod_wfs_SpatialRequest_target,mod_wfs_SpatialRequest_RX[k], mod_wfs_SpatialRequest_RY[k]);
+ var pos1 = makeRealWorld2mapPos(mod_wfs_SpatialRequest_target,mod_wfs_SpatialRequest_RX[k-1], mod_wfs_SpatialRequest_RY[k-1]);
+ str_mPoints += evaluateDashesExt(pos1[0],pos1[1],pos0[0],pos0[1],k);
+ }
+ }
+ writeTag(mod_wfs_SpatialRequest_target,"measuring",str_mPoints);
+}
+function evaluateDashesExt(x1,y1,x2,y2,count){
+ var str_dashedLine = "";
+ var s = 10;
+ var d = Math.sqrt(Math.pow((y1-y2),2) + Math.pow((x1-x2),2)) ;
+ var n = Math.round(d/s);
+ var s_x = (x2 - x1)/n;
+ var s_y = (y2 - y1)/n;
+ for(var i=1; i<n; i++){
+ var x = Math.round(x1 + i * s_x)-2;
+ var y = Math.round(y1 + i * s_y)-2;
+ if(x >= 0 && x <= mod_wfs_SpatialRequest_width && y >= 0 && y <= mod_wfs_SpatialRequest_height){
+ str_dashedLine += "<div style='font-size:1px;position:absolute;top:"+y+"px;left:"+x+"px;width:4px;height:4px;background-color:"+mod_wfs_SpatialRequest_linepoint+"'></div>";
+ }
+ }
+// str_dashedLine += "<div style='font-family:"+mod_wfs_SpatialRequest_font+";font-size:"+mod_wfs_SpatialRequest_fontsize+";color:"+mod_wfs_SpatialRequest_color1+";";
+// if(mod_wfs_SpatialRequest_bg != ""){
+// str_dashedLine += "background-color:"+mod_wfs_SpatialRequest_bg+";";
+// }
+// str_dashedLine += "position:absolute;top:"+(Math.round(y1 + (y2-y1)/2 +3))+"px;left:"+(Math.round(x1 + (x2-x1)/2 +3))+"px'>"+mod_wfs_SpatialRequest_Dist[count]+"</div>";
+// str_dashedLine += "<div style='font-family:"+mod_wfs_SpatialRequest_font+";font-size:"+mod_wfs_SpatialRequest_fontsize+";color:"+mod_wfs_SpatialRequest_color2+";position:absolute;top:"+(Math.round(y1 + (y2-y1)/2 + 4))+"px;left:"+(Math.round(x1 + (x2-x1)/2+4))+"px'>"+mod_wfs_SpatialRequest_Dist[count]+"</div>";
+ return str_dashedLine;
+}
+function mod_wfs_SpatialRequest_run(e){
+// mb_getMousePos(e,mod_wfs_SpatialRequest_target);
+// var pos = makeClickPos2RealWorldPos(mod_wfs_SpatialRequest_target,clickX,clickY);
+// var dist_x = Math.abs(mod_wfs_SpatialRequest_RX[mod_wfs_SpatialRequest_RX.length-1] - pos[0]);
+// var dist_y = Math.abs(mod_wfs_SpatialRequest_RY[mod_wfs_SpatialRequest_RY.length-1] - pos[1]);
+// if(isNaN(dist_x) == false && clickX > 0 && clickX < mod_wfs_SpatialRequest_width && clickY > 0 && clickY < mod_wfs_SpatialRequest_height){
+// var str_display = "<span style='font-family:"+mod_wfs_SpatialRequest_font+";font-size:"+mod_wfs_SpatialRequest_fontsize+";color:"+mod_wfs_SpatialRequest_color2+";'>"+(Math.round(Math.sqrt(Math.pow(dist_x,2) + Math.pow(dist_y,2))*100)/100)+" m</span>";
+// writeTag(mod_wfs_SpatialRequest_target,"measure_display",str_display);
+// mb_arrangeElement(mod_wfs_SpatialRequest_target,"measure_display",clickX +2, clickY - 10);
+// }
+// else{
+// writeTag(mod_wfs_SpatialRequest_target,"measure_display","");
+// }
+}
+function mod_wfs_SpatialRequest_close(){
+ if(mod_wfs_SpatialRequest_RX.length < 3 || (mod_wfs_SpatialRequest_RX[mod_wfs_SpatialRequest_RX.length-1] == mod_wfs_SpatialRequest_RX[0] && mod_wfs_SpatialRequest_RY[mod_wfs_SpatialRequest_RY.length-1] == mod_wfs_SpatialRequest_RY[0])){return;}
+ mod_wfs_SpatialRequest_RX[mod_wfs_SpatialRequest_RX.length] = mod_wfs_SpatialRequest_RX[0];
+ mod_wfs_SpatialRequest_RY[mod_wfs_SpatialRequest_RY.length] = mod_wfs_SpatialRequest_RY[0];
+ if(mod_wfs_SpatialRequest_RX.length > 1){
+ // circumference
+ var dist_x = Math.abs(mod_wfs_SpatialRequest_RX[mod_wfs_SpatialRequest_RX.length-2] - mod_wfs_SpatialRequest_RX[mod_wfs_SpatialRequest_RX.length-1]);
+ var dist_y = Math.abs(mod_wfs_SpatialRequest_RY[mod_wfs_SpatialRequest_RY.length-2] - mod_wfs_SpatialRequest_RY[mod_wfs_SpatialRequest_RY.length-1]);
+ var dist = Math.round(Math.sqrt(Math.pow(dist_x,2) + Math.pow(dist_y,2))*100)/100;
+ mod_wfs_SpatialRequest_Dist[mod_wfs_SpatialRequest_Dist.length] = dist;
+ var totalDist = mod_wfs_SpatialRequest_TotalDist[mod_wfs_SpatialRequest_TotalDist.length-1] + dist;
+ mod_wfs_SpatialRequest_TotalDist[mod_wfs_SpatialRequest_TotalDist.length] = Math.round(totalDist * 100)/100;
+ }
+ else{
+ mod_wfs_SpatialRequest_Dist[mod_wfs_SpatialRequest_Dist.length] = 0;
+ mod_wfs_SpatialRequest_TotalDist[mod_wfs_SpatialRequest_TotalDist.length] = 0;
+ }
+ drawDashedLineExt();
+ mod_getAreaExt_send();
+
+}
+function mod_wfs_SpatialRequest_delete(){
+ mod_wfs_SpatialRequest_RX = new Array();
+ mod_wfs_SpatialRequest_RY = new Array();
+ mod_wfs_SpatialRequest_Dist = new Array();
+ mod_wfs_SpatialRequest_TotalDist = new Array();
+ writeTag(mod_wfs_SpatialRequest_target,"measuring","");
+ writeTag(mod_wfs_SpatialRequest_target,"measure_display","");
+}
+/***************************************init Zoombox*********************************************/
+function mod_selAreaExt_click(){
+ var el = window.frames[mod_wfs_SpatialRequest_target].document;
+ el.onmouseover = mod_selAreaExt_init;
+ el.onmousedown = mod_box_start;
+ el.onmouseup = mod_selAreaExt_get;
+ el.onmousemove = mod_box_run;
+}
+function mod_selAreaExt_disable(){
+ var el = window.frames[mod_wfs_SpatialRequest_target].document;
+ el.onmousedown = null;
+ el.onmouseup = null;
+ el.onmousemove = null;
+}
+function mod_selAreaExt_init(e){
+ mb_isBF = mod_wfs_SpatialRequest_target;
+ mb_zF = mod_wfs_SpatialRequest_target;
+}
+function mod_selAreaExt_get(e){
+ mod_selAreaExt_setValidClipping(mod_box_stop(e));
+ mb_isBF = mod_wfs_SpatialRequest_target;
+ mb_zF = mod_wfs_SpatialRequest_target;
+}
+function mod_selAreaExt_setValidClipping(coords){
+ //alert(coords.join(","));
+ mod_wfs_SpatialRequest_RX[0] = coords[0];
+ mod_wfs_SpatialRequest_RY[0] = coords[1];
+ mod_wfs_SpatialRequest_RX[1] = coords[2];
+ mod_wfs_SpatialRequest_RY[1] = coords[3];
+
+ if(coords.length > 2){
+ mod_getAreaExt_send();
+ }
+ else{
+ alert("Ausschnitt ungültig!")
+ }
+}
+
+
+
+
+/*********************************************************************/
+mod_wfs_SpatialRequest_win = null;
+mod_wfs_SpatialRequest_thema = false;
+mod_wfs_SpatialRequest_geom = false;
+
+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('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('}');
+ mod_wfs_SpatialRequest_win.document.writeln('}');
+ mod_wfs_SpatialRequest_win.document.writeln('window.opener.mod_wfs_SpatialRequest_geom = obj.value;');
+ mod_wfs_SpatialRequest_win.document.writeln('window.opener.mod_wfs_SpatialRequest_decide();');
+ mod_wfs_SpatialRequest_win.document.writeln('window.close();');
+ 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='point' onclick='set(this)'> Punkt<br>");
+ mod_wfs_SpatialRequest_win.document.writeln("<input id='rectangle' name='geom' type='radio' value='rectangle' onclick='set(this)'> Rechteck<br>");
+ mod_wfs_SpatialRequest_win.document.writeln("<input id='polygon' name='geom' type='radio' value='polygon'onclick='set(this)'> Polygon<br>");
+ var checked = "";
+ if (mod_wfs_SpatialRequest_useExtent) {
+ checked = " checked";
+ }
+ //mod_wfs_SpatialRequest_win.document.writeln("<input id='extent' name='geom' type='radio' value='extent' onclick='set(this)' " + checked + "> Extent<br>");
+ mod_wfs_SpatialRequest_win.document.writeln("</form>");
+ mod_wfs_SpatialRequest_win.document.close();
+ }
+ else{
+ mod_wfs_SpatialRequest_win.focus();
+ }
+}
+function mod_getAreaExt_send(){
+ if(mod_wfs_SpatialRequest_geom == 'point'){
+ mb_setwfsrequest(mod_wfs_SpatialRequest_target,'point', mod_wfs_SpatialRequest_RX, mod_wfs_SpatialRequest_RY);
+ mod_wfs_SpatialRequest_delete();
+ mod_wfs_SpatialRequest_disable();
+ }
+ else if(mod_wfs_SpatialRequest_geom == 'polygon'){
+ mb_setwfsrequest(mod_wfs_SpatialRequest_target,'polygon', mod_wfs_SpatialRequest_RX, mod_wfs_SpatialRequest_RY);
+ mod_wfs_SpatialRequest_delete();
+ mod_wfs_SpatialRequest_disable();
+ }
+ else if(mod_wfs_SpatialRequest_geom == 'rectangle'){
+ mb_setwfsrequest(mod_wfs_SpatialRequest_target,'rectangle', mod_wfs_SpatialRequest_RX, mod_wfs_SpatialRequest_RY);
+ mod_wfs_SpatialRequest_delete();
+ mod_selAreaExt_disable();
+ }
+ else if(mod_wfs_SpatialRequest_geom == 'extent'){
+ mb_setwfsrequest(mod_wfs_SpatialRequest_target,'rectangle', mod_wfs_SpatialRequest_RX, mod_wfs_SpatialRequest_RY);
+ mod_wfs_SpatialRequest_delete();
+ mod_selAreaExt_disable();
+ }
+ mb_disableThisButton('setSpatialRequest');
+}
Added: trunk/mapbender/http/javascripts/mod_zoomCoords.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_zoomCoords.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_zoomCoords.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,149 @@
+<?php
+#$Id: mod_zoomCoords.php,v 1.10 2006/03/09 08:57:13 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_zoomCoords.php,v 1.10 2006/03/09 08:57:13 uli_rothstein Exp $
+require_once("../../conf/mapbender.conf");
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Zoom to Coordinate</title>
+<style type="text/css">
+ <!--
+
+ body{
+ font-family : Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ }
+ .labelx{
+ position: absolute;
+ left: 5px;
+ top:5px;
+ color: Gray;
+ }
+ .labely{
+ position: absolute;
+ left: 80px;
+ top:5px;
+ color: Gray;
+ }
+ .textx{
+ position: absolute;
+ left:5px;
+ top:20px;
+ color: Gray;
+ width:65px;
+ border: solid thin;
+ height:20px;
+ }
+ .texty{
+ position: absolute;
+ left:80px;
+ top:20px;
+ color: Gray;
+ width:65px;
+ border: solid thin;
+ height:20px;
+ }
+ .send{
+ position: absolute;
+ left:150px;
+ top:20px;
+ color: Gray;
+ border: solid thin;
+ height:20px;
+ }
+ -->
+</style>
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'zoomCoords' AND fkey_gui_id = '".$_SESSION["mb_user_gui"]."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+
+echo '<script type="text/javascript">';
+if($cnt > 1){ echo "alert('zoomCoords: ID not unique!');";}
+
+echo "var mod_zoomCoords_target = '".$e_target."';";
+echo "var target = mod_zoomCoords_target.split(',')";
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+function zoomCoordinate(x,y){
+ x=x.replace(",",".");
+ y=y.replace(",",".");
+
+ document.form1.X.value=x;
+ document.form1.Y.value=y;
+
+ if (isNaN(x)==true || isNaN(y)==true){
+ alert ("Bitte geben Sie eine Zahl ein.");
+ }else{
+ parent.zoom(target[0],true, 1.0,x,y);
+ }
+}
+
+function highlight(x, y){
+
+ x=x.replace(",",".");
+ y=y.replace(",",".");
+
+ document.form1.X.value=x;
+ document.form1.Y.value=y;
+
+
+ if (isNaN(x)==true || isNaN(y)==true){
+
+ }
+ else{
+ parent.mb_showHighlight(target[0],x,y);
+ parent.mb_showHighlight(target[1],x,y);
+ }
+}
+
+
+function hideHighlight(){
+ parent.mb_hideHighlight(target[0]);
+ parent.mb_hideHighlight(target[1]);
+}
+
+// -->
+</script>
+</head>
+<body bgcolor='#ffffff' onload=''>
+
+<?php
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+#coordinates
+
+ # Deutsche Version
+
+ # English Version
+ echo "<span class='labelx'>Longitude:</span>";
+ echo "<span class='labely'>Latitude:</span>";
+ echo "<input class='textx' type='text' name='X'>";
+ echo "<input class='texty' type='text' name='Y'>";
+ echo "<input class='send' type='button' value='ok' onclick='zoomCoordinate(document.form1.X.value, document.form1.Y.value); highlight(document.form1.X.value, document.form1.Y.value)' onmouseover='highlight(document.form1.X.value, document.form1.Y.value)' onmouseout='hideHighlight(document.form1.X.value, document.form1.Y.value)' >";
+
+?>
+</form>
+</body>
+</html>
Added: trunk/mapbender/http/javascripts/mod_zoomFull.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_zoomFull.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_zoomFull.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,53 @@
+<?php
+#$Id: mod_zoomFull.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_zoomFull.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'zoomFull' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('zoomFull: ID not unique!');";}
+?>
+ var mod_zoomFull_img = new Image(); mod_zoomFull_img.src = "<?php echo $e_src; ?>";
+ var mod_zoomFull_img_over = new Image(); mod_zoomFull_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+function mod_zoomFull(){
+ var ind = this.getMapObjIndexByName("<?php echo $e_target; ?>");
+ var arrayThemen = new Array();
+ var arrayThemen = mb_mapObj[ind].wms[0].objLayer[0].layer_name;
+ this.Layer0 = arrayThemen;
+ //alert(mb_mapObj[ind].width + " - " + mb_mapObj[ind].height);
+ this.width = mb_mapObj[ind].width;
+ this.height = mb_mapObj[ind].height;
+ this.epsg = wms[0].gui_wms_epsg;
+ //mb_mapObj[ind].epsg = "EPSG:31493";
+ //alert(Layer0);
+ var arrayExt = new Array();
+ var frameName = "<?php echo $e_target; ?>"
+ var exts = setExtent(width,height,epsg);
+ arrayExt = exts.split(",");
+
+ mb_repaint(frameName,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
+}
+
+function mod_zoomFull_init(obj){
+ document.getElementById("zoomFull").src = mod_zoomFull_img_over.src;
+ obj.onmouseover = new Function("mod_zoomFull_over()");
+ obj.onmouseout = new Function("mod_zoomFull_out()");
+}
+function mod_zoomFull_over(){
+ document.getElementById("zoomFull").src = mod_zoomFull_img_over.src;
+}
+function mod_zoomFull_out(){
+ document.getElementById("zoomFull").src = mod_zoomFull_img.src;
+}
+
+
+
Added: trunk/mapbender/http/javascripts/mod_zoomIn1.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_zoomIn1.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_zoomIn1.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,36 @@
+<?php
+#$Id: mod_zoomIn1.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_zoomIn1.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'zoomIn1' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('zoomIn1: ID not unique!');";}
+?>
+var mod_zoom1_img = new Image(); mod_zoom1_img.src = "<?php echo $e_src; ?>";
+var mod_zoom1_img_over = new Image(); mod_zoom1_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+
+function mod_zoomIn1(){
+ zoom("<?php echo $e_target; ?>", true,2.0);
+}
+function mod_zoomIn1_init(obj){
+ document.getElementById("zoomIn1").src = mod_zoom1_img_over.src;
+ obj.onmouseover = new Function("mod_zoomIn1_over()");
+ obj.onmouseout = new Function("mod_zoomIn1_out()");
+}
+function mod_zoomIn1_over(){
+ document.getElementById("zoomIn1").src = mod_zoom1_img_over.src;
+}
+function mod_zoomIn1_out(){
+ document.getElementById("zoomIn1").src = mod_zoom1_img.src;
+}
Added: trunk/mapbender/http/javascripts/mod_zoomOut1.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_zoomOut1.php?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_zoomOut1.php 2006-04-13 20:20:00+0000
@@ -0,0 +1,37 @@
+<?php
+#$Id: mod_zoomOut1.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_zoomOut1.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
+
+$gui_id = $_REQUEST["gui_id"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'zoomOut1' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+ $e_src = $row["e_src"];
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){ echo "alert('zoomOut1: ID not unique!');";}
+?>
+var mod_zoomOut_img = new Image(); mod_zoomOut_img.src = "<?php echo $e_src; ?>";
+var mod_zoomOut_img_over = new Image(); mod_zoomOut_img_over.src = "<?php echo preg_replace("/_off/","_over",$e_src); ?>";
+
+
+function mod_zoomOut1(){
+ zoom("<?php echo $e_target; ?>", false,2.0);
+}
+function mod_zoomOut1_init(obj){
+ document.getElementById("zoomOut1").src = mod_zoomOut_img_over.src;
+ obj.onmouseover = new Function("mod_zoomOut1_over()");
+ obj.onmouseout = new Function("mod_zoomOut1_out()");
+}
+function mod_zoomOut1_over(){
+ document.getElementById("zoomOut1").src = mod_zoomOut_img_over.src;
+}
+function mod_zoomOut1_out(){
+ document.getElementById("zoomOut1").src = mod_zoomOut_img.src;
+}
+
Added: trunk/mapbender/http/javascripts/wfs.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/wfs.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/wfs.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,866 @@
+var digiFrame = "digitize";
+var mb_wfs_fetched = new Array();
+var mb_wfs_fetch = new Array();
+var mb_wfsreq = 0;
+var mb_wfs_tolerance = 8;
+var mb_wfs_target = "mapframe1";
+var mb_wfs_objwin = null;
+var mb_wfs_objwin_left = 800;
+var mb_wfs_objwin_top = 200;
+var mb_wfs_objwin_width = 200;
+var mb_wfs_objwin_height = 200;
+var mb_wfs_targets = new Array("mapframe1","overview");
+var mb_wfs_minPix = 8;
+var mb_wfs_maxBasePoints = 100;
+var mb_wfs_lineColor = "#ff0000";
+var mb_wfs_fillColor = "#ff0000";
+var mb_wfs_diameter = 8;
+var usemap = "";
+var mod_usemap_radius = 10;
+var mod_usemap_line_tolerance = 5;
+var canvas = new Array();
+var canvasHasDrawing = new Array();
+var useCheckboxForHighlighting = true;
+var useUsemap = false;
+
+if (useCheckboxForHighlighting) {
+ mb_registerSubFunctions('highlightGeometry()');
+}
+
+if (useUsemap) {
+ mb_registerSubFunctions('mod_usemap("")');
+}
+
+if (useExtentIsSet()) {
+ mb_registerSubFunctions("mb_setwfsrequest_extent()");
+}
+
+function mb_setwfsrequest_extent() {
+
+ if (useExtentIsSet()) {
+ var ind = getMapObjIndexByName(mb_wfs_targets[0]);
+ var pos_a = makeClickPos2RealWorldPos(mb_wfs_targets[0],0,0);
+ var pos_b = makeClickPos2RealWorldPos(mb_wfs_targets[0],mb_mapObj[ind].width,mb_mapObj[ind].height);
+
+ var x = new Array();
+ var y = new Array();
+ x[0] = pos_a[0];
+ x[1] = pos_b[0];
+ y[0] = pos_a[1];
+ y[1] = pos_b[1];
+
+ mb_setwfsrequest(mb_wfs_targets[0],'rectangle',x,y);
+ }
+}
+
+function mb_setwfsrequest(target,type,x,y){
+ mb_wfs_reset();
+ var ind = getMapObjIndexByName(target);
+ var w = new Array();
+ var w_ = new Array();
+ var wfs_conf = 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'){
+ w[w.length] = o.gui_layer_wfs_featuretype;
+ }
+ }
+ }
+ for(var i=0; i<w.length; i++){
+ for(var ii=0; ii<wfs_conf.length; ii++){
+ if(wfs_conf[ii]['wfs_conf_id'] == w[i]){
+ w_[w_.length] = ii;
+ }
+ }
+ }
+ if(type=='point'){
+ type = 'rectangle';
+ var tmp = makeRealWorld2mapPos(mb_wfs_target,x[0], y[0]);
+ var n1 = makeClickPos2RealWorldPos(mb_wfs_target, (tmp[0] + mb_wfs_tolerance/2), (tmp[1] + mb_wfs_tolerance/2));
+ x[0] = n1[0];
+ y[0] = n1[1];
+ var n2 = makeClickPos2RealWorldPos(mb_wfs_target, (tmp[0] - mb_wfs_tolerance/2), (tmp[1] - mb_wfs_tolerance/2));
+ x[1] = n2[0];
+ y[1] = n2[1];
+ }
+ if(type=='polygon'){
+ for(var i=0; i<w_.length; i++){
+ var path = "../php/mod_wfs_result.php?url=";
+ var url = wfs_conf[w_[i]]['wfs_getfeature'];
+ url += "service=wfs&request=getFeature&version=1.0.0";
+ url += "&typename="+ wfs_conf[w_[i]]['featuretype_name'];
+ url += "&filter=";
+ path += escape(url);
+ path += "&filter=";
+ var filter = '<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="http://www.opengis.net/gml">';
+ filter += "<Within>";
+ filter += '<ogc:PropertyName>';
+ for(var j=0; j<wfs_conf[w_[i]]['element'].length; j++){
+ if(wfs_conf[w_[i]]['element'][j]['f_geom'] == 1){
+ filter += wfs_conf[w_[i]]['element'][j]['element_name'];
+ }
+ }
+ filter += "</ogc:PropertyName>";
+ filter += '<gml:Polygon srsName="EPSG:4326">';
+ filter += '<gml:outerBoundaryIs>';
+ filter += '<gml:LinearRing>';
+ filter += '<gml:coordinates>';
+ for(var k=0; k<x.length; k++){
+ if(k>0){
+ filter += " ";
+ }
+ filter += x[k]+","+y[k];
+ }
+ filter += '</gml:coordinates>';
+ filter += '</gml:LinearRing>';
+ filter += '</gml:outerBoundaryIs>';
+ filter += '</gml:Polygon>';
+ filter += '</Within>';
+ filter += '</ogc:Filter>';
+ path += filter;
+ mb_wfs_createwin(mb_wfsreq,path);
+ mb_wfsreq++;
+ }
+ }
+ if(type=='rectangle'){
+ for(var i=0; i<w_.length; i++){
+ var path = "../php/mod_wfs_result.php?url=";
+ var url = wfs_conf[w_[i]]['wfs_getfeature'];
+ url += "service=wfs&request=getFeature&version=1.0.0";
+ url += "&typename="+ wfs_conf[w_[i]]['featuretype_name'];
+ url += "&filter=";
+ path += escape(url);
+ path += "&filter=";
+ var filter = '<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="http://www.opengis.net/gml">';
+ filter += "<ogc:BBOX>";
+ filter += '<ogc:PropertyName>';
+ for(var j=0; j<wfs_conf[w_[i]]['element'].length; j++){
+ if(wfs_conf[w_[i]]['element'][j]['f_geom'] == 1){
+ filter += wfs_conf[w_[i]]['element'][j]['element_name'];
+ }
+ }
+ filter += "</ogc:PropertyName>";
+ filter += '<gml:Box srsName="4326"><gml:coordinates>';
+ filter += x[0]+","+y[0];
+ filter += " ";
+ filter += x[1]+","+y[1];
+ filter += '</gml:coordinates></gml:Box></ogc:BBOX>';
+ filter += '</ogc:Filter>';
+ path += filter;
+ mb_wfs_createwin(mb_wfsreq,path);
+ mb_wfsreq++;
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------------------------------------------
+// --- usemap (begin) --------------------------------------------------------------------------------------------
+
+function mod_usemap (wfs_name) {
+ if (wfs_name == "") {
+ usemap = "";
+ }
+ var ind = getMapObjIndexByName(mb_wfs_targets[0]);
+ var myImg = window.frames[mb_wfs_targets[0]].document.getElementById("um_img").style;
+ myImg.width = mb_mapObj[ind].width;
+ myImg.height = mb_mapObj[ind].height;
+
+ for (var i = 0 ; i < mb_wfs_fetch.length ; i ++) {
+
+ if (mb_wfs_fetch[i]['wfs_conf'] == wfs_name || wfs_name == "") {
+
+ if (mb_wfs_fetch[i]['geomtype'] == "Polygon") {
+ usemap += mod_usemap_polygon(i);
+ }
+ else if (mb_wfs_fetch[i]['geomtype'] == "Point") {
+ usemap += mod_usemap_circle(i);
+ }
+ else if (mb_wfs_fetch[i]['geomtype'] == "Line") {
+ usemap += mod_usemap_line(i);
+ }
+ }
+ }
+ writeUsemap(usemap);
+}
+
+function mod_usemap_circle(ind){
+ var str = "";
+ var coord = "";
+
+ for (var i = 0 ; i < mb_wfs_fetch[ind]['geometry'].length ; i ++) {
+ var xArray = mb_wfs_fetch[ind]['geometry'][i]['x'];
+ var yArray = mb_wfs_fetch[ind]['geometry'][i]['y'];
+ var title = getElementValueByName(mb_wfs_fetch, ind, "name") + " (Pt)";
+ var pos = makeRealWorld2mapPos(mb_wfs_targets[0],xArray[0],yArray[0]);
+ coord += pos[0] + ", " + pos[1];
+
+ str += "<AREA onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
+ str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch["+ind+"])' shape='circle' coords='";
+ str += coord + ", " + mod_usemap_radius + "' href='#'>";
+ }
+
+ return str;
+}
+
+function mod_usemap_line_calculate (xArray, yArray, j, orientation, cnt) {
+ var coord = "";
+
+ var p1 = makeRealWorld2mapPos(mb_wfs_targets[0],xArray[j],yArray[j]);
+ var p2 = makeRealWorld2mapPos(mb_wfs_targets[0],xArray[j+orientation],yArray[j+orientation]);
+
+ var vec = new Array();
+ vec[0] = p2[0] - p1[0];
+ vec[1] = p2[1] - p1[1];
+
+ if (vec[0] != 0 || vec[1] != 0) {
+ n_vec = new Array();
+ if (vec[0] != 0) {
+ if (vec[0] > 0) {
+ n_vec[0] = (-vec[1])/vec[0];
+ n_vec[1] = -1;
+ }
+ else {
+ n_vec[0] = (vec[1])/vec[0];
+ n_vec[1] = 1;
+ }
+ }
+ else {
+ if (vec[1] > 0) {
+ n_vec[0] = 1;
+ n_vec[1] = 0;
+ }
+ else {
+ n_vec[0] = -1;
+ n_vec[1] = 0;
+ }
+ }
+
+ n_vec_length = Math.sqrt(Math.pow(n_vec[0], 2) + Math.pow(n_vec[1], 2));
+ n_vec[0] = (n_vec[0]*mod_usemap_line_tolerance)/n_vec_length;
+ n_vec[1] = (n_vec[1]*mod_usemap_line_tolerance)/n_vec_length;
+
+ lp = new Array();
+ lp[0] = p1[0] + n_vec[0];
+ lp[1] = p1[1] - n_vec[1];
+
+ if (cnt > 0) {
+ coord += ", ";
+ }
+ coord += parseInt(lp[0]) + ", " + parseInt(lp[1]);
+ coord += ", " + parseInt(lp[0]+vec[0]) + ", " + parseInt(lp[1]+vec[1]);
+
+ }
+ return coord;
+}
+
+function mod_usemap_line(ind){
+ var str = "";
+ for (var i = 0 ; i < mb_wfs_fetch[ind]['geometry'].length ; i ++) {
+ var coord = "";
+ var cnt = 0;
+
+ xArray = new Array();
+ xArray = mb_wfs_fetch[ind]['geometry'][i]['x'];
+ yArray = new Array();
+ yArray = mb_wfs_fetch[ind]['geometry'][i]['y'];
+
+
+ for (var j = 0 ; j < xArray.length - 1 ; j ++) {
+ var result = mod_usemap_line_calculate(xArray, yArray, j, 1, cnt);
+ if (result != "") {
+ coord += result;
+ cnt++;
+ }
+ }
+
+ for (var j = (xArray.length - 1) ; j > 0 ; j--) {
+ var result = mod_usemap_line_calculate(xArray, yArray, j, -1, cnt);
+ if (result != "") {
+ coord += result;
+ cnt++;
+ }
+ }
+
+ if (coord != "") {
+ str += "<AREA ";
+ str += "onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
+ str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch["+ind+"])' ";
+ str += "shape='poly' coords='";
+ str += coord + "' href='#'>";
+ }
+ else {
+ //display circle
+ var pos = makeRealWorld2mapPos(mb_wfs_targets[0],xArray[0],yArray[0]);
+ coord += pos[0] + ", " + pos[1];
+
+ str += "<AREA onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
+ str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch["+ind+"])' shape='circle' coords='";
+ str += coord + ", " + mod_usemap_radius + "' href='#'>";
+ }
+ }
+
+ return str;
+}
+
+function mod_usemap_polygon(ind){
+ var str = "";
+ var coord = "";
+
+ for (var i = 0 ; i < mb_wfs_fetch[ind]['geometry'].length ; i ++) {
+ var xArray = mb_wfs_fetch[ind]['geometry'][i]['x'];
+ var yArray = mb_wfs_fetch[ind]['geometry'][i]['y'];
+ var title = getElementValueByName(mb_wfs_fetch, ind, "name") + " (Py)";
+ var pos = makeRealWorld2mapPos(mb_wfs_targets[0],xArray[0],yArray[0]);
+ coord += pos[0] + ", " + pos[1];
+
+ for (var j = 1 ; j < xArray.length ; j ++) {
+ pos = makeRealWorld2mapPos(mb_wfs_targets[0],xArray[j],yArray[j]);
+ coord += ", " + pos[0] + ", " + pos[1];
+ }
+
+ str += "<AREA onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
+ str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch["+ind+"])' shape='poly' coords='";
+ str += coord + "' href='#'>";
+ }
+
+ return str;
+}
+
+function writeUsemap(str) {
+ writeTag(mb_wfs_targets[0], 'um', str);
+}
+// --- usemap (end) ----------------------------------------------------------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------
+
+
+function mb_repaint() {
+ for (var i = 0 ; i < mb_wfs_targets.length ; i ++) {
+ mf = mb_wfs_targets[i];
+ if (canvas[mf]) {
+ canvas[mf].paint();
+ }
+ }
+}
+
+function mb_wfs_createwin(ind,url){
+ var nid = "mb_wfs_win_"+ind;
+ var iframe=document.createElement('iframe');
+ iframe.setAttribute("src",url + "&id=" + nid);
+ var tmp = document.body.appendChild(iframe);
+ tmp.style.width = '0px';
+ tmp.style.height='0px';
+ tmp.style.visibility = 'hidden';
+}
+
+//
+// x- and y- coordinates are put in different arrays, the old arrays are being deleted
+//
+function rearrangeXY (cnt) {
+ for(var j=0; j<mb_wfs_fetch[cnt]['geometry'].length; j++){
+ var g = mb_wfs_sortXY(mb_wfs_fetch[cnt]['geometry'][j]);
+ mb_wfs_fetch[cnt]['geometry'][j] = new Array();
+ mb_wfs_fetch[cnt]['geometry'][j]['x'] = g[0];
+ mb_wfs_fetch[cnt]['geometry'][j]['y'] = g[1];
+ }
+}
+
+function mb_wfs_register(n,a){
+ var tmp = n.split("_");
+ var current_wfs_name = tmp[3];
+ var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
+// alert("response from " + wfs_conf[tmp[3]]['wfs_conf_abstract']);
+ if(a && a.length){
+ var str = n + ": \n";
+ for(var i=0; i<a.length; i++){
+ var cnt = mb_wfs_fetch.length;
+
+ var ind = getMapObjIndexByName(mb_wfs_targets[0]);
+ var wfs_tmp = wfs_conf[current_wfs_name]['featuretype_srs'] + " - " + mb_mapObj[ind].epsg;
+
+ if (wfs_conf[current_wfs_name]['featuretype_srs'] == mb_mapObj[ind].epsg) {
+ mb_wfs_fetch[cnt] = a[i];
+ mb_wfs_fetch[cnt]['wfs_conf'] = current_wfs_name;
+ rearrangeXY(cnt);
+
+ var check = mb_wfs_cntBasePoint(mb_wfs_fetch[cnt]['geometry']);
+ if(check == false){
+
+ var newGeom = mb_wfs_getBBOX(mb_wfs_fetch[cnt]['geometry']);
+
+ mb_wfs_fetch[cnt]['geometry'] = new Array();
+ mb_wfs_fetch[cnt]['geometry'][0] = new Array();
+ mb_wfs_fetch[cnt]['geometry'][0]['x'] = new Array();
+ mb_wfs_fetch[cnt]['geometry'][0]['y'] = new Array();
+ mb_wfs_fetch[cnt]['geometry'][0]['x'][0] = parseFloat(newGeom[0]);
+ mb_wfs_fetch[cnt]['geometry'][0]['y'][0] = parseFloat(newGeom[1]);
+ mb_wfs_fetch[cnt]['geometry'][0]['x'][1] = parseFloat(newGeom[0]);
+ mb_wfs_fetch[cnt]['geometry'][0]['y'][1] = parseFloat(newGeom[3]);
+ mb_wfs_fetch[cnt]['geometry'][0]['x'][2] = parseFloat(newGeom[2]);
+ mb_wfs_fetch[cnt]['geometry'][0]['y'][2] = parseFloat(newGeom[3]);
+ mb_wfs_fetch[cnt]['geometry'][0]['x'][3] = parseFloat(newGeom[2]);
+ mb_wfs_fetch[cnt]['geometry'][0]['y'][3] = parseFloat(newGeom[1]);
+ mb_wfs_fetch[cnt]['geometry'][0]['x'][4] = parseFloat(newGeom[0]);
+ mb_wfs_fetch[cnt]['geometry'][0]['y'][4] = parseFloat(newGeom[1]);
+ }
+ }
+ else {
+ alert("EPSG mismatch. Invalid WFS result. Press OK to continue.");
+ }
+ }
+ checkMbWfsFetch();
+ }
+ mb_wfs_listMember(current_wfs_name);
+}
+
+//
+// checks if the mb_wfs_fetch array is valid. If not, a pop up window will display the error(s).
+//
+function checkMbWfsFetch() {
+ var error = "";
+ for (var i = 0 ; i < mb_wfs_fetch.length ; i++) {
+ error += checkWfsObj(i);
+ }
+ if (error) {
+ var wfsWindow = open("about:blank", "wfsattributes", "width=300, height=300, resizable, dependent=yes, scrollbars=yes");
+ wfsWindow.document.open("text/html");
+ wfsWindow.document.write("An error occured:<br><hr>" + error);
+ wfsWindow.document.close();
+ }
+}
+//
+// checks if a wfs object at index index is valid. if not, alerts will be displayed
+//
+function checkWfsObj (index) {
+ var obj = mb_wfs_fetch[index];
+ var geometry = false;
+ var element = false;
+ var geomtype = false;
+ var wfs_conf = false;
+ var error = "";
+
+ for (attr in obj) {
+ if (attr == "geometry") {
+ geometry = true;
+ var objGeom = obj['geometry'];
+ var objGeomLength = objGeom.length;
+ if (objGeomLength == 0) {
+ error += "object " + index + " doesn't contain any geometries.<br>";
+ }
+ else {
+ for (var i = 0 ; i < objGeomLength ; i ++) {
+ var objGeomAtIndex = objGeom[i];
+ var x = false;
+ var y = false;
+ for (attrib in objGeomAtIndex) {
+ if (attrib == "x") {
+ x = true;
+ }
+ else if (attrib == "y") {
+ y = true;
+ }
+ else {
+ error += "object " + index + ": unknown geometry attribute: " + attrib + ".<br>";
+ }
+ }
+ if (x == true && y == true) {
+ if (objGeomAtIndex['x'].length != objGeomAtIndex['y'].length || objGeomAtIndex['x'].length == 0) {
+ error += "object " + index + " has an invalid geometry.<br>";
+ }
+ }
+ else {
+ error += "object " + index + " doesn't contain x- or y-values.<br>";
+ }
+ }
+ }
+ }
+ else if (attr == "element") {
+ elements = true;
+
+ var objElem = obj['element'];
+ var objElemLength = objElem.length;
+ for (var i = 0 ; i < objElemLength ; i ++) {
+ var objElemAtIndex = objElem[i];
+ var elemName = false;
+ var elemVal = false;
+ for (attrib in objElemAtIndex) {
+ if (attrib == "name") {
+ elemName = true;
+ }
+ else if (attrib == "val") {
+ elemVal = true;
+ }
+ else {
+ error += "object " + index + ": unknown element attributes: " + attrib + ".<br>";
+ }
+ }
+ if (elemName != true || elemVal != true) {
+ error += "object " + index + ": missing object attributes.<br>";
+ }
+ else {
+ if (objElemAtIndex['name'] == "name") {
+ if (!objElemAtIndex['val']) {
+ error += "object " + index + " doesn't have a name.<br>";
+ }
+ }
+ }
+ }
+ }
+ else if (attr == "geomtype") {
+ geomtype = true;
+ if (obj['geomtype'] != "Point" && obj['geomtype'] != "Line" && obj['geomtype'] != "Polygon") {
+ error += "object " + index + ": wrong geometry type.<br>";
+ }
+ }
+ else if (attr == "wfs_conf") {
+ wfs_conf = true;
+ if (!obj['wfs_conf']) {
+ error += "object " + index + ": no wfs conf.<br>";
+ }
+ }
+ else {
+ error += "object " + index + ": unknown attribute: " + attr + ".<br>";
+ }
+
+ }
+ if (geometry == false || geomtype == false || elements == false) {
+ error += "object " + index + " is corrupted.<br>";
+ }
+
+ if (error) {
+ error += displayObject(mb_wfs_fetch[index]);
+ error += "<hr>";
+ }
+ return error;
+}
+
+function mb_wfs_reset(){
+ mb_wfs_fetch = new Array();
+ usemap = "";
+
+ if(mb_wfs_objwin == null){
+ var iframe=document.createElement('div');
+ iframe.setAttribute("style","position:absolute;left:"+mb_wfs_objwin_left+"px;top:"+mb_wfs_objwin_top+"px;width:"+mb_wfs_objwin_width+"px;height:"+mb_wfs_objwin_height+"px");
+ mb_wfs_objwin = document.body.appendChild(iframe);
+ mb_wfs_objwin.id = "mb_wfs_objwin";
+ mb_wfs_objwin.name = "mb_wfs_objwin";
+ mb_wfs_objwin.style.position = 'absolute';
+ mb_wfs_objwin.style.left = mb_wfs_objwin_left+"px";
+ mb_wfs_objwin.style.top = mb_wfs_objwin_top+"px";
+ mb_wfs_objwin.style.width = mb_wfs_objwin_width+"px";
+ mb_wfs_objwin.style.height = mb_wfs_objwin_height+"px";
+ }
+ for(var i=0; i<mb_wfsreq; i++){
+ if(document.getElementById("mb_wfs_win_"+mb_wfsreq)){
+ document.removeChild("mb_wfs_win_"+mb_wfsreq);
+ }
+ }
+ mb_wfsreq = 0;
+ return true;
+}
+
+//
+// displays an object
+//
+
+function displayObject (someArray) {
+ var a = someArray;
+ var str = "";
+
+ for (attr in a) {
+ b = a[attr];
+
+ if (typeof(b) == "object") {
+ str += "<br>[" + attr + "]<br>";
+ str += displayObject(b);
+ }
+ else {
+ str += "<br>[" + attr + "]: " + b + "<br>";
+ }
+ }
+ return str;
+}
+
+//
+// returns an element value by name
+//
+function getElementValueByName(member, memberIndex, elementName) {
+ var arrayLength = member[memberIndex]['element'].length;
+ for (var j = 0 ; j < arrayLength ; j++) {
+ if (member[memberIndex]['element'][j]['name'] == elementName) {
+ return member[memberIndex]['element'][j]['val'];
+ }
+ }
+ return false;
+}
+
+function mb_wfs_listMember(wfs_name){
+ var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
+ var usemap = "";
+ var str = "<table>";
+ for(var i=0; i<mb_wfs_fetch.length; i++){
+ var t = wfs_conf[mb_wfs_fetch[i]['wfs_conf']];
+// str += t['g_label']+ ": <br>";
+ for(var j=0; j<t['element'].length; j++){
+ if(t['element'][j]['f_show'] > 0){
+
+ for(var k=0; k<mb_wfs_fetch[i]['element'].length; k++){
+ if(t['element'][j]['element_name'] == mb_wfs_fetch[i]['element'][k]['name']){
+ //str += mb_wfs_fetch[i]['element'][k]['name'] + ": ";
+ str += "<tr><td><img src = '../img/wfs_digitize.png' onClick = 'tab_open(digiFrame);parent.window.frames[digiFrame].addMember(mb_wfs_fetch["+i+"])'></td>";
+
+ str += "<td>";
+ if (useCheckboxForHighlighting) {
+ str += "<input type=checkbox id=highlightCheckbox" + i + " onClick='highlightGeometry()'></td><td>";
+ }
+
+ str += "<div";
+ if (!useCheckboxForHighlighting) {
+ str += " onmouseover='mb_wfs_perform(\"over\",mb_wfs_fetch["+i+"])' ";
+ str += " onmouseout='mb_wfs_perform(\"out\",mb_wfs_fetch["+i+"])' ";
+ }
+ str += " onclick='mb_wfs_perform(\"click\",mb_wfs_fetch["+i+"])' ";
+ str += ">" + mb_wfs_fetch[i]['element'][k]['val']+"</div></td></tr>";
+ }
+ }
+ }
+ }
+ }
+ str += "</table>";
+ mb_wfs_objwin.innerHTML = str;
+ if (useUsemap) {
+ mod_usemap(wfs_name);
+ }
+}
+
+
+function highlightGeometry() {
+ var l = mb_wfs_fetch.length;
+// if (l > 0) {
+ mb_wfs_wzClean();
+ mb_wfs_checkTag();
+// }
+ for (var i = 0; i < l ; i++) {
+ var id = "highlightCheckbox"+i;
+ var cb = document.getElementById(id);
+ if (cb) {
+ if (cb.checked) {
+ mb_wfs_draw(mb_wfs_fetch[i]);
+ }
+ }
+ }
+ mb_repaint();
+}
+
+function get_wfs_conf(index) {
+ var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
+ return wfs_conf[index];
+}
+
+function get_complete_wfs_conf() {
+ var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
+ return wfs_conf;
+}
+
+function mb_wfs_perform(type,m){
+ var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
+ if(type=='over'){
+ mb_wfs_checkTag();
+ mb_wfs_draw(m);
+ mb_repaint();
+ }
+ if(type=='out'){
+ if (useCheckboxForHighlighting) {
+ highlightGeometry();
+ }
+ else {
+ mb_wfs_wzClean();
+ }
+ }
+ if(type=='click'){
+ mb_wfs_checkTag();
+ var tmp = mb_wfs_getBBOX(m['geometry']);
+ var b = parseFloat(wfs_conf[m['wfs_conf']]['g_buffer']);
+ mb_calculateExtent(mb_wfs_targets[0],parseFloat(tmp[0])-b,parseFloat(tmp[1])-b,parseFloat(tmp[2])+b,parseFloat(tmp[3])+b);
+ zoom(mb_wfs_targets[0], 'true', 1.0);
+ if (!useCheckboxForHighlighting) {
+ mb_wfs_draw(m);
+ }
+ }
+}
+function mb_wfs_cntBasePoint(g){
+ var c = 0;
+ for(var i=0; i<g.length;i++){
+ c += (Math.round(g[i]['x'].length)/2);
+ }
+ if(c <= mb_wfs_maxBasePoints){
+ return true;
+ }
+ else{
+ return false;
+ }
+}
+function mb_wfs_getBBOX(g){
+ var tmp_x = new Array();
+ var tmp_y = new Array();
+
+ for(var i=0; i<g.length;i++){
+ tmp_x = tmp_x.concat(g[i]['x']);
+ tmp_y = tmp_y.concat(g[i]['y']);
+ }
+
+ var min_x = parseFloat(tmp_x[0]);
+ var min_y = parseFloat(tmp_y[0]);
+ var max_x = parseFloat(tmp_x[0]);
+ var max_y = parseFloat(tmp_y[0]);
+
+ var x,y;
+
+ for(var i=1; i<tmp_x.length; i++){
+ x = parseFloat(tmp_x[i]);
+ y = parseFloat(tmp_y[i]);
+ if (x < min_x) {
+ min_x = x;
+ }
+ else if (x > max_x) {
+ max_x = x;
+ }
+ if (y < min_y) {
+ min_y = y;
+ }
+ else if (y > max_y) {
+ max_y = y;
+ }
+ }
+ var r = new Array(min_x, min_y, max_x, max_y);
+ return r;
+}
+
+function mb_wfs_checkPix(frame,g){
+ var tmp = mb_wfs_getBBOX(g);
+ var minpix = makeRealWorld2mapPos(frame,tmp[0],tmp[3]);
+ var maxpix = makeRealWorld2mapPos(frame,tmp[2],tmp[1]);
+ if((maxpix[0] - minpix[0] < mb_wfs_minPix) && (maxpix[1] - minpix[1] < mb_wfs_minPix)){
+ return false;
+ }
+ else{
+ return true;
+ }
+}
+function mb_wfs_center(frame,g){
+ var tmp = mb_wfs_getBBOX(g);
+ var x = parseFloat(tmp[0]) + parseFloat((tmp[2] - tmp[0])/2);
+ var y = parseFloat(tmp[1]) + parseFloat((tmp[3] - tmp[1])/2);
+ var r = new Array();
+ r[0] = new Array();
+ r[0]['x'] = new Array();
+ r[0]['y'] = new Array();
+ r[0]['x'][0] = x;
+ r[0]['y'][0] = y;
+ return r;
+}
+function mb_wfs_draw(m){
+ var t = m['geomtype'];
+ if(t.indexOf("Point")>-1){
+ for(var i=0; i<mb_wfs_targets.length; i++){
+ mb_wfs_wz(mb_wfs_targets[i],'Point',m['geometry']);
+ }
+ }
+ else if(t.indexOf("Line")>-1){
+ for(var i=0; i<mb_wfs_targets.length; i++){
+ var c = mb_wfs_checkPix(mb_wfs_targets[i],m['geometry']);
+ if(c == false){
+ var r = mb_wfs_center(mb_wfs_targets[i],m['geometry']);
+ mb_wfs_wz(mb_wfs_targets[i],'Point',r);
+ }
+ else{
+ mb_wfs_wz(mb_wfs_targets[i],'Line',m['geometry']);
+ }
+ }
+ }
+ else if(t.indexOf("Polygon")>-1){
+ for(var i=0; i<mb_wfs_targets.length; i++){
+ var c = mb_wfs_checkPix(mb_wfs_targets[i],m['geometry']);
+ if(c == false){
+ var r = mb_wfs_center(mb_wfs_targets[i],m['geometry']);
+ mb_wfs_wz(mb_wfs_targets[i],'Point',r);
+ }
+ else{
+ mb_wfs_wz(mb_wfs_targets[i],'Polygon',m['geometry']);
+ }
+ }
+ }
+ else{
+ alert("unknown geomtype");
+ }
+}
+function mb_wfs_wz(mf,t,g){
+ if(t=='Point'){
+ for(var i=0; i<g.length; i++){
+ var apos = mb_wfs_toPix(mf,g[i]);
+ canvas[mf].setColor(mb_wfs_lineColor);
+ canvas[mf].drawEllipse((apos[0]-mb_wfs_diameter/2),(apos[1]-mb_wfs_diameter/2),mb_wfs_diameter,mb_wfs_diameter);
+ }
+ }
+ else if(t=='Line'){
+ for(var i=0; i<g.length; i++){
+ var apos = mb_wfs_toPix(mf,g[i]);
+ canvas[mf].setColor(mb_wfs_lineColor);
+ canvas[mf].drawPolyline(apos[0],apos[1]);
+ }
+ }
+ else if(t=='Polygon'){
+ for(var i=0; i<g.length; i++){
+ var apos = mb_wfs_toPix(mf,g[i]);
+ mb_wfs_toPix(mf,g[i]);
+ canvas[mf].setColor(mb_wfs_lineColor);
+ canvas[mf].drawPolygon(apos[0],apos[1]);
+ }
+ }
+}
+function mb_wfs_wzClean(){
+ for(var i=0; i<mb_wfs_targets.length; i++){
+ var el = window.frames[mb_wfs_targets[i]].document.getElementById('mod_gaz_draw');
+ if (el) el.innerHTML = "";
+ canvasHasDrawing[mb_wfs_targets[i]] = false;
+ }
+ return true;
+}
+function mb_wfs_checkTag(){
+ for(var i=0; i<mb_wfs_targets.length; i++){
+ var isTag = (window.frames[mb_wfs_targets[i]].document.getElementById('mod_gaz_draw'))?1:0;
+ if(isTag == 0){
+ var draw = window.frames[mb_wfs_targets[i]].document.createElement("div");
+ var tmp = window.frames[mb_wfs_targets[i]].document.getElementsByTagName("body")[0].appendChild(draw);
+ tmp.setAttribute("id","mod_gaz_draw");
+ tmp.setAttribute("style","position:absolute;top:0px;left:0px;width:0px;height:0px;z-index:100");
+ }
+ canvas[mb_wfs_targets[i]] = new jsGraphics('mod_gaz_draw', window.frames[mb_wfs_targets[i]]);
+ canvas[mb_wfs_targets[i]].setStroke(3);
+ canvasHasDrawing[mb_wfs_targets[i]] = false;
+ }
+ return true;
+}
+function mb_wfs_sortXY(g){
+ var r = new Array();
+ r[0] = new Array();
+ r[1] = new Array();
+ var cnt = 0;
+ for(var i=0; i<g.length -1 ; i+=2){
+ r[0][cnt] = g[i];
+ r[1][cnt] = g[i+1];
+ cnt++;
+ }
+ return r;
+}
+function mb_wfs_toPix(mf,g){
+ var r = new Array();
+ r[0] = new Array();
+ r[1] = new Array();
+ for(var i=0; i<g['x'].length; i++){
+ var pos = makeRealWorld2mapPos(mf,g['x'][i],g['y'][i]);
+ r[0][i] = pos[0];
+ r[1][i] = pos[1];
+ }
+ return r;
+}
\ No newline at end of file
Added: trunk/mapbender/http/javascripts/wfs_obj.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/wfs_obj.js?view=auto&rev=38
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/wfs_obj.js 2006-04-13 20:20:00+0000
@@ -0,0 +1,75 @@
+//$Id: wfs_obj.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/wfs_obj.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+//global variables
+var wfs = new Array();
+var wfs_featuretype_count = 0;
+var wfs_element_count = 0;
+//list of all wms-objects
+function add_wfs(
+ wfs_id,
+ wfs_version,
+ wfs_title,
+ wfs_abstract,
+ wfs_getcapabilities,
+ wfs_describefeaturetype){
+ wfs[wfs.length] = new wfs_const(
+ wfs_id,
+ wfs_version,
+ wfs_title,
+ wfs_abstract,
+ wfs_getcapabilities,
+ wfs_describefeaturetype);
+ //wfs_featuretype[wfs.length - 1] = new Array();
+}
+//the wms constructor
+function wfs_const(
+ wfs_id,
+ wfs_version,
+ wfs_title,
+ wfs_abstract,
+ wfs_getcapabilities,
+ wfs_describefeaturetype){
+
+ this.wfs_id = wfs_id;
+ this.wfs_version = wfs_version;
+ this.wfs_title = wfs_title;
+ this.wfs_abstract = wfs_abstract;
+ this.wfs_getcapabilities = wfs_getcapabilities;
+ this.wfs_describefeaturetype = wfs_describefeaturetype;
+
+ this.wfs_featuretype = new Array();
+ //alert(wfs_id + " , " +wfs_title + " , " +wfs_abstract + " , " +wfs_getcapabilities + " , " +wfs_describefeaturetype);
+}
+//featuretype
+function wfs_add_featuretype(
+ featuretype_name,
+ featuretype_title,
+ featuretype_srs,
+ featuretype_geomtype){
+
+ wfs[wfs.length-1].wfs_featuretype[wfs[wfs.length-1].wfs_featuretype.length] = new featuretype(
+ featuretype_name,
+ featuretype_title,
+ featuretype_srs,
+ featuretype_geomtype);
+//alert(featuretype_name + " , " +featuretype_title + " , " +featuretype_srs + " , " +featuretype_geomtype);
+}
+function featuretype(
+ featuretype_name,
+ featuretype_title,
+ featuretype_srs,
+ featuretype_geomtype){
+ this.featuretype_name = featuretype_name;
+ this.featuretype_title = featuretype_title;
+ this.featuretype_srs = featuretype_srs;
+ this.featuretype_geomtype = featuretype_geomtype;
+ this.element = new Array();
+ wfs_featuretype_count++;
+}
+//elements
+function wfs_add_featuretype_element(element_name, element_type, element_count, featuretype_count){
+ wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count] = new Array();
+ wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count]["name"] = element_name;
+ wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count]["type"] = element_type;
+ //alert(element_name +" , "+element_type);
+}
More information about the Mapbender_commits
mailing list