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;
|
this.featureDx = 0;
|
||||||
if (worldBounds) {
|
if (worldBounds) {
|
||||||
bounds = feature.geometry.getBounds();
|
bounds = feature.geometry.getBounds();
|
||||||
if (!(bounds.intersectsBounds(this.extent))) {
|
var worldWidth = worldBounds.getWidth();
|
||||||
var wrappedBounds = bounds.wrapDateLine(worldBounds);
|
var rendererCenterX = (this.extent.left + this.extent.right) / 2;
|
||||||
this.featureDx = bounds.left - wrappedBounds.left;
|
var featureCenterX = (bounds.left + bounds.right) / 2;
|
||||||
}
|
var worldsAway = Math.round((featureCenterX - rendererCenterX) / worldWidth);
|
||||||
|
this.featureDx = worldsAway * worldWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
style = this.features[id][1];
|
style = this.features[id][1];
|
||||||
|
|||||||
Reference in New Issue
Block a user