mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
269bd9140f
Every country now carries the status of the strongest source it came from: a country reached by both a past and a future trip is visited, one that only appears in upcoming trips is planned. Marking a country by hand still wins over everything, since that is a statement of fact rather than a date. totalCountries drops to the visited ones and totalCountriesPlanned sits beside it; continents and mostVisited follow the same rule. countries[] stays a superset of what it returned before, so an older client keeps painting the map exactly as it did. The endpoint query has to select trip_id to know which trip a leg belongs to, which makes its DISTINCT per trip — the coordinates are collapsed again in JS so the point-in-polygon lookup still runs once per location.