Plot Multiple Points on Your Own Map

Use the Yahoo! Maps Web Service to plot several locations on a map at once.

An online mapping service such as Yahoo! Maps (http://maps.yahoo.com)is a vast improvement over the multifold paper maps that are stashed in your glove compartment. Enter your starting address and an end address at Yahoo! Maps, and you’ll get a detailed map, along with directions that include every turn you need to make to reach your destination. Finding a single address on a map is easy, but plotting several unique points on an interactive map used to be a task that only map service providers could accomplish.

Yahoo! has opened this ability to anyone with a bit of scripting knowledge, and you can plot dozens of points on a map instantly with the Yahoo! Maps Web Service (http://developer.yahoo.net/maps). The key to plotting several points is building a Yahoo! Maps Annotation file: an XML file with information about the points you want to plot on your map. If you’re familiar with the syndication format RSS, you’re most of the way there. The Yahoo! Maps Annotation file uses the RSS 2.0 format with some proprietary extensions that describe locations. This hack shows how to put together an RSS file that Yahoo! Maps will understand, and it explains how that file plots points on a Yahoo! Map.

Assembling Your Locations

Imagine it’s Saturday morning, and you’ve decided to spend the day going to garage sales in your area. You open the paper, find a list of garage sales in the classified ...

Get Yahoo! Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.