From 660845f5b85a47c4546abe8c2cf54d2be95be912 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Mon, 30 Mar 2020 23:17:52 +0100 Subject: [PATCH] Include center at right edge in calculations --- src/ol/extent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/extent.js b/src/ol/extent.js index ef969a196a..c68f9c9ff9 100644 --- a/src/ol/extent.js +++ b/src/ol/extent.js @@ -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);