
287 - ADD A GADGET TO GOOGLE MAPS
HaCK
# 116
You can nd more mapplets by following the “Browse the directory” link on top of the My Maps tab.
Note that within the directory, you can use the Add by URL link next to the search box to include
mapplets which are not yet in the directory.
How would you go about writing such a mapplet service yourself? Mapplets are a special form of
Google Gadgets that utilize the Google Maps API , so you need to understand
a bit of both of these components. Google Gadgets are XML les stored online, and are made up of
HTML, stylesheet denitions, and JavaScript; and in the case of mapplets, that JavaScript makes
use of the Google Maps API library.
No matter where a mapplet was originally stored, Google will copy it to their own domain, gmodules.com,
before showing it to the user; this caching will last for some time and will keep the load on your server low.
To get an impression of how this all ts together, run the Hello World sample mapplet that Google
provides. At Google Maps, click on My Maps, and then click the “Browse the directory” link. Switch to
the section Developer Tools on the left, and add the gadget called Mapplet Scratch Pad by clicking
the Add It to Maps button, as pictured in Figure 11-10.
Click Back to Google Maps on top, and you will now see that the Mapplet Scratch Pad is enabled. ...