[Mapbender-commits] r4265 - in trunk/mapbender: http/html http/javascripts http/php http/print lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jun 30 11:13:46 EDT 2009


Author: christoph
Date: 2009-06-30 11:13:45 -0400 (Tue, 30 Jun 2009)
New Revision: 4265

Modified:
   trunk/mapbender/http/html/mod_treefolder2.php
   trunk/mapbender/http/html/mod_treefolder2_multiple.php
   trunk/mapbender/http/html/mod_treefolderPlain.php
   trunk/mapbender/http/javascripts/map.js
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/mod_changeEPSG.php
   trunk/mapbender/http/javascripts/mod_digitize_tab.php
   trunk/mapbender/http/javascripts/mod_dragMapSize.php
   trunk/mapbender/http/javascripts/mod_dynamicOverview.php
   trunk/mapbender/http/javascripts/mod_export_image.php
   trunk/mapbender/http/javascripts/mod_print1.php
   trunk/mapbender/http/javascripts/mod_resize_mapsize.php
   trunk/mapbender/http/javascripts/mod_scaleHint.php
   trunk/mapbender/http/javascripts/mod_scaleText.php
   trunk/mapbender/http/javascripts/mod_selectMapsize.php
   trunk/mapbender/http/javascripts/mod_usemap.php
   trunk/mapbender/http/javascripts/ovnf.php
   trunk/mapbender/http/php/mod_changeEPSG_dynamic.php
   trunk/mapbender/http/php/mod_mapOV.php
   trunk/mapbender/http/php/mod_meetingPoint.php
   trunk/mapbender/http/print/mod_printPDF.php
   trunk/mapbender/lib/point.js
Log:
changed extent handling

Modified: trunk/mapbender/http/html/mod_treefolder2.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolder2.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/html/mod_treefolder2.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -417,7 +417,7 @@
 	for (var i=0;i<my.length;i++){
 		if(my[i]["epsg"]==parent.mb_mapObj[j].epsg){
 			parent.mb_calculateExtent(mod_treeGDE_map,my[i]["minx"],my[i]["miny"],my[i]["maxx"],my[i]["maxy"]);
-			var arrayExt = parent.mb_mapObj[j].extent.split(",");
+			var arrayExt = parent.mb_mapObj[j].extent.toString().split(",");
 			parent.mb_repaint(mod_treeGDE_map,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
 			break;
 		}

Modified: trunk/mapbender/http/html/mod_treefolder2_multiple.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolder2_multiple.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/html/mod_treefolder2_multiple.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -427,7 +427,7 @@
 	for (var i=0;i<my.length;i++){
 		if(my[i]["epsg"]==parent.mb_mapObj[j].epsg){
 			parent.mb_calculateExtent(mod_treeGDE_map,my[i]["minx"],my[i]["miny"],my[i]["maxx"],my[i]["maxy"]);
-			var arrayExt = parent.mb_mapObj[j].extent.split(",");
+			var arrayExt = parent.mb_mapObj[j].extent.toString().split(",");
 			parent.mb_repaint(mod_treeGDE_map,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
 			break;
 		}

Modified: trunk/mapbender/http/html/mod_treefolderPlain.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolderPlain.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/html/mod_treefolderPlain.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -382,7 +382,7 @@
 	for (var i=0;i<my.length;i++){
 		if(my[i]["epsg"]== mb_mapObj[j].epsg){
 			 mb_calculateExtent(mod_treeGDE_map,my[i]["minx"],my[i]["miny"],my[i]["maxx"],my[i]["maxy"]);
-			var arrayExt =  mb_mapObj[j].extent.split(",");
+			var arrayExt =  mb_mapObj[j].extent.toString().split(",");
 			 mb_repaint(mod_treeGDE_map,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
 			break;
 		}

Modified: trunk/mapbender/http/javascripts/map.js
===================================================================
--- trunk/mapbender/http/javascripts/map.js	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/map.js	2009-06-30 15:13:45 UTC (rev 4265)
@@ -16,14 +16,81 @@
  * @type Object
  */
 function Extent(minx,miny,maxx,maxy) {
-	this.minx = parseFloat(minx);
-	this.miny = parseFloat(miny);
-	this.maxx = parseFloat(maxx);
-	this.maxy = parseFloat(maxy);
-	this.extentx = this.maxx - this.minx;
-	this.extenty = this.maxy - this.miny;
-	this.centerx = this.minx + this.extentx/2;
-	this.centery = this.miny + this.extenty/2;	
+	var that = this;
+
+	var setMin = function (min) {
+		that.min = min;
+		that.minx = min.x;
+		that.miny = min.y;
+	};
+	var setMax = function (max) {
+		that.max = max;
+		that.maxx = max.x;
+		that.maxy = max.y;
+	};
+	
+	var setExtent = function (extent) {
+		that.extent = extent;
+		that.extentx = extent.x;
+		that.extenty = extent.y;
+	};
+	
+	var setCenter = function (center) {
+		that.center = center;
+		that.centerx = center.x;
+		that.centery = center.y;
+	};
+	
+	/**
+	 * Allows to set the center (one param) or the extent (two params)
+	 * 
+	 * @param {Point} min or center
+	 * @param {Point} max [obsolete if first is center]
+	 */
+	this.set = function (min, max) {
+		// only one parameter (center)
+		if (typeof max === "undefined") {
+			var newLowerLeft = min.minus(this.extent.dividedBy(2));
+			var newUpperRight = min.plus(this.extent.dividedBy(2));
+			setMin(newLowerLeft);
+			setMax(newUpperRight);
+			setCenter(min);
+		}
+		// two parameters (lower left and upper right ( = extent))
+		else {
+			setMin(min);
+			setMax(max);
+			setExtent(max.minus(min));
+			setCenter((min.plus(max)).dividedBy(2));
+		}
+	};
+
+	this.toString = function () {
+		return this.min.x + "," + this.min.y + "," + this.max.x + "," + this.max.y;
+	};
+	
+	var isPoint = function (param) {
+		if (typeof param === "object" && param.constructor === Point) {
+			return true;
+		}
+		return false;
+	};
+	
+	if (isPoint(minx) && isPoint(miny) && 
+		typeof maxx === "undefined" && 
+		typeof maxy === "undefined") {
+
+		// input is "point, point"
+		this.set(minx, miny);
+	}
+	else {
+		// input is "coordinate, coordinate, coordinate, coordinate"
+		// deprecated
+		this.set(
+			new Point(parseFloat(minx), parseFloat(miny)),
+			new Point(parseFloat(maxx), parseFloat(maxy))
+		);
+	}
 	return this;
 }
 
@@ -147,7 +214,7 @@
 				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 += "BBOX="+mb_mapObj[i].extent.toString()+"&";
 				requestParams += "WIDTH="+mb_mapObj[i].width+"&";
 				requestParams += "HEIGHT="+mb_mapObj[i].height+"&";
 				requestParams += "LAYERS="+mb_mapObj[i].layers[ii]+"&";
@@ -364,7 +431,7 @@
 function mb_repaint(frameName,minx,miny,maxx,maxy){
 	new Mb_warning("The function mb_repaint is deprecated.");
 	var ind = getMapObjIndexByName(frameName);
-	mb_mapObj[ind].extent = minx + "," + miny + "," + maxx + "," + maxy;
+	mb_mapObj[ind].extent = new Extent(minx, miny, maxx, maxy);
 	setMapRequest(frameName);
 }
 
@@ -388,4 +455,4 @@
   var map = getMapObjByName(frameName);
   var extent = new Extent(minx,miny,maxx,maxy);
   map.calculateExtent(extent);
-}
\ No newline at end of file
+}

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/map_obj.js	2009-06-30 15:13:45 UTC (rev 4265)
@@ -274,7 +274,6 @@
 		}
 	}
 	var wmsExtent = new Extent(bbox_minx, bbox_miny, bbox_maxx, bbox_maxy);
-	
 	this.calculateExtent(wmsExtent);
 
 	this.mapURL = [];
@@ -292,7 +291,7 @@
 	 * @type string
 	 */
 	this.getExtent = function(){
-		return this.extent;
+		return this.extent.toString();
 	};
 	
 	/**
@@ -302,7 +301,7 @@
 	 * @type Object
 	 */
 	this.getExtentInfos = function(){
-		var c = this.getExtent().split(",");
+		var c = this.extent.toString().split(",");
 		var ext = new Extent(c[0], c[1], c[2], c[3]);
 		return ext;
 	};
@@ -351,7 +350,7 @@
 	 * @param {Object} direction
 	 */
 	this.pan = function (direction) {
-		var arrayBBox = this.extent.split(",");
+		var arrayBBox = this.extent.toString().split(",");
 		var minx = parseFloat(arrayBBox[0]);
 		var miny = parseFloat(arrayBBox[1]);
 		var maxx = parseFloat(arrayBBox[2]);
@@ -402,9 +401,8 @@
 				maxx -= (xtentx * factor);
 				break;
 		}
-		this.extent = minx + "," + miny + "," + maxx + "," + maxy;
-		
-		this.restrictedExtent;
+		this.setExtent(minx, miny, maxx, maxy);
+//		this.restrictedExtent;
 		this.setMapRequest();
 		
 	};
@@ -425,7 +423,7 @@
 	
 					var wmsExtent = new Extent(bbox_minx, bbox_miny, bbox_maxx, bbox_maxy);
 					var newExtent = this.calculateExtent(wmsExtent);
-					this.repaint(new Point(newExtent.minx, newExtent.miny), new Point(newExtent.maxx, newExtent.maxy));
+					this.repaint(newExtent.min, newExtent.max);
 					break;
 				}
 			}
@@ -492,7 +490,6 @@
 		*/
 		
 		this.setExtent(minx, miny, maxx, maxy);
-
 		this.setMapRequest();
 	};
 	
@@ -506,7 +503,7 @@
 	};
 	
 	this.convertPixelToReal = function (aPoint) {
-		var arrayBBox = this.extent.split(",");
+		var arrayBBox = this.extent.toString().split(",");
 		var minX = parseFloat(arrayBBox[0]);
 		var minY = parseFloat(arrayBBox[1]);
 		var maxX = parseFloat(arrayBBox[2]);
@@ -540,7 +537,7 @@
 	 * Convert real world coordinates to pixel coordinates
 	 */
 	this.convertRealToPixel = function (aPoint) {
-		var arrayBBox = this.extent.split(",");
+		var arrayBBox = this.extent.toString().split(",");
 		var minX = parseFloat(arrayBBox[0]);
 		var minY = parseFloat(arrayBBox[1]);
 		var maxX = parseFloat(arrayBBox[2]);
@@ -617,7 +614,7 @@
 		}
 		url += "&";
 		url += "SRS=" + this.epsg + "&";
-		url += "BBOX=" + this.extent + "&";
+		url += "BBOX=" + this.extent.toString() + "&";
 		url += "WIDTH=" + this.width + "&";
 		url += "HEIGHT=" + this.height + "&";
 		url += "FORMAT=" + currentWms.gui_wms_mapformat + "&";
@@ -697,7 +694,7 @@
 	 */
 	this.getScale = function(){
 		var scale;
-		var bbox = this.extent.split(",");
+		var bbox = this.extent.toString().split(",");
 		var xtenty;
 		if (this.epsg == "EPSG:4326") {
 			var pxLenx = (parseFloat(bbox[2]) - parseFloat(bbox[0])) / this.width;
@@ -755,7 +752,7 @@
 	
 	this.repaintScale = function(x, y, scale){
 		if (x === null && y === null) {
-			var arrayBBox = this.extent.split(",");
+			var arrayBBox = this.extent.toString().split(",");
 			x = parseFloat(arrayBBox[0]) +
 			((parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0])) /
 			2);
@@ -771,7 +768,9 @@
 	};
 	
 	this.repaint = function(min, max){
-		this.extent = min.x + "," + min.y + "," + max.x + "," + max.y;
+		if (typeof min !== "undefined" && typeof max !== "undefined") {
+			this.extent = new Extent(min, max);
+		}
 		this.setMapRequest();
 	};
 	
@@ -808,7 +807,7 @@
 		this.mb_MapFutureObj[cnt].width = this.width;
 		this.mb_MapFutureObj[cnt].height = this.height;
 		this.mb_MapFutureObj[cnt].epsg = this.epsg;
-		this.mb_MapFutureObj[cnt].extent = this.extent;
+		this.mb_MapFutureObj[cnt].extent = this.extent.toString();
 		this.mb_MapFutureObj[cnt].layers = [];
 		
 		for(var i=0; i<this.layers.length;i++){
@@ -1035,6 +1034,13 @@
 		return new Point(clickX, clickY);
 	}
 
+	/**
+	 * Triggered after the map has been resized
+	 */
+	this.eventResizeMap = new MapbenderEvent();
+
+
+
 	eventAfterMapObjectConstruction.trigger();
 }
 
@@ -1061,4 +1067,4 @@
 		}
 	}
 	return js_wfs_conf_id;
-};
\ No newline at end of file
+};

Modified: trunk/mapbender/http/javascripts/mod_changeEPSG.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_changeEPSG.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_changeEPSG.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -39,7 +39,7 @@
 		var currentSrs = {
 			"frameName" : mb_mapObj[i].elementName,
 			"epsg" : mb_mapObj[i].epsg,
-			"extent" : mb_mapObj[i].extent,
+			"extent" : mb_mapObj[i].extent.toString(),
 			"width" : mb_mapObj[i].width,
 			"height" : mb_mapObj[i].height
 		};
@@ -80,16 +80,24 @@
 					}
 					else{
 						map.epsg = newExtent[i].newSrs;
-						map.extent = parseFloat(newExtent[i].minx) + "," + parseFloat(newExtent[i].miny) + "," + 
-							parseFloat(newExtent[i].maxx) + "," + parseFloat(newExtent[i].maxy);
+						map.extent = new Extent(
+							parseFloat(newExtent[i].minx), 
+							parseFloat(newExtent[i].miny),
+							parseFloat(newExtent[i].maxx), 
+							parseFloat(newExtent[i].maxy)
+						);
 						map.setMapRequest();
 					}
 				}
 				else {
 					var map = Mapbender.modules[newExtent[i].frameName];
 					map.epsg = newExtent[i].newSrs;
-					map.extent = parseFloat(newExtent[i].minx) + "," + parseFloat(newExtent[i].miny) + "," + 
-						parseFloat(newExtent[i].maxx) + "," + parseFloat(newExtent[i].maxy);
+					map.extent = new Extent(
+						parseFloat(newExtent[i].minx),
+						parseFloat(newExtent[i].miny), 
+						parseFloat(newExtent[i].maxx),
+						parseFloat(newExtent[i].maxy)
+					);
 					map.setMapRequest();
 				}
 			}

Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -1051,7 +1051,7 @@
 	var mapObj = parent.mb_mapObj[parent.getMapObjIndexByName(mod_digitize_target)];
 	var width = mapObj.width;
 	var height = mapObj.height;
-	var arrayBBox = mapObj.extent.split(",")
+	var arrayBBox = mapObj.extent.toString().split(",")
 	var minX = parseFloat(arrayBBox[0]);
 	var minY = parseFloat(arrayBBox[1]);
 	var maxX = parseFloat(arrayBBox[2]);

Modified: trunk/mapbender/http/javascripts/mod_dragMapSize.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_dragMapSize.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_dragMapSize.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -108,7 +108,7 @@
 	targetObject.setWidth(targetObject.getWidth() + parseFloat(dif_x));
 	targetObject.setHeight(targetObject.getHeight() + parseFloat(dif_y));
 
-	var mybbox = targetObject.extent.split(",");
+	var mybbox = targetObject.extent.toString().split(",");
 	targetObject.setExtent(mybbox[0], pos[1], pos[0], mybbox[3]);
 	targetObject.setMapRequest();
 	eventResizeMap.trigger();

Modified: trunk/mapbender/http/javascripts/mod_dynamicOverview.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_dynamicOverview.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_dynamicOverview.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -84,7 +84,7 @@
 	if (map.elementName == map0.elementName) {
 
 		// get center in coords:
-		var coords = map0.extent.split(",");
+		var coords = map0.extent.toString().split(",");
 		var minx = parseFloat(coords[0]);
 		var miny = parseFloat(coords[1]);
 		var maxx = parseFloat(coords[2]);

Modified: trunk/mapbender/http/javascripts/mod_export_image.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_export_image.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_export_image.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -111,7 +111,7 @@
 
 	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 coord = window.opener.mb_mapObj[ind].extent.toString().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"){
@@ -158,7 +158,12 @@
 		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.mb_mapObj[ind].extent = new window.opener.Extent(
+			coord[0],
+			pos[1],
+			pos[0],
+			coord[3]
+		);
 		window.opener.setMapRequest(mod_print1_target);
 	}
 }
@@ -180,7 +185,7 @@
 			cnt_urls++;
 		}
 	}
-	document.form1.map_extent.value = window.opener.mb_mapObj[ind].extent;
+	document.form1.map_extent.value = window.opener.mb_mapObj[ind].extent.toString();
 	document.form1.map_scale.value = window.opener.mb_getScale(mod_print1_target);
 }
 function printMap(){

Modified: trunk/mapbender/http/javascripts/mod_print1.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_print1.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_print1.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -110,7 +110,7 @@
 
 	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 coord = window.opener.mb_mapObj[ind].extent.toString().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"){
@@ -157,7 +157,12 @@
 		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.mb_mapObj[ind].extent = new window.opener.Extent(
+			coord[0],
+			pos[1],
+			pos[0],
+			coord[3]
+		);
 		window.opener.setMapRequest(mod_print1_target);
 	}
 }
@@ -180,7 +185,7 @@
 			cnt_urls++;
 		}
 	}
-	document.form1.map_extent.value = window.opener.mb_mapObj[ind].extent;
+	document.form1.map_extent.value = window.opener.mb_mapObj[ind].extent.toString();
 	document.form1.map_scale.value = window.opener.mb_getScale(mod_print1_target);
 }
 function printMap(){

Modified: trunk/mapbender/http/javascripts/mod_resize_mapsize.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_resize_mapsize.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_resize_mapsize.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -90,7 +90,7 @@
 	var ind = getMapObjIndexByName("<?php  echo $e_target;  ?>");
 	var mapheight = frameHeight() - <?php echo $e_top ?> + parseInt(adjust_height);
 	var mapwidth = frameWidth() - map_frame_left - legend_width + parseInt(adjust_width) ;
-	var coords = mb_mapObj[ind].extent.split(",");
+	var coords = mb_mapObj[ind].extent.toString().split(",");
 	midcoordx=parseFloat((parseFloat(coords[2])-parseFloat(coords[0]))/2)+parseFloat(coords[0]);
 	midcoordy=parseFloat((parseFloat(coords[3])-parseFloat(coords[1]))/2)+parseFloat(coords[1]);
 	mb_mapObj[ind].setWidth(mapwidth);

Modified: trunk/mapbender/http/javascripts/mod_scaleHint.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_scaleHint.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_scaleHint.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -41,14 +41,19 @@
 				var newScale = mod_scaleHint_max;
 			}
 			var ind = getMapObjIndexByName(frameName);
-			var arrayBBox = mb_mapObj[ind].extent.split(",");
+			var arrayBBox = mb_mapObj[ind].extent.toString().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;
+			mb_mapObj[ind].extent = new Extent(
+				minx,
+				miny,
+				maxx,
+				maxy
+			);
 		}
 	}
 	return true;

Modified: trunk/mapbender/http/javascripts/mod_scaleText.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_scaleText.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_scaleText.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -31,7 +31,7 @@
 		return;
 	}   
 	var ind = getMapObjIndexByName(frameName);
-	var arrayBBox = mb_mapObj[ind].extent.split(",");
+	var arrayBBox = mb_mapObj[ind].extent.toString().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);
 
@@ -39,7 +39,12 @@
 	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;
+	mb_mapObj[ind].extent = new Extent(
+		minx,
+		miny,
+		maxx,
+		maxy
+	);
 	setMapRequest(frameName);
 	scale.value = "";
 }

Modified: trunk/mapbender/http/javascripts/mod_selectMapsize.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_selectMapsize.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_selectMapsize.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -27,8 +27,13 @@
 	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]; 
+	var coords = mb_mapObj[ind].extent.toString().split(",");
+	mb_mapObj[ind].extent = new 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;

Modified: trunk/mapbender/http/javascripts/mod_usemap.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_usemap.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/mod_usemap.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -28,7 +28,7 @@
 
 function mod_usemap_init(){
 	var ind = getMapObjIndexByName(mod_usemap_target);
-	var extent = mb_mapObj[ind].extent;
+	var extent = mb_mapObj[ind].extent.toString();
 	var url = "../php/mod_usemap.php?url="
 	url += escape(mod_usemap_wfs + "&BBOX=" + extent);
 	url += "&extent=" + extent;

Modified: trunk/mapbender/http/javascripts/ovnf.php
===================================================================
--- trunk/mapbender/http/javascripts/ovnf.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/javascripts/ovnf.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -61,7 +61,7 @@
 	if (!targetMapObj) {
 		return;
 	}
-	var arrayBBox = targetMapObj.extent.split(",");
+	var arrayBBox = targetMapObj.extent.toString().split(",");
 	var minX = parseFloat(arrayBBox[0]);
 	var minY = parseFloat(arrayBBox[1]);
 	var maxX = parseFloat(arrayBBox[2]);

Modified: trunk/mapbender/http/php/mod_changeEPSG_dynamic.php
===================================================================
--- trunk/mapbender/http/php/mod_changeEPSG_dynamic.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/php/mod_changeEPSG_dynamic.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -188,14 +188,24 @@
 				}
 				else{
 					parent.mb_mapObj[ind].epsg = temp[1];
-					parent.mb_mapObj[ind].extent = parseFloat(temp[2]) + "," + parseFloat(temp[3]) + "," + parseFloat(temp[4]) + "," + parseFloat(temp[5]);
+					parent.mb_mapObj[ind].extent = new parent.Extent(
+						parseFloat(temp[2]),
+						parseFloat(temp[3]),
+						parseFloat(temp[4]),
+						parseFloat(temp[5])
+					);
 					parent.setMapRequest(temp[0]);
 				}
 			}
 			if(temp[0] != myTarget){
 				var ind = parent.getMapObjIndexByName(temp[0]);
 				parent.mb_mapObj[ind].epsg = temp[1];
-				parent.mb_mapObj[ind].extent = parseFloat(temp[2]) + "," + parseFloat(temp[3]) + "," + parseFloat(temp[4]) + "," + parseFloat(temp[5]);
+				parent.mb_mapObj[ind].extent = new parent.Extent(
+					parseFloat(temp[2]),
+					parseFloat(temp[3]),
+					parseFloat(temp[4]),
+					parseFloat(temp[5])
+				);
 				parent.setMapRequest(temp[0]);
 			}
 		}
@@ -215,7 +225,7 @@
 	str_srs = "";
 	for(var i=0; i<parent.mb_mapObj.length; i++){
 	if(i>0){str_srs += "###";}
-		str_srs += parent.mb_mapObj[i].frameName + "," + parent.mb_mapObj[i].epsg + "," + parent.mb_mapObj[i].extent + ","+parent.mb_mapObj[i].width+","+parent.mb_mapObj[i].height;
+		str_srs += parent.mb_mapObj[i].frameName + "," + parent.mb_mapObj[i].epsg + "," + parent.mb_mapObj[i].extent.toString() + ","+parent.mb_mapObj[i].width+","+parent.mb_mapObj[i].height;
 	}
 	document.forms[0].srs.value = str_srs;
 	var ind = document.forms[0].epsg.selectedIndex;

Modified: trunk/mapbender/http/php/mod_mapOV.php
===================================================================
--- trunk/mapbender/http/php/mod_mapOV.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/php/mod_mapOV.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -85,7 +85,7 @@
 function mod_ov_showMapExtent(){
 	for(var i=0; i<parent.mb_mapObj.length; i++){
 		if(parent.mb_mapObj[i].frameName == mod_overview_target){
-			var arrayBBox = parent.mb_mapObj[i].extent.split(",");
+			var arrayBBox = parent.mb_mapObj[i].extent.toString().split(",");
 			var minX = parseFloat(arrayBBox[0]);
 			var minY = parseFloat(arrayBBox[1]);
 			var maxX = parseFloat(arrayBBox[2]);

Modified: trunk/mapbender/http/php/mod_meetingPoint.php
===================================================================
--- trunk/mapbender/http/php/mod_meetingPoint.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/php/mod_meetingPoint.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -264,7 +264,7 @@
     	my_meetingPoint += "&mb_user_myGui=" + encodeURIComponent(document.forms[0].mygui.value);
     	
     	var ind = parent.getMapObjIndexByName('mapframe1');
-    	var coord = parent.mb_mapObj[ind].extent.split(",");
+    	var coord = parent.mb_mapObj[ind].extent.toString().split(",");
     	
     	my_meetingPoint += "&mb_myBBOX=" + parseFloat(coord[0]) + ",";
 		my_meetingPoint +=  parseFloat(coord[1]) + ",";

Modified: trunk/mapbender/http/print/mod_printPDF.php
===================================================================
--- trunk/mapbender/http/print/mod_printPDF.php	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/http/print/mod_printPDF.php	2009-06-30 15:13:45 UTC (rev 4265)
@@ -140,7 +140,7 @@
 		if(size != "false" && format != "false"){
 			var ind = pt.getMapObjIndexByName(target);
 			var map_el = pt.mb_mapObj[ind].getDomElement();
-			var coord = pt.mb_mapObj[ind].extent.split(",");
+			var coord = pt.mb_mapObj[ind].extent.toString().split(",");
 			var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
 			var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
 			if(size == "A4" && format == "portrait"){
@@ -185,7 +185,12 @@
 			}
 			var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
 			var prevscale= pt.mb_getScale(target);
-			pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
+			pt.mb_mapObj[ind].extent = new pt.Extent(
+				coord[0],
+				pos[1],
+				pos[0],
+				coord[3]
+			);
 
 			pt.mb_mapObj[ind].width = Math.round(map_width);
 			pt.mb_mapObj[ind].height = Math.round(map_height);
@@ -224,12 +229,17 @@
 		if(size != "" && format != ""){
 			var ind = pt.getMapObjIndexByName(target);
 			var map_el = pt.mb_mapObj[ind].getDomElement();
-			var coord = pt.mb_mapObj[ind].extent.split(",");
+			var coord = pt.mb_mapObj[ind].extent.toString().split(",");
 			var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
 			var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
 			
 			var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
-			pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
+			pt.mb_mapObj[ind].extent = new pt.Extent(
+				coord[0],
+				pos[1],
+				pos[0],
+				coord[3]
+			);
 	
 			pt.mb_mapObj[ind].width = Math.round(map_width);
 			pt.mb_mapObj[ind].height = Math.round(map_height);

Modified: trunk/mapbender/lib/point.js
===================================================================
--- trunk/mapbender/lib/point.js	2009-06-30 14:09:47 UTC (rev 4264)
+++ trunk/mapbender/lib/point.js	2009-06-30 15:13:45 UTC (rev 4265)
@@ -162,7 +162,12 @@
 		new_min = new Point(min.x, center.y - relation_px_y * extent.x / 2);
 		new_max = new Point(max.x, center.y + relation_px_y * extent.x / 2);
 	}
-	mb_mapObj[ind].extent = new_min.x +","+ new_min.y +","+ new_max.x  +","+ new_max.y;
+	mb_mapObj[ind].extent = new Extent(
+		new_min.x,
+		new_min.y,
+		new_max.x,
+		new_max.y
+	);
 }
 /**
  * @ignore



More information about the Mapbender_commits mailing list