[Mapbender-commits] r6771 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Aug 19 12:06:41 EDT 2010
Author: christoph
Date: 2010-08-19 16:06:41 +0000 (Thu, 19 Aug 2010)
New Revision: 6771
Modified:
trunk/mapbender/http/javascripts/mod_resize_mapsize.js
Log:
fixed weird bug, after window resize the map became very small
Modified: trunk/mapbender/http/javascripts/mod_resize_mapsize.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_resize_mapsize.js 2010-08-19 16:05:55 UTC (rev 6770)
+++ trunk/mapbender/http/javascripts/mod_resize_mapsize.js 2010-08-19 16:06:41 UTC (rev 6771)
@@ -78,6 +78,7 @@
var adjust_height = options.adjust_height;
var map;
+var mapExtent;
var map_frame = options.target;
var map_frame_left;
var map_frame_top;
@@ -99,24 +100,23 @@
function adjustDimension(skipMapRequest) {
var mapheight = frameHeight() - parseInt(map.getDomElement().style.top, 10) + adjust_height;
var mapwidth = frameWidth() - map_frame_left - legend_width + adjust_width;
- var coords = map.getExtent().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]);
map.setWidth(mapwidth);
map.setHeight(mapheight);
- var sw = map.convertPixelToReal(new Point(0, mapheight));
- var ne = map.convertPixelToReal(new Point(mapwidth, 0));
- map.calculateExtent(new Mapbender.Extent(sw, ne));
-// map.extent.set(new Point(midcoordx, midcoordy));
+ if (mapExtent !== undefined) {
+ map.calculateExtent(mapExtent);
+ }
if (!skipMapRequest) {
map.setMapRequest();
+ mapExtent = undefined;
}
}
function rebuild() {
+ if (mapExtent === undefined) {
+ mapExtent = map.extent;
+ }
+
setTimeout(function () {
// has to be called twice: the first request does a resize,
// which will remove potential scrollbars.
More information about the Mapbender_commits
mailing list