Google Maps Hacks by Rich Gibson and Schuyler Erle Copyright 2006 O Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com. Editor: Simon St.Laurent Production Editor: Jamie Peppard Copyeditor: Derek Di Matteo Indexer: Nancy Crumpton Cover Designer: Marcia Friedman Interior Designer: David Futato Cover Illustrator: Karen Montgomery Illustrators: Robert Romano, Jessamyn Read, and Lesley Borash Printing History: January 2006: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O Reilly logo are registered trademarks of O Reilly Media, Inc. The Hacks series designations, Google Maps Hacks, the image of an antique globe, and related trade dress are trademarks of O Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. Small print: The technologies discussed in this publication, the limitations on these technologies that technology and content owners seek to impose, and the laws actually limiting the use of these technologies are constantly changing. Thus, some of the hacks described in this publication may not work, may cause unintended harm to systems on which they are used, or may not be consistent with applicable user agreements. Your use of these hacks is at your own risk, and O Reilly Media, Inc. disclaims responsibility for any damage or expense resulting from their use. In any event, you should take care that your use of these hacks does not violate any applicable laws, including copyright laws. This book uses RepKover, a durable and flexible lay-flat binding. ISBN: 0-596-10161-9 [M] [5/06]
This excerpt is protected by copyright law. It is your responsibility to obtain permissions necessary for any proposed use of this material. Please direct your inquiries to permissions@oreilly.com.
H A C K #29 Hack Find the Best Gasoline Prices Drive your mouse for cheaper fuel and then catch a movie. HACK Find the Best Gasoline Prices #29 My friends in construction spend a lot of time driving up and down Highway 101, and they all know where the cheap gas is. I spend my time sitting in front of a computer, but thanks to http://www.ahding.com/cheapgas/, I also know where the cheap gas flows. What a Gas! The Cheap Gas site in Figure 4-1 uses data from http://www.gasbuddy.com/, which aggregates user reports of gas prices so that everyone can benefit. You can also contribute to the Gas Buddy web site by becoming one of their volunteer spotters, thus gratifying your natural human desire to tell other people something that they don t know. #29 Figure 4-1. Where are the deals? After you pick a city, the site lists gas stations on the side bar and markers on the map. The green icons represent the lowest half of gas stations by price and the red icons are the high half. As shown in Figure 4-1, each station has a marker with more information. What is interesting about this example is the integration with http://www. gasbuddy.com/. GasBuddy.com provides the database of cheap gas, but is not run by cartographers, so Ahding.com was able to create the now-classic mashup. Chapter 4, On the Road with Google Maps 115
HACK #29 Find the Best Gasoline Prices What causes gas price variations? An interesting project in geospatial analysis would be to see if one could draw any conclusions about why there is such variation in prices from station to station. Overlaying different thematic layers and doing calculations based on multiple data sets is exactly what a Geographic Information System (GIS) is all about, but Google Maps has shown that there has been an enormous demand for an easy-to-use put a push pin on a map solution. That is now a solved problem! GasWatch Once you get your fuel price woes straightened out, you can click on the Movies link at http://www.ahding.com/movie/ and use the same basic interface to query the Internet Movie Database (http://www.imdb.com) to check out local movies. Another low-cost-gasoline solution is GasWatch by Adrian Gonzales, which is available from http://www.widgetgallery.com/view.php?widget=36500. This is a widget that will run under Konfabulator for Windows and Mac OS X (the grass is greener on both sides) and show you the best prices for gas. GasWatch shows you the lowest priced gas in your ZIP Code. It also provides a handy button to show a map to the gas station. Maps for Mac users provided by Google Maps. To install the widget you need Konfabulator (http://www.konfabulator.com/ download). Konfabulator is a JavaScript environment for your desktop. People can write small programs called widgets, and you can run them under Konfabulator. For Mac OS X, download the disk image (.dmg) file. When it is finished downloading, mount the.dmg by double-clicking on it. When the folder opens, drag the icon into your applications folder. Now you can download the GasWatch widget. Double-click and it will prompt for your ZIP Code, and then sit quietly on your Desktop, as shown in Figure 4-2, letting you know the current cheapest local gas prices. Figure 4-2. Cheap gas on your desktop 116 Chapter 4, On the Road with Google Maps
HACK Find the Best Gasoline Prices #29 Clicking on the Map button will bring up Google Maps with this address highlighted. This is a great example of the value to be gained from connecting different sources of data in new ways. Chapter 4, On the Road with Google Maps 117