chingu-voyages / v48-tier3-team-21

A virtual Dino world, where you can explore various types of dinosaurs from different eras and regions. This project is mainly a Next.js build | Voyage-48 | Tier 3 | Team 21 | https://chingu.io | Twitter: https://twitter.com/ChinguCollabs
https://digging-into-dinosaurs.vercel.app/?decade=all-dinos
1 stars 2 forks source link

added functions for fetchDinoData, and getDigSites #41

Closed Jaweki closed 7 months ago

Jaweki commented 7 months ago
  1. fetchDinoData() gets raw api data from the provided dino api, and converts individual location per dinosaur into coordinates. e.g.,

    • {"foundIn": "USA, Canada" } is converted into;
    • [ { "USA", [-70.023, 65.24] }, { "Canada", [-86, 65.24] } ]
  2. getDigSites() groups all coordinates with the same "foundIn" name and calculates the count per coordinate group. this is important for showing the map overview: e.g., [ { 'South Africa': { coordinates: '[23.9137106762068,-28.3782721906973]', count: 7 } }, { Argentina: { coordinates: '[-63.954193,-36.252002]', count: 32 } }, { USA: { coordinates: '[-97.9222112121185,39.3812661305678]', count: 81 } }, ]