Chapter 6. API Tips and Tricks

Hacks 51–61: Introduction

The official Google Maps API makes a lot of things easy. Here are some hacks that push the API in new directions and extend the API with external libraries. Tricks such as filling your whole 21-inch flat panel display with a map, customizing your info windows with an embedded map the way the driving directions work, and integrating Flash with your maps.

You can even add custom labels and photographs on top of your Google Maps. Perhaps this technique reaches the height of elegance (absurdity?) when used to compare the size of Burning Man with New York’s Central Park.

The chapter ends with several tricks to allow you to use one developer’s key for multiple domains and directories. Do you really want to manage multiple keys because you have the domain http://mydomain.com and you serve the same pages from it and http://www.mydomain.com? I didn’t think so!

Make a Fullscreen Map the Right Way

Map too big? Map too small? Flex those pixels into shape!

Imagine you’re the proud new owner of a big, shiny 21-inch flat-panel display, and you surf to your favorite Google Maps web site—only to find it still confines you to a tiny little 3-inch-square map. It’s an embarrassment, to say the least. Likewise, think about those poor fellows with small monitors who are scrolling until their fingers fall off to get around your gigantic 1600 x 1200–pixel map. Such sites ought to come with warning labels about claustrophobia.

A good Google Map stretches ...

Get Google Maps 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.