Following on from our post on Google Earth’s internal browser we are exploring what can be done within placemarks in Google Earth.
A very underutilized feature of network links is the ability to send the location that the user is looking at as part of the URL. We thought it would be fun to demonstrate this capability by displaying a Google Map of the location you are looking at in a placemark. If you are a programmer wanting to learn more, see this tutorial from Google.
In order to make it work, the network link must point to a server that takes the URL parameters and dynamically returns a KML file that takes into account the location the user is looking at. This means this effect cannot be achieved without an application server. This might explain why the feature is so rarely used.
We set up a free cloud based server on OpenShift using an application called Node.js, which lets you run JavaScript on the server. Although it took a little time to get right, the result is only about 10 lines of code (beyond the provided template) on the server and a few more in the KML file.

To try it out, simply download this KML file and open it in Google Earth. Whenever you move the view it will move the placemark to approximately the centre of the Screen and show you a Google Map of the area.
Note that it is a fully working embedded Google Map, including the ability to zoom in and out, switch to satellite imagery or use Street View.









