From 9d68fb75268de416fd0f754ded9387b62781ca37 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 31 Oct 2022 14:37:27 -0400 Subject: [PATCH] fix: Rotate coordinates for Mapbox GL --- lib/__snapshots__/index.test.ts.snap | 16 ++++++++-------- lib/kml/ground_overlay.ts | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/__snapshots__/index.test.ts.snap b/lib/__snapshots__/index.test.ts.snap index bf22c70..325e2be 100644 --- a/lib/__snapshots__/index.test.ts.snap +++ b/lib/__snapshots__/index.test.ts.snap @@ -12772,10 +12772,6 @@ Object { "geometry": Object { "coordinates": Array [ Array [ - Array [ - 14.60190128636069, - 37.464406338104496, - ], Array [ 14.600668902543442, 37.91801270483731, @@ -12792,6 +12788,10 @@ Object { 14.60190128636069, 37.464406338104496, ], + Array [ + 14.600668902543442, + 37.91801270483731, + ], ], ], "type": "Polygon", @@ -12819,10 +12819,6 @@ Object { "geometry": Object { "coordinates": Array [ Array [ - Array [ - 14.60190128636069, - 37.464406338104496, - ], Array [ 14.600668902543442, 37.91801270483731, @@ -12839,6 +12835,10 @@ Object { 14.60190128636069, 37.464406338104496, ], + Array [ + 14.600668902543442, + 37.91801270483731, + ], ], ], "type": "Polygon", diff --git a/lib/kml/ground_overlay.ts b/lib/kml/ground_overlay.ts index 1f0ca71..654faf8 100644 --- a/lib/kml/ground_overlay.ts +++ b/lib/kml/ground_overlay.ts @@ -69,11 +69,11 @@ function getLatLonBox(node: Element): Polygon | null { const bbox: BBox = [west, south, east, north]; let coordinates = [ [ - [west, south], // bottom left [west, north], // top left [east, north], // top right [east, south], // top right [west, south], // bottom left (again) + [west, north], // top left ], ]; if (typeof rotation === "number") {