Include center at right edge in calculations
This commit is contained in:
committed by
Andreas Hocevar
parent
098885a006
commit
660845f5b8
@@ -826,7 +826,7 @@ export function applyTransform(extent, transformFn, opt_extent, opt_stops) {
|
||||
export function wrapX(extent, projection) {
|
||||
const projectionExtent = projection.getExtent();
|
||||
const center = getCenter(extent);
|
||||
if (projection.canWrapX() && (center[0] < projectionExtent[0] || center[0] > projectionExtent[2])) {
|
||||
if (projection.canWrapX() && (center[0] < projectionExtent[0] || center[0] >= projectionExtent[2])) {
|
||||
const worldWidth = getWidth(projectionExtent);
|
||||
const worldsAway = Math.floor((center[0] - projectionExtent[0]) / worldWidth);
|
||||
const offset = (worldsAway * worldWidth);
|
||||
|
||||
Reference in New Issue
Block a user