Cover image for Beginning Google maps applications with PHP and Ajax : from novice to professional
Title:
Beginning Google maps applications with PHP and Ajax : from novice to professional
Personal Author:
Publication Information:
Berkeley : Apress ; New York : Distributed to the Book trade worldwide by Springer-Verlag, c2006.
Physical Description:
xxiii, 358 p. : ill., maps ; 24 cm.
ISBN:
9781590597071
General Note:
Includes index

"The expert's voice in Web development"--Cover

"Covers API version 2, including Google's geocoder!"--Cover

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010293829 TK5105.8885.A52 P87 2006 Open Access Book Book
Searching...

On Order

Summary

Summary

Until recently, building interactive web-based mapping applications has been a cumbersome affair. This changed when Google released its powerful Maps API. Beginning Google Maps Applications with PHP and Ajax was written to help you take advantage of this technology in your own endeavorswhether you're an enthusiast playing for fun or a professional building for profit. This book covers version 2 of the API, including Google's new Geocoding service.

Authors Jeffrey Sambells, Cameron Turner, and Michael Purvis get rolling with examples that require hardly any code at all, but you'll quickly become acquainted with many facets of the Maps API. They demonstrate powerful methods for simultaneously plotting large data sets, creating your own map overlays, and harvesting and geocoding sets of addresses. You'll see how to set up alternative tile sets and where to access imagery to use for them. The authors even show you how to build your own geocoder from scratch, for those high-volume batch jobs.

As well as providing hands-on examples of real mapping projects, this book supplies a complete reference for the Maps API, along with the relevant aspects of JavaScript, CSS, PHP, and SQL. Visit the authors' website for additional tips and advice.


Table of Contents

Forewordp. xv
About the Authorsp. xix
About the Technical Reviewerp. xxi
Acknowledgmentsp. xxiii
Part 1 Your First Google Maps
Chapter 1 Introducing Google Mapsp. 3
KML: Your First Mapp. 3
Wayfaring: Your Second Mapp. 5
Adding the First Pointp. 6
Adding the Flight Routep. 7
Adding the Destination Pointp. 8
Adding a Driving Routep. 9
What's Next?p. 10
Chapter 2 Getting Startedp. 13
The First Mapp. 13
Keying Upp. 13
Examining the Sample Mapp. 15
Specifying a New Locationp. 16
Separating Code from Contentp. 18
Cleaning Upp. 20
Basic Interactionp. 21
Using Map Control Widgetsp. 21
Creating Markersp. 21
Opening Info Windowsp. 23
A List of Pointsp. 26
Using Arrays and Objectsp. 26
Iteratingp. 28
Summaryp. 29
Chapter 3 Interacting with the User and the Serverp. 31
Going on a Treasure Huntp. 32
Creating the Map and Marking Pointsp. 33
Starting the Mapp. 33
Listening to User Eventsp. 35
Asking for More Information with an Info Windowp. 37
Creating an Info Window on the Mapp. 38
Embedding a Form into the Info Windowp. 39
Avoiding an Ambiguous Statep. 44
Controlling the Info Window Sizep. 46
Using Google's Ajax Objectp. 48
Saving Data with GXmlHttpp. 49
Parsing the XML Document Using DOM Methodsp. 54
Retrieving Markers from the Serverp. 57
Adding Some Flairp. 59
Summaryp. 62
Chapter 4 Geocoding Addressesp. 63
Creating an XML File with the Address Datap. 63
Using Geocoding Web Servicesp. 65
Requirements for Consuming Geocoding Servicesp. 66
The Google Maps API Geocoderp. 67
The Yahoo Geocoding APIp. 75
Geocoder.usp. 80
Geocoder.cap. 83
Services for Geocoding Addresses Outside Google's Coveragep. 85
Caching Lookupsp. 86
Building a Store Location Mapp. 90
Summaryp. 93
Part 2 Beyond the Basics
Chapter 5 Manipulating Third-Party Datap. 97
Using Downloadable Text Filesp. 97
Downloading the Databasep. 98
Parsing CSV Datap. 101
Optimizing the Importp. 102
Using Your New Database Schemap. 106
Screen Scrapingp. 113
A Scraping Examplep. 114
Screen Scraping Considerationsp. 117
Summaryp. 118
Chapter 6 Improving the User Interfacep. 119
CSS: A Touch of Stylep. 119
Maximizing Your Mapp. 120
Adding Hovering Toolbarsp. 121
Creating Collapsible Side Panelsp. 124
Scripted Stylep. 126
Switching Up the Body Classesp. 126
Resizing with the Power of JavaScriptp. 129
Populating the Side Panelp. 131
Getting Side Panel Feedbackp. 134
Warning, Now Loadingp. 136
Data Point Filteringp. 139
Showing and Hiding Pointsp. 140
Discovering Groupingsp. 140
Creating Filter Buttonsp. 141
Summaryp. 143
Chapter 7 Optimizing and Scaling for Large Data Setsp. 145
Understanding the Limitationsp. 145
Streamlining Server-Client Communicationsp. 146
Optimizing Server-Side Processingp. 148
Server-Side Boundary Methodp. 149
Server-Side Common Point Methodp. 155
Server-Side Clusteringp. 161
Custom Detail Overlay Methodp. 167
Custom Tile Methodp. 176
Optimizing the Client-Side User Experiencep. 186
Client-Side Boundary Methodp. 187
Client-Side Closest to a Common Point Methodp. 188
Client-Side Clusteringp. 191
Further Optimizationsp. 196
Summaryp. 198
Chapter 8 What's Next for the Google Maps API?p. 199
Driving Directionsp. 199
Integrated Google Servicesp. 200
KML Datap. 202
More Data Layersp. 202
Beyond the Enterprisep. 204
Interface Improvementsp. 204
Summaryp. 205
Part 3 Advanced Map Features and Methods
Chapter 9 Advanced Tips and Tricksp. 209
Debugging Mapsp. 209
Interacting with the Map from the APIp. 210
Helping You Find Your Placep. 211
Force Triggering Events with GEventp. 212
Creating Your Own Eventsp. 214
Creating Map Objects with GOverlayp. 214
Choosing the Pane for the Overlayp. 214
Creating a Quick Tool Tip Overlayp. 216
Creating Custom Controlsp. 220
Creating the Control Objectp. 222
Creating the Containerp. 222
Positioning the Containerp. 222
Using the Controlp. 223
Adding Tabs to Info Windowsp. 223
Creating a Tabbed Info Windowp. 224
Gathering Info Window Information and Changing Tabsp. 226
Creating a Custom Info Windowp. 226
Creating the Overlay Object and Containersp. 232
Drawing a LittleInfoWindowp. 232
Implementing Your Own Map Type, Tiles, and Projectionp. 237
GMapType: Gluing It Togetherp. 237
GProjection: Locating Where Things Arep. 238
GTileLayer: Viewing Imagesp. 244
The Blue Marble Map: Putting It All Togetherp. 247
Summaryp. 258
Chapter 10 Lines, Lengths, and Areasp. 261
Starting Flatp. 261
Lengths and Anglesp. 262
Areasp. 263
Moving to Spheresp. 266
The Great Circlep. 266
Great-Circle Lengthsp. 268
Area on a Spherical Surfacep. 269
Working with Polylinesp. 274
Building the Polylines Demop. 274
Expanding the Polylines Demop. 280
What About UTM Coordinates?p. 281
Running Afoul of the Date Linep. 283
Summaryp. 284
Chapter 11 Advanced Geocoding Topicsp. 285
Where Does the Data Come From?p. 285
Sample Data from Government Sourcesp. 286
Sources of Raw GIS Datap. 289
Geocoding Based on Postal Codesp. 290
Grabbing the TIGER/Line by the Tailp. 294
Understanding and Defining the Datap. 295
Parsing and Importing the Datap. 299
Building a Geocoding Servicep. 305
Summaryp. 311
Part 4 Appendixes
Appendix A Finding the Data You Wantp. 315
Knowing What to Look For: Search Tipsp. 315
Finding the Informationp. 315
Specifying Search Termsp. 316
Watching for Errorsp. 316
The Cat Came Back: Revisiting the TIGER/Linep. 316
More on Airportsp. 318
The Government Standard: The Geonames Datap. 319
Shake, Rattle, and Roll: The NOAA Goldminep. 319
For the Space Aficionado in Youp. 321
Crater Impactsp. 321
UFO/UAP Sightingsp. 322
Appendix B Google Maps APIp. 323
class GMap2p. 323
GMap2 Constructorp. 323
GMap2 Methodsp. 324
class GMapOptionsp. 328
GMapOptions Propertiesp. 328
enum GMapPanep. 328
GMapPane Constantsp. 329
class GKeyboardHandlerp. 329
GKeyboardHandler Bindingsp. 329
GKeyboardHandler Constructorp. 329
interface GOverlayp. 329
GOverlay Constructorp. 330
GOverlay Static Methodp. 330
GOverlay Abstract Methodsp. 330
class GInfoWindowp. 330
GInfoWindow Methodsp. 330
GInfoWindow Eventp. 331
class GInfoWindowTabp. 331
GInfoWindowTab Constructorp. 331
class GInfoWindowOptionsp. 331
GInfoWindowOptions Propertiesp. 331
class GMarkerp. 331
GMarker Constructorp. 332
GMarker Methodsp. 332
GMarker Eventsp. 332
class GMarkerOptionsp. 333
GMarkerOptions Propertiesp. 333
class GPolylinep. 333
GPolyline Constructorp. 333
GPolyline Methodsp. 333
GPolyline Eventp. 334
class Glconp. 334
Glcon Constructorp. 334
Glcon Constantp. 334
Glcon Propertiesp. 334
class GPointp. 335
GPoint Constructorp. 335
GPoint Propertiesp. 335
GPoint Methodsp. 335
class GSizep. 335
GSize Constructorp. 336
GSize Propertiesp. 336
GSize Methodsp. 336
class GBoundsp. 336
GBounds Constructorp. 336
GBounds Propertiesp. 336
GBounds Methodsp. 336
class GLatLngp. 337
GLatLng Constructorp. 337
GLatLng Methodsp. 337
GLatLng Propertiesp. 338
class GLatLngBoundsp. 338
GLatLngBounds Constructorp. 338
GLatLngBounds Methodsp. 338
interface GControlp. 339
GControl Constructorp. 339
GControl Methodsp. 339
class GControlp. 339
GControl Constructorsp. 339
class GControlPositionp. 339
GControlPosition Constructorp. 340
enum GControlAnchorp. 340
GControlAnchor Constantsp. 340
class GMapTypep. 340
GMapType Constructorp. 340
GMapType Methodsp. 340
GMapType Constantsp. 341
GMapType Eventp. 341
class GMapTypeOptionsp. 341
GMapTypeOptions Propertiesp. 342
interface GTileLayerp. 342
GTileLayer Constructorp. 342
GTileLayer Methodsp. 342
GTileLayer Eventp. 343
class GCopyrightCollectionp. 343
GCopyrightCollection Constructorp. 343
GCopyrightCollection Methodsp. 343
GCopyrightCollection Eventp. 343
class GCopyrightp. 343
GCopyright Constructorp. 343
GCopyright Propertiesp. 344
interface GProjectionp. 344
GProjection Methodsp. 344
class GMercatorProjectionp. 344
GMercatorProjection Constructorp. 344
GMercatorProjection Methodsp. 345
namespace GEventp. 345
GEvent Static Methodsp. 345
GEvent Eventp. 346
class GEventListenerp. 346
namespace GXmlHttpp. 346
GXmlHttp Static Methodp. 346
namespace GXmlp. 346
GXml Static Methodsp. 347
class GXsltp. 347
GXslt Static Methodsp. 347
namespace GLogp. 347
GLog Static Methodsp. 347
enum GGeoStatusCodep. 347
GGeoStatusCode Constantsp. 348
class GClientGeocoderp. 348
GClientGeocoder Constructorp. 348
GClientGeocoder Methodsp. 348
class GGeocodeCachep. 348
GGeocodeCache Constructorp. 349
GGeocodeCache Methodsp. 349
class GFactualGeocodeCachep. 349
GFactualGeocodeCache Constructorp. 349
GFactualGeocodeCache Methodp. 349
Functionsp. 349
Indexp. 351