Home › Notes › A daily map for our travel app
I added a map to our travel app, and a museum in Hiroshima ended up in Nagoya
A while ago I wrote about turning our Notion travel planner into a phone app. Once we actually took it on a trip, a list of stop names turned out to have a problem: you can't tell what's close and what's far, or see at a glance where to go first. So I asked Claude to put a map above each day's plan.
The map was quick. Where to put the dots was not
The map doesn't need much: number each stop of the day in order, color them by type, connect them with lines, and tap one to open that stop. That part came together quickly.
The hard part is the location. Nobody looks up coordinates while planning a trip. Some stops have a map link pasted in, but most just have a name. So we piece together each location as best we can: use it if someone entered one, look in the link if there is one, and otherwise search by name.
Trouble the first time I opened it
I tried it on a Japan trip. One day was all around Hiroshima, yet a line on the map shot off hundreds of kilometers. It was the Yamato Museum in Kure. Searching its Chinese name had found a similarly named place in Nagoya.
My first thought was that this is worse than leaving it blank. A blank, I know I need to fill in. A wrong spot, I might just believe.
So we changed the rules:
- A location found only by searching the name is marked on screen, as a reminder that it may not be right.
- If a stop has a link but no location can be read from it, it stays blank instead of taking a chance on the name.
Mistakes are fine, as long as they're easy to fix
Places with the same name will keep tripping it up. Rather than trying to make it never wrong, it's better to make fixing it easy. There are two things I like most about the screen for fixing a location.
First, the pin in the middle stays put and you move the map. If you drag a pin on a phone, your finger covers exactly the spot you're trying to hit. Moving the map instead, you can always see the tip of the pin.
Second, the search looks at where the day's other stops are first. On a trip, places you visit on the same day are usually in the same area, so nearby results come first, and each one shows how far it is from the other stops. Pick something unreasonably far away and the screen gives you a heads-up. A same-name mix-up is obvious at a glance. We later changed the automatic search to work the same way, and stops landing in the wrong city became much rarer.
One small surprise while testing: Hiroshima's Orizuru Tower never showed up when searched in Chinese, but its Japanese name found it right away. So when nothing turns up, the screen suggests trying the local name or the address.
Fixing a location shouldn't take me somewhere else
In the first version, tapping to fix the location while editing a stop jumped to another page, saved as soon as you were done, then jumped back.
After a few tries it felt wrong. To me, editing a stop is one form, and the location is just one field in it. When part of it got saved before I hit save, I wasn't sure what had actually been saved.
So now a small window opens inside the form, and the location you pick goes back into that field. Nothing is saved until you hit save on the whole form. Cancel, and everything stays as it was, including whatever you'd already typed. The form also got a button to pull the location from a link. When that doesn't work, it explains where it got stuck and what else you can try, instead of just saying it failed.
Links shared from a phone have no location in them
Next problem: links shared from the phone's map app often gave us nothing.
Looking inside, those links have no coordinates at all, just a string of text with the place name, another name for it, and the address run together. Searching the whole string found nothing. The name alone hit same-name places. The address alone was actually the most reliable, though it only gets you to the right area, not the exact building.
The first idea was to split that text finely, trying the name, the other name and the address one by one. But plenty of shop names have parentheses in them, so splitting too finely would break the name. In the end we split it into just two parts, the address and the name: try the address first, and if that fails, the full name. When a location is found by address, the screen says it may be a little off, and I decide whether to nudge it.
Fine on the computer, broken on the phone
The last problem was the hardest to pin down. The same link worked when tested on the computer, but failed every time I tried it on my iPhone.
We couldn't reproduce it on our side, so we had to reason through it step by step. Opening a shared link passes through several redirects, and it was being blocked at the last one. But before it got blocked, we had already reached an address that included the place name. The old approach simply gave up because the last step failed.
Now, if what we got along the way is enough, we use it.
What I learned
- When you're not sure, say so. A blank gets filled in eventually. A mistake that looks right might be trusted all the way.
- Where mistakes are likely, make fixing them easy. Finding locations automatically will never be right every time. But if a mistake is obvious at a glance and takes a few taps to fix, it stops being a problem.
- You only find the rough spots by using it yourself. Going back to the form after fixing a location, saving only when I hit save, splitting links into just two parts: I decided on each of these because I got stuck on them myself.