GeoIntel Update
GeoIntels fixed bugs
The Problem: Pins Were Disappearing
The most frustrating bug was crisis pins vanishing from the globe mid-rotation. Users would spin the globe and watch pins flicker in and out of existence. After digging in, we found three bugs stacked on top of each other:
Bug 1 Wrong slice direction
After sorting pins by z-depth (front-to-back), the code was doing .slice(0, N) —
which grabbed the first N pins in the sorted array. Since the sort was ascending,
those were the pins with the lowest z-values — i.e., the ones facing away from
the viewer, on the back of the globe.
The fix: .slice(-N) — take the last N instead. After ascending sort, the last items
have the highest z-values, meaning they're the most front-facing and visible.
Bug 2 No z-depth filter
In a previous attempt to fix the flickering, the z-depth filter had been removed entirely. This stopped the flickering but caused pins on the back of the globe to render straight through the sphere as if it weren't there.
The fix: restore .filter(({p}) => p.z > 0) before the sort. Pins behind the sphere
are rejected entirely; only front-facing pins enter the sort and slice pipeline.
Bug 3 Zoom formula halved pin count at normal zoom
The formula controlling how many pins to show at a given zoom level was zoom / 2.
At the default zoom of 1.0, this multiplied the display limit by 0.5 thus showing half
as many pins as intended.
The fix: change the formula to just zoom. At zoom=1.0, you get 100% of the limit.
At zoom=2.0, you get 200% (capped at 250).
Zoom In, See More
With the sorting fixed, the next issue was that zooming in didn't actually reveal new pins. The problem: there simply weren't enough crisis events in the database with precise enough coordinates. Most regions had a single point per country, so zooming in never uncovered anything new.
Two fixes:
-
Lower the confidence threshold. Pins with a location_confidence score below 75 were being filtered out. Dropping this to 60 added 24 more crises to the candidate pool immediately.
-
Add 120 new crises. We inserted 120 new events into the database with sub-regional coordinates — so zooming into the Middle East, for example, now reveals separate pins for Gaza North, Gaza South, the West Bank near Jenin, the West Bank near Hebron, South Lebanon, and Beirut, rather than a single dot on the map.