Cross-dateline rendering fixed for SVG and added for VML renderer.
This commit is contained in:
@@ -458,6 +458,41 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
this.indexer.clear();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: setExtent
|
||||
* Set the visible part of the layer.
|
||||
*
|
||||
* Parameters:
|
||||
* extent - {<OpenLayers.Bounds>}
|
||||
* resolutionChanged - {Boolean}
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean} true to notify the layer that the new extent does not exceed
|
||||
* the coordinate range, and the features will not need to be redrawn.
|
||||
* False otherwise.
|
||||
*/
|
||||
setExtent: function(extent, resolutionChanged) {
|
||||
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,
|
||||
world = this.map.getMaxExtent();
|
||||
if (world.right > extent.left && world.right < extent.right) {
|
||||
rightOfDateLine = true;
|
||||
} else if (world.left > extent.left && world.left < extent.right) {
|
||||
rightOfDateLine = false;
|
||||
}
|
||||
if (rightOfDateLine !== this.rightOfDateLine || resolutionChanged) {
|
||||
coordSysUnchanged = false;
|
||||
this.xOffset = rightOfDateLine === true ?
|
||||
world.getWidth() / resolution : 0;
|
||||
}
|
||||
this.rightOfDateLine = rightOfDateLine;
|
||||
}
|
||||
return coordSysUnchanged;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: getNodeType
|
||||
|
||||
Reference in New Issue
Block a user