Skip to content

Commit de052e6

Browse files
committed
requesting BBox with 7 digits of location values.
1 parent 177e0f9 commit de052e6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

GoInfoGame/GoInfoGame/Helpers/Extensions.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,9 @@ extension Publishers {
186186
.eraseToAnyPublisher()
187187
}
188188
}
189+
190+
extension Double {
191+
func roundedTo7Digits() -> Double {
192+
(self * 1_000_0000).rounded() / 1_000_0000
193+
}
194+
}

GoInfoGame/GoInfoGame/Network/APIEndPoint.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct APIEndpoint {
4242
let header = [
4343
"X-Workspace": workspaceID
4444
]
45-
return APIEndpoint(path: "/map.json?bbox=\(left),\(bottom),\(right),\(top)", method: "GET", body: nil, headers: header, formData: nil) }
45+
return APIEndpoint(path: "/map.json?bbox=\(left.roundedTo7Digits()),\(bottom.roundedTo7Digits()),\(right.roundedTo7Digits()),\(top.roundedTo7Digits())", method: "GET", body: nil, headers: header, formData: nil) }
4646

4747
static let openChangesets = { (accessToken: String, workspaceId:String ,body: Data) in
4848

0 commit comments

Comments
 (0)