world shifting for renderers
This commit is contained in:
@@ -188,9 +188,20 @@ OpenLayers.Renderer = OpenLayers.Class({
|
||||
}
|
||||
if (!bounds.intersectsBounds(this.extent, {worldBounds: worldBounds})) {
|
||||
style = {display: "none"};
|
||||
} else {
|
||||
this.featureDx = 0;
|
||||
if (worldBounds) {
|
||||
bounds = feature.geometry.getBounds();
|
||||
var worldWidth = worldBounds.getWidth(),
|
||||
rendererCenterX = (this.extent.left + this.extent.right) / 2,
|
||||
featureCenterX = (bounds.left + bounds.right) / 2,
|
||||
worldsAway = Math.round((featureCenterX - rendererCenterX) / worldWidth);
|
||||
this.featureDx = worldsAway * worldWidth;
|
||||
}
|
||||
}
|
||||
var rendered = this.drawGeometry(feature.geometry, style, feature.id);
|
||||
if(style.display != "none" && style.label && rendered !== false) {
|
||||
|
||||
var location = feature.geometry.getCentroid();
|
||||
if(style.labelXOffset || style.labelYOffset) {
|
||||
var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
|
||||
|
||||
Reference in New Issue
Block a user