[Mapbender-commits] r5331 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jan 14 08:57:12 EST 2010
Author: christoph
Date: 2010-01-14 08:57:11 -0500 (Thu, 14 Jan 2010)
New Revision: 5331
Modified:
trunk/mapbender/http/javascripts/map_obj.js
trunk/mapbender/http/javascripts/mod_repaint.js
Log:
Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js 2010-01-14 13:09:58 UTC (rev 5330)
+++ trunk/mapbender/http/javascripts/map_obj.js 2010-01-14 13:57:11 UTC (rev 5331)
@@ -23,6 +23,7 @@
var mapMsgObj;
+ var extentHasChanged = false;
eventLocalize.register(function(){
localizeMap();
@@ -34,7 +35,7 @@
var localizeMap = function(){
$.post("../php/mod_map_messages.php", function(obj, status){
- mapMsgObj = eval('(' + obj + ')');
+ mapMsgObj = $.parseJSON(obj);
});
};
@@ -62,14 +63,15 @@
this.oldExtent = new Extent(this.extent);
// pixel coordinates of new extent in old extent
- if (arguments.length === 1) {
- var oldpixll = this.convertRealToPixel(minx.min);
- var oldpixur = this.convertRealToPixel(minx.max);
+ var oldpixll, oldpixur;
+ if (arguments.length === 1) {
+ oldpixll = this.convertRealToPixel(minx.min);
+ oldpixur = this.convertRealToPixel(minx.max);
this.oldExtentPix = new Extent(oldpixll.x, oldpixll.y, oldpixur.x, oldpixur.y);
}
else if (arguments.length === 4) {
- var oldpixll = this.convertRealToPixel(new Point(parseFloat(minx), parseFloat(miny)));
- var oldpixur = this.convertRealToPixel(new Point(parseFloat(maxx), parseFloat(maxy)));
+ oldpixll = this.convertRealToPixel(new Point(parseFloat(minx), parseFloat(miny)));
+ oldpixur = this.convertRealToPixel(new Point(parseFloat(maxx), parseFloat(maxy)));
this.oldExtentPix = new Extent(oldpixll.x, oldpixll.y, oldpixur.x, oldpixur.y);
}
@@ -90,6 +92,7 @@
this.extent.set(new Point(arguments[0], arguments[1]), new Point(arguments[2], arguments[3]));
}
}
+ extentHasChanged = true;
};
/*
@@ -1150,7 +1153,7 @@
// show new map
//
- if (doAnimation) {
+ if (doAnimation && extentHasChanged) {
var previousRequest = $("#" + that.elementName + "_request_" + (index-1));
var wasPanned = parseInt(previousRequest.css("top"), 10) !== 0 ||
parseInt(previousRequest.css("left"), 10) !== 0;
@@ -1317,6 +1320,7 @@
})();
this.history.forward(false);
+ extentHasChanged = false;
};
var getLayerHtmlCode = function(ii, extent, width, height, top, left, requestCnt){
Modified: trunk/mapbender/http/javascripts/mod_repaint.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_repaint.js 2010-01-14 13:09:58 UTC (rev 5330)
+++ trunk/mapbender/http/javascripts/mod_repaint.js 2010-01-14 13:57:11 UTC (rev 5331)
@@ -36,7 +36,7 @@
if (!Mapbender.modules[options.target]) {
return;
}
- Mapbender.modules[options.target].zoom(true, 0.999);
+ Mapbender.modules[options.target].setMapRequest();
}).mouseover(function () {
if (options.src) {
this.src = options.src.replace(/_off/, "_over");
More information about the Mapbender_commits
mailing list