           return loc
     return null
 
+  locCenterOnMap: (loc) ->
+    [centerX, centerY, k] = [0, 0, 0]
+    for poly in geodata.locations[loc].paths
+      for idx in [1..poly.length]
+        [x, y] = @ecef2ortho(geodata.points[poly[idx % poly.length]]...)
+        [centerX, centerY] = [centerX + x, centerY + y]
+        k++
+    return [centerX/k, centerY/k]
+
   fetchNowcast: (loc) ->
     @chartData = null
     callback = (epidata) => @onNowcastReceived(epidata)

    }
    @ecef2ortho = get_ecef2ortho(@dlat, @dlon, @zoom, w, h)
    for loc in @locations
      #ctx.fillStyle = '#' + ('00000' + Math.floor(Math.random() * 0x1000000).toString(16)).slice(-6)
      for poly in geodata.locations[loc].paths
        ctx.beginPath()
        ln = 0

  return (x, y, z) -> [w2 + x * a + y * b, h2 + x * d + y * e + z * f]

#Pre-process geodata
# Move Hawaii and Alaska closer to Mainland, also shrink Alaska
indexes = []
for poly in geodata.locations['HI'].paths
