DaylightMap iGoogle Themes

Combining various facets of DaylightMap.com, these themes for your iGoogle home page offer a photorealistic view of the Earth from space. The background changes throughout the day and year to reflect current clouds, seasons, and daylight patterns.

The Short Version

The bad news is that these themes are not yet fully automated, due to some issues in the Google Themes API (details below the fold). The good news is that I've created a workaround, an iGoogle gadget that can be used to bring the themes to life. Here's what you do:

  1. Click on the hemisphere of your choice below.
  2. You'll be prompted to install the Theme Manager gadget. It'll have your Live Planet theme preloaded. [If you already have Theme Manager, you may not see this step.]
  3. After Theme Manager is installed, uncheck Cached next to the Live Planet theme name.

Install links provided by inThemes.

The Long Version

When Google announced their Themes API, I naturally thought of doing a DaylightMap theme right away. I was slightly put off by the fact that one of their API sample themes, Earth-light, was a stylized form of the same concept, so in order to put some distance between theirs and mine I decided to add clouds and seasons, going for a true photo-realistic look. The trouble began when I actually started coding it.

To understand the problem, we need to look at how the Themes API works. Google intended that developers would be able to create themes that change over the course of the day, and on the face of it that's just what DaylightMap needs. But the way a developer does this is by specifying time ranges in the theme source code; for example, if you want a certain header image for midnight to 6:00 AM, you specify 12am-6am in your source code.

The problem here becomes apparent when we realize that there are no time zones – it's all based on the user's local time. Google intends that your theme will be based around the user, so you'll show daytime scenes when it's daytime for the user, and night-time scenes when it's night. But a global theme like mine isn't user-dependent; everyone needs to see the same image of the Earth at the same time, regardless of their local time. And the Themes API has no support for that.

Me, I don't give up so easily. My first attempt was to simply to submit a theme with a single image specifier, pointing back to my server, and then on my server I set up a process to replace that source image once an hour with an updated one. It seemed like a reasonable guess, especially since Themes are part of iGoogle, and other aspects of iGoogle refresh their content every 1-2 hours by default. Also, this approach worked fine when using the technique Google supplies for testing a theme prior to submission.

So I put my first version together and submitted it to the Themes directory. And guess what? When Google accepts your theme and includes it in the Themes directory, your images are copied over and hosted by Google. That's a quote from the API documentation at the time of this writing, a line that's been added since I first submitted my theme. So now I was stuck with a theme in the directory whose description said "near-real-time" but which actually served a static image hosted by Google. And naturally, my comment page (that Google helpfully supplies with each theme listing) began filling up with complaints.

I couldn't even update the theme's description, because once it's in the Google directory you can't touch it. They claim that updates will be applied within 1-2 weeks, but at this writing I have yet to see updates I submitted 6 weeks ago.

Could I not get some help from Google? After all, it's their API, their directory. Well, no, not really. Google's turned into a big faceless corporation that's nigh impossible to contact. There is an official discussion group for the Themes API, but it has very little activity and – unlike other Google API groups, and contrary to claims made at its launch – Google doesn't maintain a presence on it. Theme developers are rather left out in the cold.

So I was on my own. Thrashing around for a fix, I came up with an idea: an iGoogle gadget that would enable everyone to see the theme in the "test mode" I had been using before submitting it, and where I knew it would update. This grew into my Theme Manager, and as a fix it's working pretty well. Not perfectly – installing it is an extra step that's not immediately obvious to people who install the theme, and they often still come to my comment page and complain before someone points them in the right direction – but better than nothing.

But I wanted something better, and returned to work on the theme itself. Which, in the meanwhile, had become far and away the most popular non-Google theme in their directory, with over 100,000 users in its first three weeks. This was cool, certainly, but also meant lots of complaints. I needed a solution.

Remember Google's own Earth-light theme? That theme updates once an hour and the nightside shadow moves around the planet as it should, right? Why can't I follow that example? Well there's a problem there too. Again, because all theme times are local (kind of like politics), even Earth-light was only correct if your locale was on the west coast of the USA, where Google HQ and the designer are located. And Earth-light's comment page was full of complaints from folks everywhere else in the world that it was wrong. However, there was a fix for that, an easier one than my gadget workaround: simply tell iGoogle that you were in California, and your local time would be what Earth-light expected.

So, I decided to implement something similar for my own themes. I captured 24 day/night snapshots, tracking the day/night shadow around the globe, and aligned them for my own local time. I also described the locale fix in the theme's description, so that it'd be more obvious for new users how to make it work correctly. Then I resubmitted both themes to Google, and waited for my changes to filter through into the directory.

Weeks went by with no change. I waited. I replied to comments about my theme. I maintained and improved my Theme Manager. I got increasingly annoyed with the lack of movement in Google's theme directory, so much so that I actually created my own. I waited some more. Still nothing.

Then one day, I happened to be looking at the Earth-light comment page, and noticed that users were saying it had started working correctly for them. Huh? I tried it out myself, and sure enough – no matter where you set your location to, Earth-light showed the correct day/night pattern. So I tried the same test with my own time-sensitive theme, but got entirely different results – mine was still location-dependent. I delved into the source code, and could find no significant difference between theirs and mine. What the heck was it? If I could find the key, I could finally release a version of my own themes that updated correctly, with no kludges or workarounds. Eventually, I found it.

It's the title.

Go ahead, read it again. The freakin' title. If a theme was named "Earth-light", its display was based on Pacific Standard Time; if it was named anything else, it was based on the user's local time. I almost couldn't believe it, but the evidence was right in front of me. I mean, how hokey can you get? A published API with an undocumented special case based on the name?! They fixed their own theme and left everyone else twisting in the wind. You don't expect cheap tricks like this from Google. But there it was, nonetheless.

Well, for me the next step was obvious. A version of my themes, named "Earth-light", with a description explaining about the name. Which brings me up to the time of this writing; I submitted those versions this afternoon.

I'll update this page further as the story continues to develop. In the meanwhile, if you know anybody at Google, see if you can encourage them to get their act together on the Themes API, would you? Thanks.

Sterling Udell, 6 March 2008


27 March 2008

A few days ago the live version of Northern Hemisphere stopped working without more aggressive measures in Theme Manager; nothing I can't work around, but another frustration nonetheless.

What's interesting, however, is that Google's Earth-light theme developed the same problem at the same time, telling me that Google has attempted to run my updates and the name collision caused a failure somewhere. Hopefully this will attract someone's attention, and there'll be some movement on this issue soon.

At the least, it's the first real sign that theme updates are being attempted by Google.


8 May 2008

The good news: A Googler has put in an appearance on the Theme API discussion group, coincidentally soon after I made a stink on the Gadgets API group (which is monitored by G). And for the first time, updates to my themes have been applied in Google's directory.

The bad news: They have yet to address the name-based behavior described above, so in order for my themes to work worldwide, they are stuck being named "Earth-light". Which has led to a new class of complaining on my comments pages, as people accuse me of ripping off the real Earth-light theme. Sigh.