Dissecting a Dashboard Virtual Earth Widgetby Luke Burton
The "Web 2.0" craze has taken a firm hold of the online tech community, penetrating into the computer of every 14-year-old PHP newbie, through to the cubicles and meeting rooms of Redmond and the Googleplex. Giddy as we are with excitement about another "paradigm shift" (a phrase I haven't heard since, oh, late 1998), it's easy to forget that Web 2.0 has to actually do something useful for us in the long run to stay sustainable.
In my opinion, the flagship application of Web 2.0 remains online mapping, as seen with Google Maps and MSN Virtual Earth. These services are being stretched to unforeseen limits through the endless possibilities of the mashup, making the geospace jump through some amazing hoops.
Playing Host to Web 2.0
Most developers of Web 2.0 apps focus on deploying their creations through a traditional browser interface. But for Mac users, a perfectly delightful container for your Web 2.0 apps is staring you right in the face. It's the Dashboard.
Virtual Earth and the Dashboard
In this tutorial, I'll walk you through a complete Dashboard implementation of Virtual Earth. If you're impatient, you can jump directly to the completed Widget by visiting my homepage and download it directly.
If you're unfamiliar with the basics of using Virtual Earth in your own web page, visit Via Virtual Earth's tutorials page and brush up first. It's basic stuff, but important groundwork.
The Dashboard Environment
Apple has a comprehensive section on their developer pages describing the Dashboard environment. But to summarize, the four basic components you need for a Widget are:
- An HTML file that defines the user interface for the Widget
- A default background image in PNG format
- An icon image to represent the Widget in the Widget Bar
- An XML-formatted property list that contains various Widget metadata
In this case, you'll put all this into a directory called virtualearth.wdgt.
Designing the Widget
I admit to being less than a genius when it comes to Photoshop. However, I can still knock out something that would make a graphic designer sigh painfully (as opposed to burst with gales of laughter). I thought maybe a bezeled stone sort of look would be a suitably flagrant violation of Apple's user interface guidelines. This is named Default.png.
It's worth noting that the minimum dimensions of the Virtual Earth MapSearchControl forced me to produce a Widget this large; I would have preferred something slightly smaller.
I also pilfered the Via Virtual Earth logo and turned it into a transparent png. This file is named Icon.png.
So now you just need to organize for MapSearchControl to be displayed inside this Widget.