[Mapbender-commits] r5413 - branches/2.6/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 25 04:34:38 EST 2010


Author: christoph
Date: 2010-01-25 04:34:37 -0500 (Mon, 25 Jan 2010)
New Revision: 5413

Modified:
   branches/2.6/http/javascripts/map_obj.js
Log:


Modified: branches/2.6/http/javascripts/map_obj.js
===================================================================
--- branches/2.6/http/javascripts/map_obj.js	2010-01-25 09:33:56 UTC (rev 5412)
+++ branches/2.6/http/javascripts/map_obj.js	2010-01-25 09:34:37 UTC (rev 5413)
@@ -217,7 +217,7 @@
 		for (var i = 0; i < this.wms.length; i++) {
 			var found = false;
 			for (var j = 0; j < this.wms[i].gui_epsg.length; j++) {
-				if (options.srs === this.wms[i].gui_epsg[j]) {
+				if (options.srs === this.wms[i].gui_epsg[j] && this.wms[i].gui_epsg_supported[j]) {
 					found = true;
 					break;
 				}
@@ -480,7 +480,6 @@
 	};
 	
 	this.zoomFull = function () {
-		
 		for (var i = 0; i < this.wms[0].gui_epsg.length; i++) {
 			if (this.epsg == this.wms[0].gui_epsg[i]) {
 				var bbox_minx = parseFloat(this.wms[0].gui_minx[i]);
@@ -544,7 +543,7 @@
 		var deltaY = xtenty/this.height;
 		var roundx, roundy;
 
-		var digitsX = Math.round(Math.log(deltaX)/Math.log(10));
+ 		var digitsX = Math.round(Math.log(deltaX)/Math.log(10));
 		var digitsY = Math.round(Math.log(deltaY)/Math.log(10));
 		var roundX = Math.pow(10, -digitsX);
 		var roundY = Math.pow(10, -digitsY);
@@ -553,7 +552,15 @@
 		var posY = parseFloat(maxY - (aPoint.y / this.height) * xtenty);
 		posX = Math.round(posX * roundX) / roundX;
 		posY = Math.round(posY * roundY) / roundY;
-		return new Point(posX.toFixed(-digitsX), posY.toFixed(-digitsY));
+		var newX = posX, newY = posY;
+		if (digitsX < 0) {
+			newX = posX.toFixed(-digitsX);
+		}
+		if (digitsY < 0) {
+			newY = posY.toFixed(-digitsY);
+		}
+		var pt = new Point(newX, newY);
+		return pt;
 	};
 	
 	/**
@@ -813,7 +820,7 @@
 			try {
 				if (this.skipWmsIfSrsNotSupported && isIgnoredWms(currentWms)) {
 					continue;
-				};
+				}
 			}
 			catch (e) {
 				new Mb_warning(e.message);
@@ -837,6 +844,7 @@
 
 			var myMapId = this.elementName + "_map_" + ii;
 			eventAfterMapRequest.trigger({"map":this, "myMapId":myMapId});
+	        that.afterMapRequest.trigger({"map":this, "myMapId":myMapId});
 			return true;
 		}  
 		return false; 
@@ -865,7 +873,7 @@
 
 		this.mb_MapFutureObj[cnt].querylayers = [];
 
-		for(var i=0; i < this.querylayers.length; i++) {
+		for (var i = 0; i < this.querylayers.length; i++) {
 			this.mb_MapFutureObj[cnt].querylayers[i] = this.querylayers[i];
 		}
 	};
@@ -905,6 +913,10 @@
 			"map": this,
 			"myMapId": myMapId.join(",")
 		});
+        this.afterMapRequest.trigger({
+			"map": this,
+			"myMapId": myMapId.join(",")
+		});
 	};
 
 	var that = this;
@@ -1089,9 +1101,12 @@
 		clickY -= parseInt(this.getDomElement().style.top, 10);
 		
 		return new Point(clickX, clickY);
-	}
+	};
 
 	eventAfterMapObjectConstruction.trigger();
+
+    this.afterMapRequest = new MapbenderEvent();
+
 }
 
 mb_mapObj_const.prototype.getWfsConfIds = function (wfs_config) {
@@ -1103,8 +1118,9 @@
 		for(var ii=0; ii < this.wms[i].objLayer.length; ii++){
 			var o = this.wms[i].objLayer[ii];
 			if(o.gui_layer_wfs_featuretype != '' && o.gui_layer_querylayer == '1'){
-				if(!checkscale || o.checkScale(this))
+				if(!checkscale || o.checkScale(this)) {
 					db_wfs_conf_id[db_wfs_conf_id.length] = o.gui_layer_wfs_featuretype;
+				}
 			}
 		}
 	}



More information about the Mapbender_commits mailing list