[Mapbender-commits] r6611 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jul 22 10:47:58 EDT 2010


Author: verenadiewald
Date: 2010-07-22 14:47:58 +0000 (Thu, 22 Jul 2010)
New Revision: 6611

Modified:
   trunk/mapbender/lib/extent.js
Log:
new function setCrs

Modified: trunk/mapbender/lib/extent.js
===================================================================
--- trunk/mapbender/lib/extent.js	2010-07-22 14:34:59 UTC (rev 6610)
+++ trunk/mapbender/lib/extent.js	2010-07-22 14:47:58 UTC (rev 6611)
@@ -84,6 +84,22 @@
 		}
 	};
 
+	this.setCrs = function (options) {
+		if (options.extent) {
+			var sw = new Proj4js.Point(options.extent.min.x, options.extent.min.y);
+			var ne = new Proj4js.Point(options.extent.max.x, options.extent.max.y);
+		}
+		else {
+			var sw = new Proj4js.Point(that.min.x, that.min.y);
+			var ne = new Proj4js.Point(that.max.x, that.max.y);
+		}
+		sw = Proj4js.transform(options.source, options.dest, sw);
+		ne = Proj4js.transform(options.source, options.dest, ne);
+		sw = new Mapbender.Point(sw.x, sw.y);
+		ne = new Mapbender.Point(ne.x, ne.y);
+		that.set(sw, ne);
+	};
+	
 	var isPoint = function (param) {
 		if (typeof param === "object" && param.constructor === Point) {
 			return true;



More information about the Mapbender_commits mailing list