From 687d21e7d1fb0b817abe37c26ef03d6645b72f44 Mon Sep 17 00:00:00 2001 From: Asheshp23 Date: Mon, 7 Nov 2022 13:57:00 -0500 Subject: [PATCH] updated offsetting the bounds method --- Sources/GeoJSONSwiftHelper/GeoJSONSwiftHelper.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Sources/GeoJSONSwiftHelper/GeoJSONSwiftHelper.swift b/Sources/GeoJSONSwiftHelper/GeoJSONSwiftHelper.swift index f025f89..ced2322 100644 --- a/Sources/GeoJSONSwiftHelper/GeoJSONSwiftHelper.swift +++ b/Sources/GeoJSONSwiftHelper/GeoJSONSwiftHelper.swift @@ -143,11 +143,15 @@ extension GeoJSONObject { } let maxNE = - CLLocationCoordinate2D(latitude: maxN + leftoffset, - longitude: maxE + topOffset) + CLLocationCoordinate2D(latitude: maxN, + longitude: maxE) + .movedBy(latitudinalMeters: topOffset, + longitudinalMeters: leftoffset) let maxSW = - CLLocationCoordinate2D(latitude: maxS + rightOffset, - longitude: maxW + bottomOffset) + CLLocationCoordinate2D(latitude: maxS, + longitude: maxW) + .movedBy(latitudinalMeters: bottomOffset, + longitudinalMeters: rightOffset) let bounds = CoordinateBounds(southwest: maxSW, northeast: maxNE) return bounds