It's determined by a set of arrays in the ROM. These arrays are terminated with the byte 0xC5 (as 0xC5 is the highest map ID in FR). It searches through each array, one by one, and if it finds the map name ID, it stops.
The exception to this rule is if the map name is less than 0x8F (so, 0x8E and down), then it automatically appears in Kanto.
It's relatively simple to redefine which maps appear in Kanto, and just as easy to define which maps appear elsewhere by repointing the arrays.
The Kanto definition byte is at 0xC0064 and the arrays start at 0x3F1AA4 and end at 0x3F1AFF (Total data size) with Sevii Islands 1 starting at 0x3F1AA4, Sevii Islands 2 starting at 0x3F1AC2 and Sevii Islands 3 starting at 0x3F1AE0.
By changing these bytes around (and repointing if necessary) you can define which map name appears on which map quite easily.
ETA: The world map flags only control the availability of flight spots, additional information and the colour of the minor locations on the world map, nothing more.