Determine how many worlds away we are instead of simply wrapping.
This commit is contained in:
@@ -675,10 +675,11 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
this.featureDx = 0;
|
||||
if (worldBounds) {
|
||||
bounds = feature.geometry.getBounds();
|
||||
if (!(bounds.intersectsBounds(this.extent))) {
|
||||
var wrappedBounds = bounds.wrapDateLine(worldBounds);
|
||||
this.featureDx = bounds.left - wrappedBounds.left;
|
||||
}
|
||||
var worldWidth = worldBounds.getWidth();
|
||||
var rendererCenterX = (this.extent.left + this.extent.right) / 2;
|
||||
var featureCenterX = (bounds.left + bounds.right) / 2;
|
||||
var worldsAway = Math.round((featureCenterX - rendererCenterX) / worldWidth);
|
||||
this.featureDx = worldsAway * worldWidth;
|
||||
}
|
||||
|
||||
style = this.features[id][1];
|
||||
|
||||
Reference in New Issue
Block a user