Merge pull request #7111 from ahocevar/graticule-nowrap
Remove broken wrapX handling from ol.Graticule
This commit is contained in:
@@ -560,23 +560,6 @@ ol.Graticule.prototype.handlePostCompose_ = function(e) {
|
||||
this.updateProjectionInfo_(projection);
|
||||
}
|
||||
|
||||
//Fix the extent if wrapped.
|
||||
//(note: this is the same extent as vectorContext.extent_)
|
||||
var offsetX = 0;
|
||||
if (projection.canWrapX()) {
|
||||
var projectionExtent = projection.getExtent();
|
||||
var worldWidth = ol.extent.getWidth(projectionExtent);
|
||||
var x = frameState.focus[0];
|
||||
if (x < projectionExtent[0] || x > projectionExtent[2]) {
|
||||
var worldsAway = Math.ceil((projectionExtent[0] - x) / worldWidth);
|
||||
offsetX = worldWidth * worldsAway;
|
||||
extent = [
|
||||
extent[0] + offsetX, extent[1],
|
||||
extent[2] + offsetX, extent[3]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
this.createGraticule_(extent, center, resolution, squaredTolerance);
|
||||
|
||||
// Draw the lines
|
||||
|
||||
Reference in New Issue
Block a user