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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Aug 20 10:59:42 EDT 2008


Author: christoph
Date: 2008-08-20 10:59:41 -0400 (Wed, 20 Aug 2008)
New Revision: 2886

Modified:
   branches/2.5/http/javascripts/geometry.js
   branches/2.5/http/javascripts/map.js
   branches/2.5/http/javascripts/map.php
   branches/2.5/http/javascripts/map_obj.js
Log:
merged with trlp

Modified: branches/2.5/http/javascripts/geometry.js
===================================================================
--- branches/2.5/http/javascripts/geometry.js	2008-08-20 14:58:43 UTC (rev 2885)
+++ branches/2.5/http/javascripts/geometry.js	2008-08-20 14:59:41 UTC (rev 2886)
@@ -5,7 +5,6 @@
 */
 // http://www.mapbender.org/index.php/GeometryArray.js
 
-
 var nameGeometryArray = "GeometryArray";
 var nameMultiGeometry = "MultiGeometry";
 var nameGeometry = "Geometry";
@@ -231,7 +230,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;}
@@ -324,7 +323,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;
@@ -337,7 +336,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();
@@ -353,7 +352,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);
 																		}
@@ -370,7 +369,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);
 																		}
@@ -387,7 +386,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);
 																		}
@@ -1275,28 +1274,19 @@
 	 * @param {Float} y y coordinate within the map frame
 	 */
 	var displayIcon = function (url, x, y) {
-		if(ie){
-			var newImg = document.createElement("img");
-			var newImgTop = y - Math.round(80/2);
-			var newImgLeft = x - Math.round(80/2);
-			that.canvasDivTag.getTag().innerHTML = "<img src='" + url + "' style='position:absolute;top:"+newImgTop+";left:"+newImgLeft+";z-index:100'/>";
-		}
-		else{
-			var newImg = document.createElement("img");
-			newImg.src = url;
-			that.canvasDivTag.getTag().appendChild(newImg);	
-			//newImg.className = "mapsymbol";
-			//newImg.style.cursor = "help";
-			newImg.style.position = "absolute";
-			
-			// center the image at x, y
-			newImg.style.top = y - Math.round(80/2);
-			newImg.style.left = x - Math.round(80/2);
-	//		newImg.style.top = y - Math.round(80);
-	//		newImg.style.left = x;
-			newImg.style.zIndex = 100;
-		}
-	};
+		var newImg = that.canvasDivTag.getRootNode().createElement("img");
+		newImg.src = url;
+		newImg.className = "mapsymbol";
+		newImg.style.cursor = "help";
+		newImg.style.position = "absolute";
+
+		// center the image at x, y
+		newImg.style.top = y - Math.round(newImg.height/2);
+		newImg.style.left = x - Math.round(newImg.width/2);
+		newImg.style.zIndex = 100;
+		var thisTag = that.canvasDivTag.getTag();
+		thisTag.appendChild(newImg);
+	}
 	
 	/**
 	 * This is the {@link DivTag} that contains the output by {@link jsGraphics}.
@@ -1309,7 +1299,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;
@@ -1775,7 +1765,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: branches/2.5/http/javascripts/map.js
===================================================================
--- branches/2.5/http/javascripts/map.js	2008-08-20 14:58:43 UTC (rev 2885)
+++ branches/2.5/http/javascripts/map.js	2008-08-20 14:59:41 UTC (rev 2886)
@@ -1570,7 +1570,11 @@
 		}
 		return newString;
 	};
-	
+
+	this.getRootNode = function () {
+		return rootNode;
+	};
+
 	/**
 	 * @private
 	 */
@@ -1961,7 +1965,7 @@
 });
 
 eventInit.register(function () {
-	mb_localizeButtons();
+	eventLocalize.trigger();
 });
 
 

Modified: branches/2.5/http/javascripts/map.php
===================================================================
--- branches/2.5/http/javascripts/map.php	2008-08-20 14:58:43 UTC (rev 2885)
+++ branches/2.5/http/javascripts/map.php	2008-08-20 14:59:41 UTC (rev 2886)
@@ -107,6 +107,7 @@
 		for ($i = 0; $i < count($moduleArray); $i++) {
 			$currentFile = dirname(__FILE__) . "/../javascripts/" . trim($moduleArray[$i]);
 			if (file_exists($currentFile)) {
+				$e = new mb_notice("LOADING module : " . $currentFile);
 				require_once($currentFile);
 			}
 			else {
@@ -133,6 +134,7 @@
 		$e_target = explode(",",$row_js["e_target"]);
 		$currentFile = $row_js["e_js_file"];
 		if (file_exists($currentFile)) {
+			$e = new mb_notice("LOADING Javascript: " . $currentFile . " of element: " . $e_id);
 			require_once($currentFile);
 		}
 		else {

Modified: branches/2.5/http/javascripts/map_obj.js
===================================================================
--- branches/2.5/http/javascripts/map_obj.js	2008-08-20 14:58:43 UTC (rev 2885)
+++ branches/2.5/http/javascripts/map_obj.js	2008-08-20 14:59:41 UTC (rev 2886)
@@ -206,6 +206,9 @@
 	}
 	
 	rq += "&LAYERS=" + layers.join(",");
+	if(mb_feature_count > 0){             
+		rq += "&FEATURE_COUNT="+mb_feature_count;
+	}	
 	rq += "&QUERY_LAYERS=" + querylayers.join(",");
 	rq += "&WIDTH=" + mapObj.getWidth();
 	rq += "&HEIGHT=" + mapObj.getHeight();
@@ -404,11 +407,13 @@
  * @return array of layernames
  * @type string[]
  */
-wms_const.prototype.getQuerylayers = function(){
+wms_const.prototype.getQuerylayers = function(mapObj){
 	queryLayers = [];
 	for(var i=0; i< this.objLayer.length; i++){
 		if(this.objLayer[i].gui_layer_querylayer === 1 && ! this.objLayer[i].has_childs ){
-			queryLayers.push(this.objLayer[i].layer_name);
+			if(this.objLayer[i].checkScale(mapObj)){
+				queryLayers.push(this.objLayer[i].layer_name);
+			}
 		}
 	}
 	if(queryLayers.length === 0){
@@ -773,4 +778,4 @@
 wms_layer.prototype.setQueryable = function(queryable){
 	this.gui_layer_querylayer = parseInt(queryable, 10);
 	//console.log("setQueryable(%i) for Layer %s",queryable, this.layer_name);
-};
\ No newline at end of file
+};



More information about the Mapbender_commits mailing list