Dissecting a Dashboard Virtual Earth Widget
Pages: 1, 2, 3
Deploying the Widget
With all these pieces in place, all that remains is to actually install the Widget. This is accomplished by a simple double-click on the virtualearth.wdgt directory from the Finder. You will be prompted to confirm that you'd like to install this Widget, which then takes you to the Dashboard. You're prompted again to confirm you want this Widget, after which you should finally have it.
Well, give it a try! It should look something like this:
Notice that I can perform searches using the built-in search controls. If you have a Mighty Mouse or other scroll mouse, you can zoom in and out using the scroll wheel. And of course you can pan around the map, switch to Aerial or Hybrid, and generally do everything you normally can using Virtual Earth.
The Future
Where can we take our Virtual Earth Dashboard Widget from here? A basic next step might be to include resize capability, although I am not sure if the MapSearchControl offers us this feature. We could also implement a mashup by pulling in some external data and mapping it against our Widget. We could investigate the AllowSystem property list key and the widget.system() call to use external applications to gather information. Don't forget Dashboard Widgets can closely integrate with Apple-specific applications via plugins as documented here.
It is important, of course, not to get carried away and to remember Apple's recommendations regarding whether your Widget is really growing a bit too gnarly for the elegant Dashboard.
Final Thoughts
I hope you enjoyed this brief tour under Dashboard's hood. Of course, if such a rich Web 2.0 control as Virtual Earth can live happily inside the Dashboard, you should be pretty excited about the possibilities. The sky is the limit, and the cleanliness and elegance of the Dashboard as an AJAX programming environment will make it easy for you.
Don't forget to check out more Dashboard Widgets at Apple's download page.
Luke Burton chipped his teeth on C++, and has lately sought refuge in the beautiful world of scripting languages like Ruby and Perl.
Return to the Mac DevCenter
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 6 of 6.
-
I just don't get it
2005-12-07 07:30:34 chrisrimmer [Reply | View]
I'm afraid I've just never 'got' the Dashboard. Why would I want to switch out of the lovely Mac OS X desktop environment into another one which only lets me tell the time and read Dilbert (or whatever). Even putting it inside an ordinary application window wouldn't be so bad, but hijacking the whole desktop? I have actually installed a preference panel that lets me turn off dashboard so I can use my memory and CPU cycles for something more useful . -
I just don't get it
2006-03-04 02:32:43 sk2001 [Reply | View]
I agree that the Dashboard widgets use a lot of memory, about 150 MB each for virtual memory and, surprisingly enough, almost 20 MB of physical RAM (RSIZE). Of course anyone is free to delete (not uninstall) all unused widgets from the Dashboard to reduce memory consumption.
Regarding the cumbersome switching between desktop and Dashboard (I only find it annoying when switching the first time and there are some slowly initialising widgets to be started up):
You may want to try this one: Open a Terminal window and enter
defaults write com.apple.dashboard devmode YES
killall Dock
If you now activate the Dashboard by pressing F12 (or your specific key), begin dragging the widget you want to use. Move at least one pixel and don't release the mouse button. Now press F12 a second time. Dashboard vanishes and you still have the widget sticking to the mouse pointer. You can now place the widget on the desktop anywhere you like. It will always be above any "ordinary" window.
Works great for the calculator, for example. -
I just don't get it
2005-12-07 13:36:52 hagus [Reply | View]
There's no shame in not getting the Dashboard. It suits some people's working style better than others. I tend to use it pretty sparingly, mostly for date lookups, the clock (great for conference calls with other countries), and the calculator.
I recently started working on two 20" cinema displays at home, and found this has reduced my need for the Dashboard considerably. Now if I want a calculator, I just leave one running in an obscure corner of my huge desktop ;)
-
Dashboard
2005-12-06 19:11:17 MtnBiker [Reply | View]
I've no problems with Web 2 or your Widget, but not sure that Dashboard is the best way to access these small "apps." It takes a minute or two for all my Widgets to load. We should be able to have a drop down menu to select whichever one we want. I know someone has written something to allow this, but it should be part of the OS. -
Dashboard
2005-12-07 10:13:40 KarlRove [Reply | View]
it works great for me. i have all the programming references that i need to use throughout the day like CSS, PHP, MYSQL, HTML manuals, etc. when i need to look something up, i hit F12, search for what i need, hit F12 again, and i'm back to what i was doing. -
Dashboard
2005-12-06 19:27:22 hagus [Reply | View]
Sounds like you need a faster Mac! ;) But yes, performance remains a concern for Dashboard widgets. There is a trade-off in that you want them 'ready to go' when you hit the Dashboard button, but you don't want them loading, caching, and being mischievous in the background while you're working. It is something that Dashboard developers have to bear in mind, and something that Apple will incrementally improve over time.





