Optimizing positions for rendering
Calculating pixel positions from origin and grid index causes alignment issues in the grid. By going back to incremental positioning, we get a result without blank spaces between tiles again.
This commit is contained in:
@@ -217,8 +217,8 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
if (this.layer instanceof OpenLayers.Layer.Grid) {
|
||||
ratio = this.layer.getServerResolution() / this.layer.map.getResolution();
|
||||
}
|
||||
style.left = (this.position.x | 0) + "px";
|
||||
style.top = (this.position.y | 0) + "px";
|
||||
style.left = this.position.x + "px";
|
||||
style.top = this.position.y + "px";
|
||||
style.width = Math.round(ratio * size.w) + "px";
|
||||
style.height = Math.round(ratio * size.h) + "px";
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user