The request was "a website that gathers the world's beautiful libraries on a map." The structure was to match the painting map I had built earlier (ghmun.com/painting), but as a separate page: a list on the left, the map in the middle, and a photo and description opening on the right when you tap a pin. The finished page is at ghmun.com/library.
How the 100 were chosen
For the painting map I pulled holdings from Wikidata with a query. "Beautiful" cannot be written as a query, so I chose the list myself. I started with well-known places such as the Trinity College Long Room, Admont Abbey and the Joanina Library, then added modern buildings such as Stockholm City Library, Helsinki's Oodi and the Kanazawa Umimirai Library. For Korea I included the Starfield Library, the Seoul Metropolitan Library, Janggyeong Panjeon at Haeinsa, the National Library of Korea and the Uijeongbu Art Library. The first version had 80 libraries in 34 countries, and 46 of them were in Europe. Part of that is that Europe's abbey and university libraries are crowded with places worth seeing, and part is that the places I know best lean toward Europe.
For each library I wrote an id, a Wikipedia title, a name, a city, the year built, the architect, how you can get in (free, paid, tour, restricted), two or three sentences of description and one "Before you go" line into a JSON file. I wrote those lines. For things that change, such as admission prices and opening hours, I wrote no numbers, only a reminder to check the library's website.
Coordinates and photos from Wikidata
I turned each Wikipedia title into a Wikidata item and saved the coordinates, the main photo (P18) and the Korean and English Wikipedia titles in a cache file. Most coordinates were usable as they were. I fixed only a few where the pin landed in the wrong place. I entered the coordinates by hand for the Starfield Library, Uijeongbu, Boston Public Library and Haeinsa.
The photos were the problem. Many main photos show the outside of an abbey or palace. For places like Admont, Melk, Mafra, Strahov and the Clementinum, the photo was a view of the building, not of the shelves. On a library map, a photo of the facade is worth less.
Laying out photo candidates and choosing
For each library I searched Wikimedia Commons for "library name + interior" and collected up to eight candidates. I could not hunt down file names one by one, so I made eight contact-sheet images, each showing ten libraries with numbered candidates, looked at them and picked numbers. I copied the chosen numbers into picks.json as file names. That swapped in interior photos for 44 libraries.
The candidate search was often wrong. The Marsh's Library candidates included a 19th-century stereograph, and the search for the Wren Library returned three photos of birds (a wren is also a bird). For the Uijeongbu Art Library the first candidate was the Peabody Library in Baltimore. I left those without a photo. Right now only Uijeongbu has none.
Eight libraries were left with exterior-only candidates: St. Florian, Wiblingen, Metten, Waldsassen, Pannonhalma, the Ambrosiana, the Angelica and Boekenberg. I changed the search to "name + library hall" or to German and Italian names and went through the Commons categories by hand, and found interior photos for seven of them. For Metten the only one was a black-and-white photo from 1896, so I used that. With those seven, 51 photos were replaced.
From 80 to 100
After I published the map, the user asked for 20 more. I chose candidates to reduce the regional skew first. I added Latin America (the España Library Park in Medellín, the UNAM Central Library in Mexico City, the National Library of Argentina), Oceania (Tūranga in Christchurch), Asia (Tianyi Pavilion in Ningbo, Gifu Media Cosmos, Sendai Mediatheque, the National Library of Singapore) and North America (the Los Angeles Central Library, the Providence Athenaeum, the Mansueto Library in Chicago, the Vancouver Central Library). In Europe I added Wolfenbüttel, Ghent, Altenburg, the Picton Reading Room in Liverpool, the Chester Beatty, Salamanca, Cesena and the Deichman in Oslo. The map now has 54 in Europe, 16 each in North America and Asia, 6 in Latin America, 5 in the Middle East and Africa and 3 in Oceania, across 40 countries.
Three of the candidates I first picked dropped out. The Paju "Forest of Wisdom" has no Wikidata item and no usable photo on Commons. The Musashino Art University Library was the same. The Mamma Haidara Library in Timbuktu had photos of manuscripts but none of the building or its shelves. A card without a photo was already one (Uijeongbu), so I did not add more. In their place I added the Providence Athenaeum, the UNAM Central Library and Sendai Mediatheque. Gifu Media Cosmos has no coordinates in Wikidata, so I looked up its address in OpenStreetMap and entered it by hand. Apart from Alexandria, there is no library in Africa.
The order of the list
While adding the 20, I set the order of the list again. The order in the file had been the order on screen, and for the first 80 it was just a pile with no rule, mostly Europe. I gave each library a priority of 1, 2 or 3. Priority 1 is for libraries that are widely known, that you can go into and that have a good photo, 27 in all, such as Trinity College, Admont, Joanina and Stuttgart. Priority 3 is for libraries with an exterior-only photo or none, libraries ordinary visitors can hardly enter, and those that are far away or restrict access, 27 in all. The Radcliffe Camera, All Souls, the Library of Parliament in Canada and the Uijeongbu Art Library are among them. The other 46 are priority 2. Of the new additions, I raised Salamanca, Cesena, Ningbo, Tūranga, Gifu, Oslo and Liverpool to priority 1. Both the list and the full list below the map follow the order 1, 2, 3, and within the same value they keep the earlier order. Because I set the values myself, the standard is subjective.
The screen
- List and pins. The list on the left and the pins on the map move together. Choosing a library in the list flies the map to its pin, and I corrected the position so the pin lands in the middle of the part of the screen that the right-hand panel does not cover.
- Filters. There are six region buttons and six period buttons. The periods are Ancient, Medieval & Renaissance, Baroque, 19th century, 20th century and 21st century. The 21st century has the most with 28, then the Baroque with 23, then the 20th century with 22.
- Entry. 54 libraries are free, 26 are paid, 14 restrict general visitors and 6 are by guided tour. The detail view shows this as a tag.
- Visited. Marking a library changes the pin's colour and lets you gather only the visited ones. At first this was saved only in the browser's localStorage. I then attached the same Google sign-in and shared Supabase project as the painting map and synced it with one table, library_visited, with one row per library id. When you sign in, the record in your account and the record in this browser are merged and neither is deleted. People who do not sign in cause no server requests.
- Photo credits. The photographer and licence appear at the bottom of the detail view and on the cards below the map.
- Full list below the map. Outside the map, I also put the photo and description of all 100 libraries, grouped by region, into plain HTML. The content reads even without the map script.
On the first screen, the map's zoom buttons overlapped the list panel on the left. I moved them to the bottom right on desktop and the top right on phones.
What I fixed after publishing
Once the list reached 100, I reviewed the site myself and fixed three things.
- Photo sizes. I had been requesting 120 for the list, 640 for the cards, 900 for the detail and 1600 for the enlarged view. On the painting map, requests at arbitrary sizes had come back as 429 (too many requests), so I switched to the standard sizes Wikimedia recommends: 120, 500, 960 and 1280. The cards went from 640 down to 500.
- Marker clusters. With 54 libraries crowded into Europe, the pins formed one lump on the first screen. I added Leaflet.markercluster to group nearby pins into numbered circles. The first screen now shows 13 clusters and 20 single pins. When you pick a library from the list, the map flies there and then opens the cluster so the pin is visible. When every library in a cluster is marked visited, the circle turns red.
- Credits on the cards. The detail view had the photographer and licence, but the 100 cards below the map did not. At build time I fetch the authors and licences from Commons in one batch (tools/library/credits.py) and put them statically into the cards and the detail view. All 99 photos have a confirmed licence. CC BY-SA 4.0 is the most common with 35, then CC BY-SA 3.0 with 23, and 16 are CC0 or public domain.
The English edition
After the launch I added this English edition (ghmun.com/en/library). For each library I wrote an English name, city, architect, description and tip into en_1.json and en_2.json. I carried the Korean descriptions over sentence by sentence, but where a phrase assumed a Korean reader I rewrote it for an English one. The names of regions, periods, entry types and countries are swapped by tables. There is only one Korean template for the screen text (page.html), and the English page is made at build time by replacing its strings from a table (UI_EN in build.py). I did not split the template in two so that a fix to a feature cannot reach only one of them. If a Korean string appears in the template that is not in the table, the build stops. The only Korean left on the English screen is one photo file name (the Starfield Library photo). On the English edition I hid the links to Korean Wikipedia, and the visited list uses the same storage and the same accounts as the Korean one. I checked the English descriptions only to the same level as the Korean ones.
Limits
- For the first 80 libraries I compared the descriptions and "Before you go" lines with the Wikipedia introductions and fixed 13. For the 20 added later I looked up architects, years and figures in the full Wikipedia articles and fixed the wording of five. The errors were things like the sundial at All Souls being outside the hall, not inside, and the British Library holding close to 200 million items, not "170 million". I could not check every detail and name that the introductions do not mention. Some architects or years may be wrong.
- The 100 are a selection. Many libraries are missing.
- The entry types were true when I wrote them. A library may have moved to booking or closed for building work.
What could come next
- Check the descriptions against the full Wikipedia articles to fix the remaining errors.
- Find a photo for the Uijeongbu Art Library, which has none.
- Make a static page for each library so that each one can appear separately in search results.