Making dateline handling work with ratio.

This commit is contained in:
ahocevar
2011-12-28 20:14:39 +01:00
parent 1ce59a207d
commit cfe25feecf
3 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -139,7 +139,9 @@ OpenLayers.Renderer = OpenLayers.Class({
setExtent: function(extent, resolutionChanged) {
this.extent = extent.clone();
if (this.map.baseLayer && this.map.baseLayer.wrapDateLine) {
this.extent = extent.wrapDateLine(this.map.getMaxExtent());
var ratio = extent.getWidth() / this.map.getExtent().getWidth(),
extent = extent.scale(1 / ratio);
this.extent = extent.wrapDateLine(this.map.getMaxExtent()).scale(ratio);
}
if (resolutionChanged) {
this.resolution = null;