Making dateline handling work with ratio.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -498,8 +498,9 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
var coordSysUnchanged = OpenLayers.Renderer.prototype.setExtent.apply(this, arguments);
|
||||
var resolution = this.getResolution();
|
||||
if (this.map.baseLayer && this.map.baseLayer.wrapDateLine) {
|
||||
coordSysUnchanged = this.featureDx === 0;
|
||||
var rightOfDateLine,
|
||||
ratio = extent.getWidth() / this.map.getExtent().getWidth(),
|
||||
extent = extent.scale(1 / ratio),
|
||||
world = this.map.getMaxExtent();
|
||||
if (world.right > extent.left && world.right < extent.right) {
|
||||
rightOfDateLine = true;
|
||||
|
||||
@@ -614,6 +614,9 @@
|
||||
getMaxExtent: function() {
|
||||
return new OpenLayers.Bounds(-180,-90,180,90);
|
||||
},
|
||||
getExtent: function() {
|
||||
return r.extent;
|
||||
},
|
||||
getResolution: function() {
|
||||
return resolution;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user