A Google Map Image Overlay in Google Earth

Last year, when experimenting with Google Earth popups we created a popup with a Google Map in it. It was intended only as a demonstration of the functionality of Google Earth popups, and not as a permanent service. It still works, but is dependent on a server for its functionality and we make no guarantees that it will work in the future.

However, we have recently been studying KML in detail and one of the features we came across is the ability to refresh an image overlay as if it was a network link. This gave us the idea of putting a Google Map in an image overlay instead of a popup. The advantage of doing it this way is that it does not require an independent server to work. There are disadvantages, however. The map is just an image whereas the popup version was a fully interactive map complete with Street View. With the overlay technique we can provide a few different map types and a Street View image, but they are not interactive. Another problem is that the technique results in a map that is slightly lower resolution than the view in Google Earth. This is because the Google Static Maps API automatically adds a margin to the map and there is no way to include calculations in the process. One way to resolve this would be to trim the edges of the overlay using KML, but that would cut out the Google Logo and copyright notices, which would be a violation of the licence agreement.

To try out the image overlays in Google Earth download this KML file


The standard street map view.


One possible use is to compare satellite imagery between Google Maps and Google Earth.


The Street View overlay knows which way you are looking.

We chose to make the overlays a fixed size, as that works best with the Static Maps API. However, you could make it automatically scale with screen size, change it to a size of your choosing or put it in a different corner by editing the KML file.

It would have been nice to add overlays for maps from other mapping providers, but we couldn’t find any that had a simple API and there may be licensing issues with displaying their maps in Google Earth.

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. Andy - Sheffield UK says:

    Would it be a violation of copywrite, afterall, you are placing an image from google maps into google earth, which has a wapping great Google logo in the corner. Anyway – cool KML, makes navigation a bit easier. I’ll have a play with the markup. Thanks.

  2. How to make the overaly to fit the full screen?

    • Timothy Whitehead says:

      Edit the KML file with a text editor and look for all instances of 600 and 400. You can try increasing those figures to a maximum of 640. The free Google Maps API only allows up to 640 but you can scale it so you can try replacing size=600x400 with size=600x400&scale=2 then use 1200 and 800 for all other instances.
      Google Maps API



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.