For some reason I can’t get it to render Copenhagen at all, no matter which spelling I try to use. It works with other European cities though.
Also weirdly can’t do Greek cities, but can do all the other European cities I tried.
I was trying Athens in Greece and I am getting only the Athens in the United States.
It seems that it uses this search engine for OpenStreetMap data, https://nominatim.openstreetmap.org/. The query for Athens in the search engine, https://nominatim.openstreetmap.org/search?format=json&q=Athens, seems to return as the first result the Greek city, but somehow the results are filtered? I am not sure.
This is a good pointer, if I look up cities that work (Rome, Amsterdam, Stockholms kommun (the county)), they have a city outline in the search results, whereas the ones that don’t work (Copenhagen, Athens, Stockholm (the city)) have no outline in Nominatim.
The code filters the results to only those with osm_type of relation. It looks like it should be updated to work with things that have an osm_type of node as well, but how big a change to the code would be required to do that is unclear to me.
Hah, very cool! I did this on the country level a while ago, albeit much slower and more manual.
I wish this could render Greater London and the City of London at once. Understand why they are classed as different but you usually want to see them both on the map together