[Mapbender-commits] r3095 - in trunk/mapbender/http: javascripts tools

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Oct 1 09:53:23 EDT 2008


Author: christoph
Date: 2008-10-01 09:53:23 -0400 (Wed, 01 Oct 2008)
New Revision: 3095

Removed:
   trunk/mapbender/http/javascripts/wfs_usemap.js
Modified:
   trunk/mapbender/http/javascripts/geometry.js
   trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
   trunk/mapbender/http/javascripts/wfs.js
   trunk/mapbender/http/tools/mod_monitorCapabilities_read.php
Log:
merged w/ 2.5

Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js	2008-10-01 13:52:35 UTC (rev 3094)
+++ trunk/mapbender/http/javascripts/geometry.js	2008-10-01 13:53:23 UTC (rev 3095)
@@ -231,7 +231,7 @@
 	var q = this.get(0).get(0).get(0);
 	var min = cloneObject(q);
 	var max = cloneObject(q);
-	for(var i=0; i<this.count();i++){
+	for(var i=0; i < this.count();i++){
 		var pos = this.get(i).getBBox();
 		if (pos[0].x < min.x) {min.x = pos[0].x;}
 		if (pos[1].x > max.x) {max.x = pos[1].x;}
@@ -363,7 +363,7 @@
 																		this.addMember(geomType.point);
 																		
 																		this.get(-1).addGeometry();
-																		this.getGeometry(-1,-1).addPointByCoordinates(coordinates[0], coordinates[1]);
+																		this.getGeometry(-1,-1).addPointByCoordinates(coordinates[0], coordinates[1], coordinates[2]);
 																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		this.close();
 																		break;
@@ -376,7 +376,7 @@
 																		this.get(-1).addGeometry();
 																		for (var m = 0; m < coordinates.length; m++) {
 																			var currentPoint = coordinates[m];
-																			this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+																			this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1], currentPoint[2]);
 																		}
 																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		this.close();
@@ -392,7 +392,7 @@
 																			var currentLine = coordinates[m];
 																			for (var n = 0; n < currentLine.length; n++) {
 																				var currentPoint = currentLine[n];
-																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1], currentPoint[2]);
 																			}
 																			this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		}
@@ -409,7 +409,7 @@
 																			var currentPolygon = coordinates[m];
 																			for (var n = 0; n < currentPolygon.length; n++) {
 																				var currentPoint = currentPolygon[n];
-																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1], currentPoint[2]);
 																			}
 																			this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		}
@@ -426,7 +426,7 @@
 																			var currentPolygon = coordinates[m];
 																			for (var n = 0; n < currentPolygon.length; n++) {
 																				var currentPoint = currentPolygon[n];
-																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1], currentPoint[2]);
 																			}
 																			this.getGeometry(-1,-1).setEpsg(featureEpsg);
 																		}
@@ -1395,7 +1395,7 @@
 
 	var diameter = 8;
 	var minWidth = 8;
-	var lineWidth = aLineWidth;
+	var lineWidth = aLineWidth || 2;
 	var mapframe = aMapframe;
 	var mapObjInd = getMapObjIndexByName(mapframe);
 	var mapframeWidth = mb_mapObj[mapObjInd].width;
@@ -1861,7 +1861,7 @@
 	for (attr in a) {
 		var b = a[attr];
 		if (typeof(b) == "object") {z += objString(b);}
-		else {z += attr + " " + b + "\n";alert(attr + " " + b);}
+		else {z += attr + " " + b + "\n";}
 	}	
 	return z;
 }

Modified: trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php	2008-10-01 13:52:35 UTC (rev 3094)
+++ trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php	2008-10-01 13:53:23 UTC (rev 3095)
@@ -575,7 +575,7 @@
 		var mapPosYRemovePix = mapPos[1] - buffer;
 		var realWorld1 = makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYRemovePix);
 		var realWorld2 = makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
-		var realWorld3 = makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYAddPix);
+		var realWorld3 = makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
 		var realWorld4 = makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYAddPix);
 		for(var i=0; i<js_wfs_conf_id.length; i++){
 			var srs = wfs_config[js_wfs_conf_id[i]]['featuretype_srs'];
@@ -781,4 +781,4 @@
 }
 if(wfsResultToPopupDiv==1){
 	mb_registerWfsReadSubFunctions(function(geom){displayPopup(geom);});
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/http/javascripts/wfs.js
===================================================================
--- trunk/mapbender/http/javascripts/wfs.js	2008-10-01 13:52:35 UTC (rev 3094)
+++ trunk/mapbender/http/javascripts/wfs.js	2008-10-01 13:53:23 UTC (rev 3095)
@@ -1,33 +1,166 @@
-<?php
-#$Id$
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
-# Copyright (C) 2002 CCGIS 
-#
-# 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.
+// ---------------------------------------------------------------------------------------------------------------
+// --- usemap (begin) --------------------------------------------------------------------------------------------
 
-session_start();
-import_request_variables("PG");
-require_once(dirname(__FILE__) . "/../php/mb_validateSession.php");
-require_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
+function mod_usemap(wfs_name) {
+	if (wfs_name == "") {
+		usemap = "";
+	}
+	var ind = getMapObjIndexByName(mb_wfs_target);
+	var myImg = window.frames[mb_wfs_target].document.getElementById("um_img").style; 
+	myImg.width = mb_mapObj[ind].width;
+	myImg.height = mb_mapObj[ind].height;
 
-$e_id_css = "wfs";
-include '../include/dyn_js.php';
-require_once(dirname(__FILE__) . "/wfs_usemap.js");
-?>
+	for (var i = 0 ; i < mb_wfs_fetch.count() ; i ++) {
+		if (mb_wfs_fetch.get(i).wfs_conf == wfs_name || wfs_name == "") {
+		
+			if (mb_wfs_fetch.get(i).geomType == geomType.polygon) {
+				usemap += mod_usemap_polygon(i);
+			}
+			else if (mb_wfs_fetch.get(i).geomType == geomType.point) {
+				usemap += mod_usemap_circle(i);
+			}
+			else if (mb_wfs_fetch.get(i).geomType == geomType.line) {
+				usemap += mod_usemap_line(i);
+			}
+		}
+	}
+	writeUsemap(usemap);
+}
+
+function mod_usemap_circle(ind){
+	var str = "";
+	var coord = "";
+	
+	var title = "";
+	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
+		if (i>0) title += "&#10;";
+		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
+	}
+
+	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
+		var p = mb_wfs_fetch.getPoint(ind, i, 0);
+		var pos = realToMap(mb_wfs_target,p);
+		coord += pos.x + ", " + pos.y;
+		
+		str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
+		str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle'  coords='";
+		str += coord + ", " + mod_usemap_radius + "' href='#'>";
+	}
+	
+	return str;
+}
+
+function mod_usemap_line_calculate (aGeometry, j, orientation, cnt) {
+	var coord = "";
+
+	var p1 = realToMap(mb_wfs_targets[0],aGeometry.get(j));
+	var p2 = realToMap(mb_wfs_targets[0],aGeometry.get(j+orientation));
+
+	var vec = p2.minus(p1);
+	
+	if (vec.x != 0 || vec.y != 0) {
+		var n_vec;
+		if (vec.x != 0) {
+			if (vec.x > 0) n_vec = new Point((-vec.y)/vec.x, -1);
+			else n_vec = new Point(vec.y/vec.x, 1);
+		}
+		else {
+			if (vec.y > 0) n_vec = new Point(1,0);
+			else n_vec = new Point(-1,0);
+		}
+		n_vec = n_vec.times(mod_usemap_line_tolerance).dividedBy(n_vec.dist(new Point(0,0)))
+
+		lp = new Point(p1.x + n_vec.x, p1.y - n_vec.y);
+
+		if (cnt > 0) coord += ", ";
+
+		coord += parseInt(lp.x) + ", " + parseInt(lp.y);
+		coord += ", " + parseInt(lp.x+vec.x) + ", " + parseInt(lp.y+vec.y);
+	}
+	return coord;
+}
+
+function mod_usemap_line(ind){
+	var str = "";
+	var title = "";
+	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
+		if (i>0) title += "&#10;";
+		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
+	}
+	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
+		var coord = "";
+		var cnt = 0;
+
+		for (var j = 0 ; j < mb_wfs_fetch.getGeometry(ind,i).count() - 1  ; j ++) {
+			var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, 1, cnt);
+			if (result != "") {
+				coord += result;
+				cnt++;
+			}
+		}
+		
+		for (var j = (mb_wfs_fetch.getGeometry(ind,i).count() - 1) ; j > 0 ; j--) {
+			var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, -1, cnt);
+			if (result != "") {
+				coord += result;
+				cnt++;
+			}
+		}
+		
+		if (coord != "") {
+			str += "<AREA title='"+title+"'";
+			str += "onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
+			str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' ";
+			str += "shape='poly'  coords='";
+			str += coord + "' href='#'>";
+		}
+		else {
+			//display circle
+			var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind,i,0));
+			coord += pos.x + ", " + pos.y;
+			
+			str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
+			str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle'  coords='";
+			str += coord + ", " + mod_usemap_radius + "' href='#'>";
+		}
+	}
+	
+	return str;
+}
+
+function mod_usemap_polygon(ind){
+	var str = "";
+	var coord = "";
+	var title = "";
+	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
+		if (i>0) title += "&#10;";
+		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
+	}
+
+	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
+		var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, 0));
+		coord += pos.x + ", " + pos.y;
+		
+		for (var j = 1 ; j < mb_wfs_fetch.getGeometry(ind,i).count() ; j ++) {
+			pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, j));
+			coord += ", " + pos.x + ", " + pos.y;
+		}
+		
+		str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
+		str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='poly'  coords='";
+		str += coord + "' href='#'>";
+	}
+	
+	return str;
+}
+
+function writeUsemap(str) {
+	writeTag(mb_wfs_targets[0], 'um', str);
+}
+// --- usemap (end) ----------------------------------------------------------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------
+
+
 var highlight_tag_id = "wfs_highlight_tag";
 var mb_wfs_fetched = [];
 
@@ -86,14 +219,14 @@
 		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 = [];
 		var y = [];
 		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);
 	}
 }
@@ -133,7 +266,7 @@
 function mb_wfs_reset(){
 	mb_wfs_fetch = new parent.GeometryArray();
 	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");
@@ -183,7 +316,7 @@
 		highlight.del(m, '#ff0000');
 		highlight.paint();
 	}
-	else 
+	else
 		if (type == 'click') {
 			var tmp = m.getBBox();
 			if (m.geomType == geomType.point) {
@@ -205,17 +338,17 @@
 
 function get_wfs_str(myconf, d, m, type, fid) {
 
-	<!-- Getting the Namspace for the FeautureType -->	
+	<!-- Getting the Namspace for the FeautureType -->
 	var featureTypeArray = myconf['featuretype_name'].split(':')
 	var featureNS = featureTypeArray[0];
 
 	var str = '<wfs:Transaction version="1.0.0" service="WFS" ';
 
 	var ns_gml = false;	var ns_ogc = false;	var ns_xsi = false;	var ns_wfs = false;	var ns_featureNS = false;
-	
+
 	for (var q = 0 ; q < myconf['namespaces'].length ; q++) {
-	
-		if (myconf['namespaces'][q]['name'] == "gml"){		
+
+		if (myconf['namespaces'][q]['name'] == "gml"){
 			 ns_gml = true;
 			 str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
 		} else if (myconf['namespaces'][q]['name'] == "ogc") {
@@ -233,13 +366,13 @@
 			strForSchemaLocation = myconf['namespaces'][q]['location'];
 		}
 	}
-	
+
 	if (ns_gml == false) str += 'xmlns:gml="http://www.opengis.net/gml" ';
 	if (ns_ogc == false) str += 'xmlns:ogc="http://www.opengis.net/ogc" ';
 	if (ns_xsi == false) str += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';
 	if (ns_featureNS == false) str += 'xmlns:"+featureNS+"="http://www.someserver.com/"+featureNS+"" ';
 	if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
-	
+
 	str += 'xsi:schemaLocation="http://www.opengis.net/wfs';
 	str += ' http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd';
 	str += ' ' + strForSchemaLocation;
@@ -261,24 +394,24 @@
 		}
 		for(var j=0; j<myconf['element'].length; j++){
 			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];	
+				var el_geom = myconf['element'][j]['element_name'];
 			}
 		}
-		str += '<' + el_geom + '>';	
+		str += '<' + el_geom + '>';
 		if(d.get(m).geomType == geomType.point){
 			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '">';
 			str += '<gml:coordinates>';
-			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y; 
+			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y;
 			str += '</gml:coordinates>';
-			str += '</gml:Point>';		
+			str += '</gml:Point>';
 		}
 		if(d.get(m).geomType == geomType.line){
 			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
 			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
 			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
+				if(k>0)	str += " ";
 				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
+			}
 			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
 			str += '</gml:MultiLineString>';
 		}
@@ -287,12 +420,12 @@
 			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
 
 			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
+				if(k>0)	str += " ";
 				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
+			}
 			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
 		}
-		str += '</' + el_geom + '></'+ myconf['featuretype_name']+'></wfs:Insert>';		
+		str += '</' + el_geom + '></'+ myconf['featuretype_name']+'></wfs:Insert>';
 	}
 	//
 	// --------------------------------------- UPDATE ------------------------------------------------
@@ -309,22 +442,22 @@
 		}
 		for(var j=0; j<myconf['element'].length; j++){
 			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];	
+				var el_geom = myconf['element'][j]['element_name'];
 			}
 		}
 		str += '<wfs:Property><wfs:Name>' + el_geom + '</wfs:Name><wfs:Value>';
 		if(d.get(m).geomType == geomType.point){
 			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '"><gml:coordinates>';
-			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y; 
-			str += '</gml:coordinates></gml:Point>';		
+			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y;
+			str += '</gml:coordinates></gml:Point>';
 		}
 		if(d.get(m).geomType == geomType.line){
 			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
 			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
 			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
+				if(k>0)	str += " ";
 				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
+			}
 			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
 			str += '</gml:MultiLineString>';
 		}
@@ -332,9 +465,9 @@
 			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
 			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
 			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
+				if(k>0)	str += " ";
 				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
+			}
 			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
 		}
 		str += '</wfs:Value></wfs:Property>';
@@ -348,13 +481,13 @@
 		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'];	
+				var el_geom = myconf['element'][j]['element_name'];
 			}
 		}
 		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
 		str += '</wfs:Delete>';
 	}
-	
+
 	str += '</wfs:Transaction>';
 	return str;
-}
+}
\ No newline at end of file

Deleted: trunk/mapbender/http/javascripts/wfs_usemap.js
===================================================================
--- trunk/mapbender/http/javascripts/wfs_usemap.js	2008-10-01 13:52:35 UTC (rev 3094)
+++ trunk/mapbender/http/javascripts/wfs_usemap.js	2008-10-01 13:53:23 UTC (rev 3095)
@@ -1,167 +0,0 @@
-/* 
-* $Id$
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
-
-// ---------------------------------------------------------------------------------------------------------------
-// --- usemap (begin) --------------------------------------------------------------------------------------------
-
-function mod_usemap(wfs_name) {
-	if (wfs_name == "") {
-		usemap = "";
-	}
-	var ind = getMapObjIndexByName(mb_wfs_target);
-	var myImg = window.frames[mb_wfs_target].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.count() ; i ++) {
-		if (mb_wfs_fetch.get(i).wfs_conf == wfs_name || wfs_name == "") {
-		
-			if (mb_wfs_fetch.get(i).geomType == geomType.polygon) {
-				usemap += mod_usemap_polygon(i);
-			}
-			else if (mb_wfs_fetch.get(i).geomType == geomType.point) {
-				usemap += mod_usemap_circle(i);
-			}
-			else if (mb_wfs_fetch.get(i).geomType == geomType.line) {
-				usemap += mod_usemap_line(i);
-			}
-		}
-	}
-	writeUsemap(usemap);
-}
-
-function mod_usemap_circle(ind){
-	var str = "";
-	var coord = "";
-	
-	var title = "";
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
-		if (i>0) title += "&#10;";
-		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
-	}
-
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
-		var p = mb_wfs_fetch.getPoint(ind, i, 0);
-		var pos = realToMap(mb_wfs_target,p);
-		coord += pos.x + ", " + pos.y;
-		
-		str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
-		str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle'  coords='";
-		str += coord + ", " + mod_usemap_radius + "' href='#'>";
-	}
-	
-	return str;
-}
-
-function mod_usemap_line_calculate (aGeometry, j, orientation, cnt) {
-	var coord = "";
-
-	var p1 = realToMap(mb_wfs_targets[0],aGeometry.get(j));
-	var p2 = realToMap(mb_wfs_targets[0],aGeometry.get(j+orientation));
-
-	var vec = p2.minus(p1);
-	
-	if (vec.x != 0 || vec.y != 0) {
-		var n_vec;
-		if (vec.x != 0) {
-			if (vec.x > 0) n_vec = new Point((-vec.y)/vec.x, -1);
-			else n_vec = new Point(vec.y/vec.x, 1);
-		}
-		else {
-			if (vec.y > 0) n_vec = new Point(1,0);
-			else n_vec = new Point(-1,0);
-		}
-		n_vec = n_vec.times(mod_usemap_line_tolerance).dividedBy(n_vec.dist(new Point(0,0)))
-
-		lp = new Point(p1.x + n_vec.x, p1.y - n_vec.y);
-
-		if (cnt > 0) coord += ", ";
-
-		coord += parseInt(lp.x) + ", " + parseInt(lp.y);
-		coord += ", " + parseInt(lp.x+vec.x) + ", " + parseInt(lp.y+vec.y);
-	}
-	return coord;
-}
-
-function mod_usemap_line(ind){
-	var str = "";
-	var title = "";
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
-		if (i>0) title += "&#10;";
-		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
-	}
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
-		var coord = "";
-		var cnt = 0;
-
-		for (var j = 0 ; j < mb_wfs_fetch.getGeometry(ind,i).count() - 1  ; j ++) {
-			var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, 1, cnt);
-			if (result != "") {
-				coord += result;
-				cnt++;
-			}
-		}
-		
-		for (var j = (mb_wfs_fetch.getGeometry(ind,i).count() - 1) ; j > 0 ; j--) {
-			var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, -1, cnt);
-			if (result != "") {
-				coord += result;
-				cnt++;
-			}
-		}
-		
-		if (coord != "") {
-			str += "<AREA title='"+title+"'";
-			str += "onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
-			str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' ";
-			str += "shape='poly'  coords='";
-			str += coord + "' href='#'>";
-		}
-		else {
-			//display circle
-			var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind,i,0));
-			coord += pos.x + ", " + pos.y;
-			
-			str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
-			str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle'  coords='";
-			str += coord + ", " + mod_usemap_radius + "' href='#'>";
-		}
-	}
-	
-	return str;
-}
-
-function mod_usemap_polygon(ind){
-	var str = "";
-	var coord = "";
-	var title = "";
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
-		if (i>0) title += "&#10;";
-		title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
-	}
-
-	for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
-		var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, 0));
-		coord += pos.x + ", " + pos.y;
-		
-		for (var j = 1 ; j < mb_wfs_fetch.getGeometry(ind,i).count() ; j ++) {
-			pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, j));
-			coord += ", " + pos.x + ", " + pos.y;
-		}
-		
-		str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
-		str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='poly'  coords='";
-		str += coord + "' href='#'>";
-	}
-	
-	return str;
-}
-
-function writeUsemap(str) {
-	writeTag(mb_wfs_targets[0], 'um', str);
-}
-// --- usemap (end) ----------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------------------------

Modified: trunk/mapbender/http/tools/mod_monitorCapabilities_read.php
===================================================================
--- trunk/mapbender/http/tools/mod_monitorCapabilities_read.php	2008-10-01 13:52:35 UTC (rev 3094)
+++ trunk/mapbender/http/tools/mod_monitorCapabilities_read.php	2008-10-01 13:53:23 UTC (rev 3095)
@@ -237,11 +237,11 @@
 	$str .= "</tr></table></td>";
 	
 #	$str .= "\n\t\t\t<td><a href='output_".$wms_id[$k]."_".$max.".txt' target=_blank>log</a></td>";
-	$str .= "\n\t\t<td><input type=button value='details' onclick=\"var newWindow = window.open('../php/mod_monitorCapabilities_read_single.php?wmsid=".$wms_id[$k]."','wms','width=500,height=700,scrollbars');newWindow.href.location='test.php'\"></td></tr>";
+	$str .= "\n\t\t<td><input type=button value='details' onclick=\"var newWindow = window.open('../tools/mod_monitorCapabilities_read_single.php?wmsid=".$wms_id[$k]."','wms','width=500,height=700,scrollbars');newWindow.href.location='test.php'\"></td></tr>";
 	$cnt++;
 }
 $str .= "\n\t</table>\n\t<br/><input type=hidden name=cbs value='".$cnt."'>\n</form>";
 echo $str;
 
 ?>
-</body></html>
\ No newline at end of file
+</body></html>



More information about the Mapbender_commits mailing list