Misc · Tool · Oct 2026 · free
Halftank.
How far can you drive on what's left? Type in the miles your gauge shows, gas or electric, and Halftank draws them as a circle around you. Everything inside is still in reach. The circle follows you and shrinks a mile for every mile you drive, so a glance mid-trip shows every place you could still turn off and go.
- Works with
- Gas or EV
- Runs in
- Your browser
- Your location
- Stays on your phone
- Cost
- Free
Why a circle
Range anxiety isn't about the number. Every car already tells you "42 miles left". What it doesn't tell you is where 42 miles gets you: the lake, the next town, the charger on the far side of the valley. You do that math in your head, usually while driving.
Halftank does it on the map. It's deliberately a plain circle, all 360 degrees, even across a canal or a desert with no road. A circle is honest about what it is: straight-line distance, so the drive is always a bit longer than the circle says. In return it's instant, works anywhere, and needs no downloads, accounts or route planning. Turn on There & back and a second circle at half your range shows everywhere you can reach and still return from.
How to use it
- Read the gauge. Enter the miles your car says are left.
- Press Start. Your phone's GPS puts you on the map with your circle around you.
- Drive. The circle follows you and shrinks with every mile. Parked GPS drift and sudden jumps don't count.
- Tap anywhere. See how far that spot is, and whether you'd make it or how many miles short you'd be.
- Filled up or charged? Enter the new number and press Update range.
Mount the phone or hand it to a passenger; don't work it while driving. On iPhone, keep the screen on: Halftank asks the phone not to sleep, because a locked phone stops giving web pages its location.
// The whole tool: a circle of remaining range, centred on you, shrinking as you drive.
navigator.geolocation.watchPosition(pos => {
const here = L.latLng(pos.coords.latitude, pos.coords.longitude);
const acc = pos.coords.accuracy; // metres
if (last && acc < 50) {
const d = haversine(last, here);
const secs = (Date.now() - last.t) / 1000;
if (d < Math.max(12, acc * 0.6)) return; // GPS jitter while parked: ignore
if (d / secs > 90) { last = stamp(here); return; } // a jump, not a drive: don't count it
driven += d / 1609.344;
}
last = stamp(here);
const left = Math.max(0, startRange - driven);
circle.setLatLng(here).setRadius(left * 1609.344); // inside = still reachable
half.setRadius(left / 2 * 1609.344); // inside = reachable and back
}, null, { enableHighAccuracy: true });Everything runs on your phone. Your position goes from the GPS to the map and nowhere else; the page remembers only your starting range and miles driven, so a refresh doesn't reset the trip.
Where it's going
Typing in your range works today. Two upgrades would make it better:
- Pick your car. A vehicle profile (tank size and mpg, or an EV's rated range) plus your fuel or charge level, so you don't have to read the gauge.
- Ask the car. Connected-car services can report remaining range directly, especially for EVs. That's the version I'd most like to build.
The bigger wall is where the circle lives. It's best on the map you're already navigating with, and Google Maps, Apple Maps and Waze don't let other apps draw on their maps. A web page can't show on CarPlay or Android Auto either. The real fix is a full navigation app with the circle built in, which is a much bigger project. The same wall killed a related idea, a one-tap button for reporting wrecks and speed traps; that one has its own post.
Where it started · Jul 2026
The reach map: which roads can you actually ride?
Halftank began as a different question: how far can a 50cc scooter that tops out at 40 mph actually get around the East Valley? On a map everything looks close. On the ground, nearly every through-road in the Phoenix suburbs is posted at 45, and a small scooter, e-bike or moped either isn't allowed on them or shouldn't be. The distance was fine; the roads were the problem.
LIMIT≤20SPEED
LIMIT25SPEED
LIMIT30SPEED
LIMIT35SPEED
LIMIT40SPEED
LIMIT45SPEED
LIMIT50+over the ceiling
That first version was a single web page that did four things in the browser:
- Pull the roads. It asked OpenStreetMap's public query service for every road in a box around the pin, with geometry and tags.
- Read the limit. Each segment got a speed: the posted maxspeed if someone mapped it, otherwise a default by road type, flagged as a guess.
- Build a graph. Every point where segments meet became a node; every segment an edge weighted by its length in miles.
- Search outward. Dijkstra's shortest-path algorithm expanded from the pin, skipped every edge above the vehicle's ceiling, and stopped when the distance budget ran out. Round trip halved the budget.
// Shortest-path outward from the start, but some edges simply don't exist for you.
function reach(graph, start, budgetMiles, ceilingMph) {
const dist = new Map([[start, 0]]);
const pq = new MinHeap([[0, start]]);
while (pq.size) {
const [d, u] = pq.pop();
if (d > dist.get(u) || d > budgetMiles) continue;
for (const { to, miles, mph } of graph.get(u)) {
if (mph > ceilingMph) continue; // too fast for this vehicle: not an option
const nd = d + miles;
if (nd <= budgetMiles && nd < (dist.get(to) ?? Infinity)) {
dist.set(to, nd);
pq.push([nd, to]);
}
}
}
return dist; // every node you can reach, and how far it took
}
const budget = roundTrip ? range / 2 : range; // there and back without stoppingTwo honest caveats sit inside those numbers. A lot of the "≤20" miles are parking aisles, alleys and service drives, which count as road in the data but not in a rider's head. And only 37% of road segments in this area have a speed limit in OpenStreetMap at all; the rest are guessed from the road's type.
// Most roads have no posted limit in OpenStreetMap. Fall back to the road's class.
const ASSUMED = {
motorway: 65, trunk: 55, primary: 45, secondary: 40, tertiary: 35,
unclassified: 30, residential: 25, living_street: 15, service: 15,
};
function mph(tags) {
const m = /(\d+)/.exec(tags.maxspeed || "");
if (m) return { mph: +m[1], mapped: true };
return { mph: ASSUMED[tags.highway] ?? 25, mapped: false }; // counted toward "% guessed"
}The reach map answered its question, but it was slow (it downloads every road around you), it needed good speed-limit data that mostly doesn't exist, and it only mattered to small vehicles. Stripping it down to the one thing every driver wants to know turned out to be the better tool: the circle.
What I learned
- The simple version won. Roads, speed limits and Dijkstra made a clever map. A circle made a useful one.
- Constraints beat distance. For a small vehicle, the question isn't how far but which roads: one rule (no roads over 35) removed three-quarters of the reachable network.
- Be honest on screen. The reach map showed how much of its data was guessed; the circle says it's straight-line.
- Platforms decide. The best place for a feature is inside the app people already use, and that app has to let you in.
Map data © OpenStreetMap contributors. Reach-map figures computed Oct 18, 2026 from a 20-mile round trip starting in downtown Mesa, AZ. Questions or ideas: Discord.