New maps in CityWalker 3.5
CityWalker 3.5 came out on 11 September. Every map in the app now runs on MapLibre instead of osmdroid. The maps are smoother and quieter, and one big-city problem took me two attempts to get right. This is what changed and why.
A note on platforms: this is about Android. The iPhone beta was built on the new engine from the start, so this change mostly brings the two apps in line.
What was wrong with the old maps
The old map engine drew every street line itself, one at a time, on the phone's main processor. For a small town that is fine. For a big city it is not. Paris has around 286,000 street segments, and drawing all of them that way was slow enough that the map had to fall back to loading only the part on screen, and it was still sluggish to open.
The background map had a second problem. It arrived as ready-made pictures, so I could not take anything out of it: every label, shop icon and building shape stayed. I tried tinting it to make it calmer. That just turned colourful clutter into beige clutter, and the grey lines for streets you have not walked got lost against the grey roads underneath.
Why MapLibre
MapLibre is an open-source map engine that works differently. The map arrives as data rather than pictures, and the phone's graphics chip draws it. That means two things for CityWalker: large numbers of street lines are cheap to draw, and I get to decide what the background map shows.
It was also what the iPhone beta already used, with free map data from OpenFreeMap. Running the same setup on both platforms means one set of choices about how the maps should look instead of two.
A quieter background
The coverage map is about your streets, so the background should step back. Instead of using the stock map style, the app now ships its own trimmed copy. On coverage maps I removed building outlines, which tile the map in pale boxes once you zoom in, and a hill-shading layer that never showed up at city zoom levels anyway.
The route planner goes the other way. There are no coverage lines there, so a fuller map with parks, water, buildings and street names makes it easier to see where a route actually goes. I only took out the shop and point-of-interest icons, which cluttered the area under the route line. This one stays light in dark mode, because there is no dark version of that map style.
Making unwalked streets easier to see
Getting the colour of unwalked streets right took three tries. A neutral grey disappeared into the background roads. A darker slate blue looked fine as a single line, but in a dense street grid hundreds of overlapping lines blurred into one flat grey patch. The current colour is a bluer tone that holds up in both cases. High contrast mode uses a darker version of it.
Line thickness now changes with zoom: thinner when you are looking at the whole city, thicker when you zoom in on a street. My first attempt made the city overview too thin, so I went back to fixed widths for a while. The version that shipped keeps the street-level thickness I had already tuned on a real phone and only scales away from that.
The big-city problem I thought I had solved
My early tests went very well. The new engine drew all of Augsburg, and all of Paris, in one go, and panning stayed smooth. So I deleted the old "only load what is on screen" code. Getting rid of it felt like the whole point of switching.
Then I tried Jodhpur. It is about the same size as Paris, around 286,000 segments, and almost none of it walked. Opening its coverage map pushed the app past a gigabyte of memory and took several seconds. On the iPhone side, a city of similar size had already crashed the app while loading. The cities I had tested were not the worst case.
So loading in pieces came back, but only for large cities: above 150,000 segments. Ordinary cities like Amsterdam (about 24,000) or Prague (about 34,000) still load in one go. Paris, Augsburg and Jodhpur load in pieces.
Smaller changes
- Attribution on every map. OpenFreeMap requires it, and it is fair credit.
- An offline message. With no connection, the map says the background is unavailable instead of showing a blank area. Your walked and unwalked streets still draw.
- The live walk map keeps up. Its street overlay now refreshes as you walk, and when you pan ahead, instead of loading once near the start.
- The green location dot. It went missing in the move. It is back, and it no longer greys out after 30 seconds without a GPS fix.
What I gave up
OpenFreeMap is free and needs no account, but it comes with no guarantee. If it ever goes away, the fallback is hosting the same map data myself. I have written that plan down rather than building it ahead of time.
The new engine also makes the app a bit bigger, since it ships its own drawing code. For smooth maps in the cities people actually walk, I think that is a fair trade.
The new maps are in version 3.5 on Google Play. If a map looks wrong, especially in a big city, email me. A screenshot and the city name help a lot.
