We were recently asked by a GEB reader whether or not it is possible to add labels to paths and polygons. The ability to add labels to paths was added to KML with version 6.1 of Google Earth. Unfortunately, it cannot be done within Google Earth but requires editing the KML file. You need to identify the style element for the lines you want labels for, and add
<gx:labelVisibility> in a
<LineStyle>. See the KML Reference for more.
For polygons, however, there is no way to tell Google Earth to display the label. The only solution is to create a separate placemark for each polygon with the name. This can be quite tedious for large datasets, so we thought it might be useful to have a utility to do it automatically.
The utility below simply goes through a KML file and for every polygon, creates a new placemark in the centre with the same name as the polygon.
Our KML parser is still in development so it is not guaranteed to keep all elements in the KML file. Let us know in the comments if you find any bugs or have suggestions for improvements.
We tested it on our map of 3D imagery.