Recent KML and Earth Developments

Wednesday, January 14, 2009

Labels: ,

Recently, we released three new resources for KML and the Google Earth API:

  • Roman Nurik released a new article summarizing the use of KML in the Earth API.
  • Roman also released a embedded KML gadget for embedding a KML file into your web page or into your iGoogle.
  • We released libkml version 0.6. New in 0.6 is:
    • KmlStream streamed parsing, which allows you to parse through very large KML files
    • Support for KML's <Update> element
    • KmlFile now allows DOM import, which allows you to import one DOM into an existing KmlFile DOM
    And a number of other features. Check out the release section for the full list of new features.
  • I released a new article on Converting Geotagged Photos to KML PhotoOverlays. So get out those GPS-enabled phones and get to work!

Google Maps API Library for GWT

Tuesday, January 06, 2009

The Geo and the Google Web Toolkit teams are pleased to announce the public release of the Maps API library for Google Web Toolkit. Google Web Toolkit (GWT) provides a framework for writing web applications using the Java language. The Maps API library for GWT provides Java classes which are designed to provide a familiar paradigm for Java users to access the Google Maps JavaScript API.

 // Open a map centered on the equator/prime meridian
 map = new MapWidget(LatLng.newInstance(0, 0), 2);
 map.setSize("100%", "100%");

 // Add some controls
 map.addControl(new SmallMapControl());
 map.addControl(new SearchControl());

The GWT compiler translates your Java code into JavaScript for deployment to end users. No Java runtime is needed in the browser.

Using the library, you can freely mix Maps into a GWT application, or you can add GWT Widgets in with Map constructs, like Controls and InfoWindows. The demo below combines the DecoratorPanel, StackPanel, and SuggestBox widgets with a Map widget that uses Markers, Directions, Geocoding, and Geodesic Polylines.


There is online documentation, samples, tutorials, and a support forum.

The library has been released previously in milestone and release candidate forms, and it supports most Maps features up to version 2.113. We would like to thank the hundreds of developers that have tried the library and provided feedback.

2008 in Google Geo Land: All Lit Up

Tuesday, December 30, 2008

In 2007, we wrapped up the year with a bulleted list of our various accomplishments from this year. In 2008, a few LIs and a UL just won't do. So we're celebrating the year in typical New Years fashion: fireworks, baby. Watch the show below, and click any headline it leaves behind to read the relevant blog post. If it went too fast for you or you just can't get enough of it, then you can watch again by clicking the button below the map. Happy New Years, all!


P.S. Five bucks if you can find a way to name-drop the Google Geo APIs in your midnight toast (or New Years' post?) and send me proof.

NORAD Tracks Santa Flash Map: Behind the Scenes

Monday, December 29, 2008

For the second year in a row, Google partnered with NORAD to provide an online map-based interface for tracking Santa's Dec. 24th sleigh ride across the world. Last year, the map was powered with the JavaScript Maps API. As the programmer for this year's map, I made the decision to use the Maps API for Flash instead. Why? I desperately wanted a glittery "comet trail" to follow Santa's path, and those kinds of effects are easier to pull off in Flash. (One might argue that decisions shouldn't be based on glitter, but one could counter that by pointing out the entire 1970s decade was based on glitter).

While converting the map over to Flash, I wrote code that may be helpful to other Flex developers out there. Instead of just open-sourcing the Santa Tracker map code* and forcing you to sort through it all, I've created standalone demos and descriptions for each of the features:

  • Comet Trail: The purpose of the trail was to show Santa's recent trajectory, and give the flight more movement. The cloudy trail effect was achieved by creating a custom overlay that drew a line of increasing width through the 7 most recent markers, and then applying a BlurFilter to that line. To achieve the glitter effect on top of that, I create invisible circles of increasing radius around the markers, and then dynamically load in a sparkle SWF at random points within those circles. To get a twinkle instead of a strobe effect, each sparkle SWF is started at a different random frame in its timeline.
    Check out the demo or source code.
  • Embedded Youtube: The real highlight of Santa's ride are the 23 locations where we have "Santa Cams" (Youtube videos), so it was important that we were able to view those Youtube videos on the map. It's a surprisingly difficult task, due to the facts that: 1) the embedded Youtube video player is an AS2 SWF, 2) the Santa map is an AS3 SWF, 3) the Youtube SWF has to be "destroyed" before a new Youtube SWF can play, and 4) AS3 SWFs cannot call methods inside an AS2 SWF. With help from the Youtube team and the AS3 Chromeless player library code, I was finally able to get Youtube + Flex to cooperate. The solution involves the creation of a "bridge" SWF in AS2 that communicates via LocalConnection to the AS3 SWF to load/unload videos, and it also involved a whole lot of random numbers.
    Check out the demo or source code.
  • Smart Info Windows: To show all the locations, the map's default zoom was a viewport showing the whole world. Using the standard infowindows, this meant that when the user clicked on a location in the Northern hemisphere like the North Pole, the infowindow would pop up above the marker and pan the map so that the user just saw a whole lot of grey. Since I hate grey (it's the antithesis of glitter) and wanted a better user experience, Flash API engineer Dmitri Abramov wrote a "smart" info window for me that automatically opens in the direction (top, bottom, left, right) that minimizes panning.
    Check out the demo or source code.
  • JavaScript <-> Flex: Though the map was coded in Flex, many pages on the NORAD site were just JS/HTML. The "RADAR" data was stored as JSON, and common JavaScript functions were used for figuring out the current time and then calculating the current location and phase from that information. So, to avoid replicating all the same logic and data in AS3, we instead used ExternalInterface to send information from the JavaScript to the map, along with some open-source libraries for encoding JSON objects into strings and decoding the strings into AS3 objects.
    Check out the demo or source code.
  • Full Screen: A day before the map was set to go live, I realized that I'd been debugging the map SWF at 100% width/height all the time, when it was in fact going to be embedded inside a 500*450px space on the NORAD site. It depressed me that users wouldn't get to experience the map at the same size, so I searched Google for information on enabling full-screen on Flex apps, and happily discovered it was ridiculously easy to do - just a few lines of code, an "allowFullScreen" param in the HTML, and a toggle-able Flex Image control.
    Check out the demo or source code.

* Okay, yeah, I open-sourced the whole code as well, mostly because I've developed an unhealthy dependence on Google Code's nifty subversion repositories and issue trackers. Finding the NORAD repository is left as an exercise to the reader.

This week in San Francisco: Virtual Globes!

Monday, December 15, 2008

Starting today, over 15,000 geoscientists and educators will gather at the Moscone Center in San Francisco for the Fall Meeting of the American Geophysical Union. Following on from previous years, we are convening a special session on Virtual Globes. This year’s session is titled “Visualizing Scientific Data Using KML and Virtual Globes,” and will take place all day on Thursday 18th December.

There will be over 60 talks, posters and demonstrations from researchers, educators and developers. The session has been organized in collaboration with Google, and they will have plenty of experts on hand at their exhibitor booth to help with KML problems and answer your Google Geo questions. Anyone is welcome to stop by and register for the conference for a day, so if you're in the Bay area, please check it out! The week starts off tonight with Michael Jones, Google’s Chief Technology Advocate, giving the Frontiers of Geophysics Lecture. His talk, “The Spread of Scientific Knowledge from the Royal Society to Google Earth and Beyond” will be held at 6:30pm PST. The lecture will also be broadcast as a live webcast.

Google Earth... in your browser... on your Mac!

Thursday, December 04, 2008

Labels: ,

A long time ago, at a conference not too far away, Google launched the Google Earth Browser Plugin, with the Google Earth API. At the time, we promised that we would bring it to the Mac, and now we have.

Today, we're excited to announce the release of the Google Earth Browser Plugin for Mac OS X 10.4+ (PowerPC and Intel). The Mac plugin is supported on Safari 3.1+ and Firefox 3.0+. The download link should now be available to all users from any Earth API-powered site. We also released a game, Puzzler, in honor of the new Mac plugin. It is, of course, playable on a PC as well. And as usual, it's open source, so you're free to adopt the code.

In addition to the Mac release, we've also upgraded the Windows version of the plugin. See the release notes for more details.

Update to the Google Maps API Terms of Service

Wednesday, November 26, 2008

From time to time we release updates to the terms of service governing our products. We recently released an updated version of the Google Maps API Terms of Service. Based on feedback from that update, we are releasing a revised version today. The Google Maps API TOS is intended to satisfy several goals: it gives Google the rights needed to operate a service which overlays content on the map, gives us the ability to showcase popular mashup sites, and allows us to index and provide search over Maps API sites so that Google users can find them.

What changed and why? A key goal for the November 12th revision was to eliminate a number of unpopular restrictions, including the prohibition on friend finder applications and non-"site" mashups. We also eliminated ambiguity about whether it's OK to use the API w/ password-protected free sites (it is). Additionally, we streamlined the format of the terms, eliminating the need for developers to reference multiple sets of incorporated terms of service, including the Google Terms of Service and the Google Maps Terms of Service to figure out what rights and obligations applied to their use of the Maps API.

That format change appears to have called attention to the "License From You to Google" - section 11 in the November 12th update. That content license has always been part of the Google Maps API Terms of Service, because it is contained in the Google Terms of Service. Both the original and the November 12th updated Terms of Service relied on that provision to ensure Google received a sufficient content license to provide the Maps API service and to promote the service, including by highlighting excellent mashups as we did here. That section does not provide Google a license to all of the content on your Maps API site to use for any purpose, nor is that how we have treated the content from existing Maps API sites that were developed under the terms that existed prior to the November 12th update. Section 11(b), which we initially included in the November 12th update, created a lot of confusion among our API developers who are publishing licensed content. In 11(b) we were trying to be clear that we wanted a broader license from Maps API developers for use of business listings information. However, given the confusion that resulted, we removed that language from today's revision of the terms.

Thank you for using the Google Maps API. We look forward to continuing to create great products together with you.