Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:GML2:readFlatCoordinates can return the format of (x,y) or (y,x) #15675

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/ol/format/GML2.js
Expand Up @@ -93,9 +93,18 @@
const y = parseFloat(coords[1]);
const z = coords.length === 3 ? parseFloat(coords[2]) : 0;
if (axisOrientation.substr(0, 2) === 'en') {
flatCoordinates.push(x, y, z);
if (coords.length === 3) {
flatCoordinates.push(x, y, z);
} else {
flatCoordinates.push(x, y);
}

Check failure on line 101 in src/ol/format/GML2.js

View workflow job for this annotation

GitHub Actions / Pre-Test

Delete `····⏎······`
ahocevar marked this conversation as resolved.
Show resolved Hide resolved
} else {
flatCoordinates.push(y, x, z);
if (coords.length === 3) {
flatCoordinates.push(y, x, z);
} else {
flatCoordinates.push(y, x);
}
}
}
return flatCoordinates;
Expand Down