Introduction

In June of 2008, while this book was being written, the Google Maps API celebrated its third birthday. In Internet terms, three is a respectable age, and the Maps API is visibly maturing. It's quite common now to find Google's excellent maps embedded in sites all over the Web; accordingly, Google Maps "expertise" is becoming more common.

With this ubiquity, however, comes a certain danger of mediocrity. The question is no longer just, "Can I put a Google map on my website?" Instead, there's now sufficient maturity in the field that the question should be, "How can I put the best possible Google map on my site?" There are a lot of ways to answer that question, involving considerations of good web design techniques, usability, coding best practices, and standards compliance. One of the major goals for this book is to put those kinds of answers in your hands, in ways that you can immediately use.

In fact, the last item on that list, standards compliance, is itself a big reason for writing this book. The existence of (and adherence to) geodata-publishing standards like KML and GeoRSS enables the rich world of map mashups, and by extension, the emerging geographic Web. It's a powerful and exciting movement, one that Google's mapping initiatives are supporting more and more strongly, and it's not one that's well covered in any other book.

Finally, as the API matures, I believe that the time has come to make it more accessible to nonprogrammers; that's the primary goal for this book, its real reason for being. Although some coding is unavoidable—the "P" in API stands for Programming, after all—the web-based nature of Google Maps means that it is fundamentally within the reach of anyone with some experience building web sites. But until now, all the Maps API books have been written for an audience of developers. There have been scattered tutorials and examples online, but no complete, coherent guide for beginners. So I wrote one: the book you're now holding.

Who This Book Is For

Accordingly, you don't need a programming or development background to benefit from this book. What you do need is a bit of grounding in web page design and construction. That's not to say that you need vast professional experience in these areas, simply that you're not completely put off by talk of XHTML and JavaScript.

Basic Web Architecture

Since all Google maps reside on web pages, you need to be comfortable with the basics of XHTML and CSS, at least enough to recognize what's going on inside a page. I'll be giving you complete code in my examples, but if you're going to integrate the concepts into your own pages, you'll need some idea of what goes where.

And because the native language of Google Maps is JavaScript, it would also be beneficial if you have seen JavaScript before, even at the level of occasional event handlers in a web page. If not, you'll find a JavaScript primer in Appendix B to help you over the rough spots.

In addition, you'll need to be familiar with the basics of web publishing, such as how to edit XHTML source files, view them in a browser, and upload them to a web server. Finally, you need to be comfortable with URLs and their structure.

Programming Experience Optional

On the other hand, I'm not saying that any programming experience you may have will be wasted, or that this isn't the book for you more seasoned developers. There's no getting away from the fact that Google Maps mashups involve some programming, so there's no doubt that some development background will be helpful; the more you have, the faster you'll progress.

In particular, this book will be a good fit if you have some non-web (or non-JavaScript) development experience, perhaps with another programming language or on another platform. Once you become familiar with JavaScript, you'll find that the code herein is quite elementary, and you'll be up and running in no time.

But to reiterate, programming experience is not required.

How This Book Is Structured

This book covers the use of Google's two major web mapping tools, the Maps and Mapplets APIs, with a particular focus on their use with the KML and GeoRSS dialects of geoXML. So the first two parts of the book each cover the use of one of these APIs, from fundamentals through fully functional examples. Then the third part brings it all together with more advanced, real-world code spanning both APIs.

Part 1: The Geoweb and the Google Maps API

  • Chapter 1, Introduction to the Geoweb, lays the foundation for effective mashup development by establishing the basic concepts and data formats underlying the geographic Web.
  • Chapter 2, Getting Started with the Maps API, is a gentle introduction to the integration of a Google map onto a web page, covering all the basics.
  • Chapter 3, Consuming GeoXML in the Maps API, moves the basic map integration into the geoweb proper by mashing up external geodata.
  • Chapter 4, Building Out Your Map Page, takes the map-enabled web page from Chapter 2 and adds more robust interactions with the user and the rest of the page.
  • Chapter 5, Your Map and the Real World, covers practical topics such as geocoding, traffic displays, Street View eye-level panoramas, and map advertising.

Part 2: Mashing Up Google Maps with Mapplets

  • Chapter 6, Introduction to Mapplets, shifts the focus to Google's other web-mapping API, discussing how (and why) to get your own content onto maps.google.com.
  • Chapter 7, Creating a Mapplet, walks you through your first mapplet, with an emphasis on the differences from (and similarities to) the original Maps API.
  • Chapter 8, Taking Mapplets Further, examines the two major types of mapplets (geodata and functionality), including plenty of tips on how to build effective mapplets yourself.

Part 3: Ready for the Big Leagues

  • Chapter 9, Intermediate API Topics, takes your map and mapplet development to the next level with coverage of custom markers, verified geocoding, large dataset handling, and cross-API development.
  • Chapter 10, Producing Geodata, shifts the focus from the web client to the server as it teaches you how to produce KML and GeoRSS, including database utilization and geo-search optimization.
  • Chapter 11, Case Study: Satellite-Friendly Campground Directory, brings everything together with a guided tour of satellitefriendly.com, a real web site successfully using geodata to drive Google Maps.

Appendixes

  • Appendix A, Mapping Fundamentals, provides an API-oriented summary of such topics as coordinate formats and map projections.
  • Appendix B, A JavaScript Primer, covers all the basics of this powerful (but often misunderstood) programming language.
  • Appendix C, JavaScript Techniques for Map Developers, gets you started with JavaScript debugging and then gives a few additional coding techniques that you should find useful.
  • Appendix D, Mapping Resources Online, points you to all the best places on the Web to find Google Map-related information.

Downloading the Code

All of the code in numbered listings throughout this book can be found on the book's web site, http://sterlingudell.com/bgmm. It is also available in zip file format in the Downloads section of the Apress web site (apress.com).

Contacting the Author

If you have any comments or additional questions relating to this book, I'd love to hear from you! Full contact information can be found on sterlingudell.com, or you can e-mail me directly at [email protected].

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.9.138