           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)

  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

        ctx.fillStyle = @colors?[loc] ? '#ccc'
        ctx.fill()
        ctx.stroke()
      ctx.font = 24 * Math.min(1, w / 3000) + 'px sans-serif'
      ctx.fillStyle = 'Cyan'
      ctx.fillText(loc, cX, cY)
    return 0

  renderChart: () ->
