From ee57b197e5f95155a867eb9a83c4511f2c7da474 Mon Sep 17 00:00:00 2001 From: Roman Zoller Date: Tue, 5 Feb 2019 17:44:46 +0100 Subject: [PATCH] Fix offset passed from linearRingssAreOriented to linearRingsAreOriented The offset needs to be set to the end of the previous Polygon, see `offset = orientLinearRings(...)` in function orientLinearRingsArray Fixes #9189 --- src/ol/geom/flat/orient.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ol/geom/flat/orient.js b/src/ol/geom/flat/orient.js index 80ec9ab611..8eb9dd1ab5 100644 --- a/src/ol/geom/flat/orient.js +++ b/src/ol/geom/flat/orient.js @@ -77,10 +77,14 @@ export function linearRingsAreOriented(flatCoordinates, offset, ends, stride, op */ export function linearRingssAreOriented(flatCoordinates, offset, endss, stride, opt_right) { for (let i = 0, ii = endss.length; i < ii; ++i) { + const ends = endss[i]; if (!linearRingsAreOriented( - flatCoordinates, offset, endss[i], stride, opt_right)) { + flatCoordinates, offset, ends, stride, opt_right)) { return false; } + if (ends.length) { + offset = ends[ends.length - 1]; + } } return true; }