Territory capture
A simulated runner sends GPS positions; LoopDetector notices when the path closes, TerritoryStore merges the claim and takes the overlap from rivals, and TerritoryLayer draws it. Click a territory to see who holds it. The dashed leg is the part not yet run: the shape it closes is what the lap would be worth from here.
Open it full screen · Source: 11-territory.ts