[Mapbender-commits] r3870 - branches/pseudoSlippy/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Apr 10 07:33:07 EDT 2009
Author: christoph
Date: 2009-04-10 07:33:07 -0400 (Fri, 10 Apr 2009)
New Revision: 3870
Modified:
branches/pseudoSlippy/http/javascripts/mod_pan.php
Log:
Modified: branches/pseudoSlippy/http/javascripts/mod_pan.php
===================================================================
--- branches/pseudoSlippy/http/javascripts/mod_pan.php 2009-04-10 11:32:32 UTC (rev 3869)
+++ branches/pseudoSlippy/http/javascripts/mod_pan.php 2009-04-10 11:33:07 UTC (rev 3870)
@@ -90,23 +90,25 @@
var width = mod_pan_MapObj.width;
var height = mod_pan_MapObj.height;
- var el = mod_pan_MapObj.getDomElement();
- var center_x = (width / 2) - dif_x;
- var center_y = (height / 2) - dif_y;
- var real_center = mod_pan_MapObj.convertPixelToReal(new Point(center_x, center_y));
-
-// mb_arrangeElement(mod_pan_MapObj.frameName, mod_pan_target+"_maps", 0, 0);
-// for(var i=0; i<mb_PanSubElements.length; i++){
-// mb_arrangeElement(mod_pan_MapObj.frameName, mb_PanSubElements[i], 0, 0);
-// }
- mod_pan_MapObj.oldExtent = null;
- mod_pan_MapObj.zoom(false, 1.0, real_center.x, real_center.y);
+ var diff = new Point(-dif_x, -dif_y);
+ var max = new Point(width, height).plus(diff);
+
+
+ //calculate new extent
+ var p1 = mod_pan_MapObj.convertPixelToReal(new Point(diff.x, max.y));
+ var p2 = mod_pan_MapObj.convertPixelToReal(new Point(max.x, diff.y));
+
+ mod_pan_MapObj.setExtent(p1.x, p1.y, p2.x, p2.y);
+ mod_pan_MapObj.setMapRequest(true);
}
function mod_pan_move_map(){
var dif_x = mb_end_x - mb_start_x;
var dif_y = mb_end_y - mb_start_y;
- mb_arrangeElement(mod_pan_MapObj.frameName, mod_pan_target+"_maps", dif_x, dif_y);
+ mb_arrangeElement(mod_pan_MapObj.frameName, mod_pan_target+"_request_" + mod_pan_MapObj.requestCount, dif_x, dif_y);
+ if (mod_pan_MapObj.requestCount > 0) {
+ $("#" + mod_pan_target+"_request_" + (mod_pan_MapObj.requestCount - 1)).remove();
+ }
for(var i=0; i<mb_PanSubElements.length; i++){
mb_arrangeElement(mod_pan_MapObj.frameName, mb_PanSubElements[i], dif_x, dif_y);
}
More information about the Mapbender_commits
mailing list