Adds MapSearch: a place search box, a map and latitude/longitude fields that share one value, { lat, lon } in WGS 84 decimal degrees. No new dependency and no map library.
What it does
- Search box. Typed coordinates are parsed locally: signed decimals, latitude first (
48.4284, -123.3656), or degrees-minutes-seconds with hemispheres (48°25′42″N 123°21′56″W). Place names go to a pluggable search function. nominatimSearch() is provided for OpenStreetMap and runs on Enter only, because Nominatim’s usage policy forbids autocomplete.
- Map. A Web Mercator (EPSG:3857) z/x/y tile grid drawn with plain
<img> tiles. Tiles are opt-in via tileUrl + attribution; without them it draws an offline graticule, so nothing touches the network by default. Light tiles are inverted and dimmed by default (tileFilter="dark", values chosen by eye) so a dark page gets no light backdrop.
- Input. Drag pans, wheel and +/− zoom, a click drops the pin. With the map focused, arrows pan and Enter drops the pin at the centre.
- Fields. Latitude/longitude inputs, clear, use-my-location (browser geolocation, accuracy shown), and hidden form inputs via
latName / lonName.
Public API
New exports: MapSearch, MapSearchProps, LatLon, GeocodeResult, GeocodeFn, isLatLon, parseCoordinates, formatCoordinates, nominatimSearch. Additions only, so this is a patch release; nothing is renamed or removed.
Stories: General UI/Components/Map search (Offline, OpenStreetMap tiles and place search, States). Only the OpenStreetMap story makes network requests, and it shows the © OpenStreetMap contributors credit.
Checks
python3 dev_check.py: 475/475 passed
npx tsc -p .: clean
python3 scripts/api_surface.py --removed v0.8.1: nothing removed
Not yet tried in a browser: drag, wheel zoom and live search have not been exercised in Storybook.
🤖 Generated with Claude Code