Deal with initially having no work items

This commit is contained in:
John Lyon-Smith
2018-04-26 15:48:56 -07:00
parent 0a5677b59b
commit 5e5daa2e78
7 changed files with 1504 additions and 1464 deletions

View File

@@ -67,12 +67,12 @@ export const dotify = (s) => {
}
export const regionContainingPoints = (points, inset) => {
let minX,
maxX,
minY,
maxY
let minX, maxX, minY, maxY
if (!points) {
return null
}
// init first point
;((point) => {
minX = point.latitude
maxX = point.latitude
@@ -80,7 +80,6 @@ export const regionContainingPoints = (points, inset) => {
maxY = point.longitude
})(points[0])
// calculate rect
points.map((point) => {
minX = Math.min(minX, point.latitude)
maxX = Math.max(maxX, point.latitude)