Comment

Comment by tyjkot

Yep! OpenStreetMap all the way down. Leaflet for the map with OSM raster tiles, and Nominatim for geocoding the typed address (US-restricted). County boundaries are US Census data as TopoJSON (~0.8 MB), self-hosted and decoded client-side with topojson-client. Once that loads, clicking the map resolves to a county with a local ray-casting point-in-polygon check - no API call. County lines and labels only render for what's in the viewport past a zoom threshold. React + Vite around it. No backend, no keys, no paid APIs.

For easy reading:

- Frontend: React 18 + Vite, React Router

- Map: Leaflet, lazy-loaded when the tool page mounts

- Base tiles: OpenStreetMap raster tiles (free, no key)

- Geocoding: Nominatim (US-restricted), only for typed address searches

- County boundaries: US Census TopoJSON (~0.8 MB), self-hosted, decoded client-side with topojson-client

- Click-to-county: local ray-casting point-in-polygon - no API call

- County lines/labels only render for the visible viewport past a zoom threshold

parent tyjkot 4 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton