Skip to content
Blog

How Oh My Maps! Places Country Labels Automatically (and What Happens When It Can't)

·4 min·View as Markdown

TagsWorld Map

Written byJordan HaleWriter, Oh My Maps!

Contents

Labelling a map by hand is a fight against overlapping text: a name too big for its country, a small nation’s label colliding with its neighbour’s, Luxembourg’s name simply having nowhere to go. Oh My Maps! solves this with an automatic placement algorithm rather than leaving you to drag text boxes around one at a time.

A cluster of small Balkan countries, each painted teal, with names placed in callout boxes just outside their borders and thin guide lines pointing back to each country

The simple case: the name fits inside

If a country’s name fits comfortably inside its own shape at the chosen font size, that is where it goes, centred on the country. Most large and medium-sized countries never need anything more complicated than this.

When a name is too big for its country, the label does not shrink or spill across a border. Instead, the editor searches in rings around the country for a free spot to place a callout box, a small rectangle containing the name, connected back to the country by a short leader line.

The search has real constraints, not just “find any empty pixel”:

  • It prefers water over land, so a callout is more likely to land in the ocean beside a coastline than on top of a neighbouring country.
  • A callout box is not allowed to cover land belonging to another labelled country, so adding one label does not silently make another one unreadable.
  • The search has a maximum radius, so a callout stays visually connected to its country rather than drifting into a distant, unrelated part of the map.

The result is a leader line that is usually short: a small country’s name lands just offshore, close enough that the connection to its territory is obvious at a glance rather than a long line snaking across the map.

Try it on a cluster of small countries. Turn on labels for the Balkans or the Caribbean and watch the callouts fill in around them.

Open the editor

When even that fails: the numbered key

On a genuinely crowded map, dense clusters of small countries close together, there may be no free space left within a callout’s search radius for every label to fit. When that happens, the editor does not force some labels to overlap. Instead, the entire set of active labels switches to a numbered mode: every labelled country gets a small number on the map, and a key panel lists the numbers against the country names, positioned wherever it fits and split into columns automatically if the list is long.

This is a set-wide switch, not a per-country fallback, on purpose: mixing some countries with in-map names and others with numbers on the same map would be harder to read than either format alone. If you specifically want the numbered format, labelling a cluster of small, adjacent countries is the fastest way to trigger it deliberately, which is a reasonable choice for a geography quiz where matching a number to a name is the point.

What travels into the export

Callout boxes, leader lines and the numbered key panel are all drawn directly into the map’s SVG, the same source that PNG, JPEG and WebP exports are rasterised from. There is no separate “labels for screen” versus “labels for export” logic: what you see while editing is exactly what ships in the file, at any resolution up to 8000 px.

Practical takeaways

  • Label only the countries your map is actually about. Labelling all 235 guarantees you hit the numbered fallback; labelling six specific countries almost never will.
  • If a cluster keeps triggering the numbered mode and you don’t want it, reduce the font size for that map, which gives the callout search more room to place standard labels before it gives up.
  • The numbered key panel is a legitimate design choice, not just a fallback. For maps with many small, similarly sized regions, it is often more legible than a screen full of leader lines.

Next steps

ShareXLinkedIn

Ready to make yours? Oh My Maps! is free, runs in the browser and needs no sign-up. Your map is saved locally as you work, and exports carry no watermark.

Open the editor