Before you start
This tutorial is for Web application developers interested in adding custom information and behavior to a Google Maps result page. Familiarity with PHP, JavaScript, and XSLT is recommended.
In this tutorial, you will build a Google Mapplet that displays the local weather using the Yahoo Weather RSS feed. You will call a reverse geocoder service (see Prerequisites for a link) using an Ajax request within the Google Mapplets API, which translates the current coordinates of the Google Map into a zip code.
You will implement two solutions: One that calls the Yahoo weather service from JavaScript and displays the weather in the sidebar, and another that calls your own remote Web server for a KML overlay to place on the map. Your remote Web server, running PHP 5.2, will use the XSL module to apply XSLT stylesheets to the RSS XML returned from Yahoo. You will implement two stylesheets: one that translates the Yahoo RSS data into a simpler data structure, to demonstrate insulating your presentation layer (the KML) from the outside data structure, and the other to translate the simpler local data structure into a KML overlay. Finally, you'll apply the overlay to the Google Map.
You'll need the following tools to follow along with this tutorial:
- Development of a Google Mapplet requires that you keep it on a public Web server so Google can read the Mapplet into its cache to render Google Maps results pages. Thus, you need access to a public Web server for this tutorial. Apache Web server version 2.2 is one Web server that will work. See Resources for information on set up and configuration.
- PHP version 5.2.6.
- The reverse geocoder service from geonames.org.
- A Web browser with JavaScript enabled.
- Your favorite programming language editor.


