Archive

Posts Tagged ‘Javascript’

Google Earth 5, World Time Zone Clock – Javascript and KML

February 5th, 2009 19 comments

World Time Zone Clock in Google Earth 5

World Time Zone Clock in Google Earth 5

Here’s a KML and Javascript(!) hack for the new Google Earth 5.

It overlays a time zone map and allows you to click anywhere on the globe to see a running clock with the current time for that location.

Grab the KML file here:

World Clock

This uses normal KML to display a balloon when a polygon is clicked. Each balloon description has its own bit of Javascript to automatically calculate and display the time for the associated time zone.

More Info
In addition to running javascript, this hooks into a couple of other implementation changes in the new GE 5.

  • Polygons are now directly clickable. Previously you had to click on them in combination with a key press to make their description bubbles appear.
  • Stylemap highlight styles are triggered by mouseovers on polygons and lines instead of just placemark icons.

The polygons in this file are drawn from Valery‘s KML Timezone map, posted on the Keyhole BBS a few years ago.