Back to Cases
Product ExperimentsLong read

View the Town - How I Built an AI City Guide That Knows When You Arrive

An upgraded AI walking guide with geographically grounded highlights, location checks, and proximity alerts. A build note on making a city guide more useful on the street.

AI Product Build
2026
3 min

When I travel, I always ask Claude or ChatGPT: "What are the best things to see in this city?" Then I manually copy the results into Apple Maps, one by one. It works, but it is tedious. So I automated it.

View the Town is a progressive web app that takes a city name, generates 8 curated highlights using the Claude AI, pins them on an interactive map, and automatically shows you background information when you physically walk within 100 metres of a highlight. No tapping required. Just walk around.

Update: more reliable places, less guesswork

The upgraded guide can ground its suggestions in nearby geotagged Wikipedia places. Candidate places are checked against the selected city boundary and a five-kilometre radius, and transport infrastructure is filtered out. Server-side validation checks the generated locations before they become map pins.

Browser caching is now complemented by an edge cache, and uncached requests are rate-limited. The product keeps its original walking flow: choose a city, explore the map, and receive a proximity banner near a highlight. The upgrade focuses on more credible locations and avoiding unnecessary repeat generation.

Open the upgraded View the Town.

The Stack

  • Maps: MapLibre GL JS with OpenFreeMap tiles - completely free, no API key, smooth WebGL rendering on iPhone
  • AI: Claude Haiku via the Anthropic API, called server-side so the API key never touches the browser
  • City search: Photon geocoder with OpenStreetMap data for autocomplete with country disambiguation, so Paris, France and Paris, Texas stay separate
  • GPS: The browser native Geolocation API with watchPosition, Haversine distance checks every few seconds
  • Caching: localStorage with a 30-day TTL so you do not burn API credits revisiting the same city

The Interesting Problems

Timeouts on Cloudflare Workers

The original implementation targeted a short response budget. Claude Sonnet with 12 highlights was taking 25-35 seconds, which made the wait too long. Switching to Claude Haiku and reducing to 8 highlights brought it down to 5-10 seconds, well within budget.

Wrong city

Searching for Springfield could return results for any of the 30+ Springfields in the world. The city selector now uses the Photon geocoder to show a dropdown of matching cities with their country and region. The confirmed country is passed all the way through to Claude: "Generate highlights for Springfield, Illinois, United States."

Map labels in the wrong language

OpenFreeMap renders labels in the local script by default. In Greece that means Greek characters; in Japan, kanji. After the map style loads, every symbol layer gets its text-field replaced with ['coalesce', ['get', 'name:en'], ['get', 'name']] - English first, local script as fallback.

City context on the map

A map full of pins with no boundary is disorienting. You cannot tell if you are zoomed in on the right town. A Nominatim lookup fetches the administrative boundary polygon and renders it as a faint cyan fill with a dashed outline, so the city extent is immediately obvious.

The Result

Open the app, type a city, confirm it from the dropdown, and within about 8 seconds you have 8 pins on a map. Walk around. When you get close to a highlight, a banner slides in at the top. Tap it for the full story: history, a practical tip, and a one-tap link to walking directions in Apple Maps.

It works as a home screen app on iPhone with no App Store involved. The whole thing costs fractions of a cent per city searched.

Similar challenge?

Interested in a similar transformation for your organization? Let us discuss your context and goals.

Published in archive /// 2026