Placemark popups in the new Google Earth

Today we are having a look at some things you should know if you are a KML creator with the new browser based Google Earth in mind – with a focus on placemark popups. First, we must note that the new Google Earth is still very much a work in progress, especially with regards to KML support and we can expect major changes to the way it handles KML in the future.

The first thing to note is that the new Google Earth cannot access local files. This is a consequence of being browser based. Browser security does not allow web based applications direct access to files on your local computer. So, if you create a standard KML file which includes links to local images in popups or overlays and open it in the new Google Earth, you will not be able to see the images. If you save the file in the compressed KMZ format, then Google Earth puts the images in the file. That did work for image overlays but not placemark popups. We then tried uploading the KMZ file to Google Drive, as the new Google Earth has built in support for opening files from Google Drive. However, we found that trying to open KMZ files from Google Drive gives an error and only KML files could be opened that way.

Finally, we uploaded the image to GEB and linked it in the KML. When we did this, we found that the images did work correctly in placemarks and image overlays, but photo overlays appear to not be working at this time.

The next thing to note, is that when you place an image in a placemark popup, Google Earth does not know how large the image is until it is loaded. The consequence of this is that in Google Earth classic, the popup may be resized after the image loads. In the new Google Earth, this does not happen. If you close it and open it again, the image has been cached and it opens at the correct size:


Left: Opened for the first time. Right: Opened the second time.

The solution to this it to give the image an explicit size in your popup. An alternative would be to wrap your placemark content in a ‘div’ that has explicit style information.


Always include width and height for your images for better popups. This is true even for Google Earth classic.

Another option is to take advantage of the new popup options. We know of three new modes, ‘card’, ‘panel’ and ‘fullscreen’.

To use them, you have to edit the kml file and put one of these lines in the style information for a popup:

<BalloonStyle><gx:displayMode>fullscreen</gx:displayMode></BalloonStyle>
<BalloonStyle><gx:displayMode>panel</gx:displayMode></BalloonStyle>
<BalloonStyle><gx:displayMode>card</gx:displayMode></BalloonStyle>

See an example of how it is done by inspecting the contents of this sample KML file

The ‘card’ mode does not seem to render HTML:

Also, when you click on it, it opens it full screen. We have not yet figured out how to specify the image. We believe it is intended only for Google’s use and links to Google Maps data via a custom tag: <gx:mid>

The ‘panel’ mode opens in a side panel and we have seen GE Teach make great use of that mode. However, we found that using it on a plain placemark with a single image, it sometimes did not display the image.

The ‘fullscreen’ option displays the contents of the popup full screen and appears to work reasonably well with a simple image.

About Timothy Whitehead

Timothy has been using Google Earth since 2004 when it was still called Keyhole before it was renamed Google Earth in 2005 and has been a huge fan ever since. He is a programmer working for Red Wing Aerobatx and lives in Cape Town, South Africa.






PLEASE NOTE: Google Earth Blog is no longer writing regular posts. As a result, we are not accepting new comments or questions about Google Earth. If you have a question, use the official Google Earth and Maps Forums or the Google Earth Community Forums.

Comments

  1. Thr new GE v7.1.8 also crashes when any clickable and outsourced image in a balloon opens in the built-in browser.

  2. Great post Timothy, thanks!

    I adapted my Google Earth Quiz template for the new Google Earth and share it here:
    https://github.com/DieterVanWerkum/google-earth-flyto-quiz

    Maybe we can speed things up a bit;-)

    Best regards,
    Dieter van Werkum



PLEASE NOTE: Google Earth Blog is no longer writing regular posts. As a result, we are not accepting new comments or questions about Google Earth. If you have a question, use the official Google Earth and Maps Forums or the Google Earth Community Forums.