Include center at right edge in calculations

This commit is contained in:
mike-000
2020-03-30 23:17:52 +01:00
committed by Andreas Hocevar
parent 098885a006
commit 660845f5b8

View File

@@ -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);