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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 3 10:07:01 EDT 2009


Author: marc
Date: 2009-09-03 10:07:01 -0400 (Thu, 03 Sep 2009)
New Revision: 4592

Modified:
   branches/2.6/http/javascripts/map_obj.js
   branches/2.6/http/javascripts/mod_resize_mapsize.php
Log:
http://trac.osgeo.org/mapbender/ticket/512

Modified: branches/2.6/http/javascripts/map_obj.js
===================================================================
--- branches/2.6/http/javascripts/map_obj.js	2009-09-03 14:02:10 UTC (rev 4591)
+++ branches/2.6/http/javascripts/map_obj.js	2009-09-03 14:07:01 UTC (rev 4592)
@@ -661,11 +661,12 @@
 	 * @return scale
 	 * @type integer
 	 */
-	this.getScale = function(){
+	this.getScale = function(skipEpsg4326){
 		var scale;
 		var bbox = this.extent.split(",");
 		var xtenty;
-		if (this.epsg == "EPSG:4326") {
+				
+		if (this.epsg == "EPSG:4326" && !skipEpsg4326) {
 			var pxLenx = (parseFloat(bbox[2]) - parseFloat(bbox[0])) / this.width;
 			var pxLeny = (parseFloat(bbox[3]) - parseFloat(bbox[1])) / this.height;
 			var lat_from = ((parseFloat(bbox[3]) - parseFloat(bbox[1]) / 2) * Math.PI) / 180;

Modified: branches/2.6/http/javascripts/mod_resize_mapsize.php
===================================================================
--- branches/2.6/http/javascripts/mod_resize_mapsize.php	2009-09-03 14:02:10 UTC (rev 4591)
+++ branches/2.6/http/javascripts/mod_resize_mapsize.php	2009-09-03 14:07:01 UTC (rev 4592)
@@ -86,7 +86,7 @@
     else return 0;
 }
 
-function adjustDimension(){
+function adjustDimension(skipMapRequest){
 	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) ;
@@ -94,9 +94,9 @@
 	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);
-	mb_mapObj[ind].setHeight(mapheight);
+	mb_mapObj[ind].setHeight(mapheight);
 	if (!skipMapRequest) {
-		mb_mapObj[ind].repaintScale(midcoordx,midcoordy,mb_mapObj[ind].getScale());
+		mb_mapObj[ind].repaintScale(midcoordx,midcoordy,mb_mapObj[ind].getScale("skipEpsg4326"));
 	}
 }
 



More information about the Mapbender_commits mailing list