(field: Field)
| 59 | }; |
| 60 | |
| 61 | function getFieldCenter(field: Field) { |
| 62 | const coords = field.coordinates[0]; |
| 63 | const lat = coords.reduce((sum, c) => sum + c[1], 0) / coords.length; |
| 64 | const lng = coords.reduce((sum, c) => sum + c[0], 0) / coords.length; |
| 65 | return { lat, lng }; |
| 66 | } |
| 67 | |
| 68 | const GEE_ANALYTICS_CACHE_KEY = "gee-analytics-cache"; |
| 69 | const QUERY_CACHE_TTL_MS = 60 * 60 * 1000; |