It’s incredible how things that seem simple can be so complicated. Take a “simple” maps app. There’s geometry, design, typography, a 60-gigabyte database, and a lot of complicated algorithms. Every button you press has an astonishing maze of technology supporting it.
That’s probably why GNOME Maps fascinates me so much, and why I’ve been contributing to it for three years now. And it’s why I’m thrilled to announce something I’ve been dreaming of for those three years, and working on for the past 8 months: A vector tile renderer for libshumate, the library that will eventually be powering Maps.
What are vectors, tiles, and vector tiles?
Maps currently uses raster tiles. The map is stitched together from static, unmodifiable photos downloaded from the map provider. Vector tiles contain the actual map data: what area the park covers, what the name of the café is. They contain geometry, not pixels, hence vector tiles.
Because raster tiles contain pixels, they’re ready-made to display on screen. Vector tiles don’t contain pixels, so they need to be converted. This process is called rendering. The advantage of doing our own rendering is that we can control what the map looks like: change the colors, choose which language we want, and decide what places to show or hide. The disadvantage is that rendering is complicated–it’s taken me 8 months and 3 different prototypes to get it just right!
Not everything is implemented yet. I still need to support labels, icons, and higher zoom levels, then spend some time polishing and testing.
What does this mean for Maps?
Not much in the short term–libshumate won’t be ready for another release or two. Not only are we adding a bunch of features, we’re also redesigning some of the API and porting to GTK 4.
But when it’s finally finished, we’ll be able to support a number of oft-requested features:
- Showing place names in your native language, where avaliable
- Downloading maps for offline use (technically this could be implemented now, but raster tiles are too large for it to be practical)
- Rotating the map without rotating the labels with it
- Smooth zooming without pixelation
- Getting rid of “What’s Here?” in the right-click menu. You’ll just click (or tap) a place instead.
Some of these features will work out of the box, and some will need additional work, but I hope to eventually implement all of them.
There’s lots more work to do to get libshumate and the vector renderer ready. I’m a student and I have a part-time job, so no promises on the timeline, but I hope to have another update in the coming months with lots of exciting progress!