Google Maps JavaScript API Cookbook
Download
Introduction
Currently, there are both open source and proprietary alternatives to the Google Maps
JavaScript API, but what makes the API special for developers is that it is a complete solution
with base maps, overlays, and technical capabilities.
The API has been especially exciting for developers because it is very easy to build up generic
outcomes, and at the same time, it has its own tips and tricks and advanced functionalities
within the same box. Therefore, you can swim afloat or dive deep when you are working with
the API.
The Google Maps JavaScript API v3 enabled the quick and easy development of mobile
scenarios, facilitating location-based solution developers to delve into the subject. Regarding
the growth of mobile development, especially location-based applications, the Google Maps
JavaScript API v3 has deserved rightful attention.
Last but not least, no mapping API has ever been as successful as the Google Maps API
without the support of continuously updated and thoroughly handled vector and satellite data.
Google has dedicated immense resources to maintaining the unified structure of the vector
data and its cartographic quality, and this effort is paying off in terms of its API usage.
What this book covers
Chapter 1, Google Maps JavaScript API Basics, instructs you on how to create a simple Google
Maps application centered around a main recipe. The map object and its primary options,
including map types, will be introduced by adding details to the recipe.
Chapter 2, Adding Raster Layers, presents the addition of external raster data through a
series of recipes alongside Google layers such as the Tile, Traffic, Transit, and Weather layers.
Chapter 3, Adding Vector Layers, introduces you to drawing vector features together with the
display of external vector sources such as KML and GeoRSS.
Chapter 4, Working with Controls, explains controls in detail. Creating and customizing a
custom user interface for both the Web and mobile will be introduced in this chapter.
Chapter 5, Understanding Google Maps JavaScript API Events, describes events in detail to
react to map, layer, or marker's behaviors such as zoom end, layer changed, or marker added.
Events will add more interactivity to mapping programming.
Chapter 6, Google Maps JavaScript Libraries, explains the libraries that will extend the
capabilities of the Google Maps JavaScript API in detail. These libraries have different abilities
to increase the power of the Google Maps JavaScript API.
Chapter 7, Working with Services, elaborates on services that will extend the Google Maps
JavaScript API. These services, including Geocoding and Street View, expose the real power
of mapping with the Google Maps JavaScript API.
Chapter 8, Mastering the Google Maps JavaScript API through Advanced Recipes, explains
the integration of external GIS servers and services with the Google Maps JavaScript API.
These includes ArcGIS Server, GeoServer, CartoDB, and Google Fusion Tables with OGC
services such as WMS.
What you need for this book
The Google Maps JavaScript API works with HTML, CSS, and JavaScript code. So, a text editor
with HTML, JavaScript, and CSS handling capabilities will be a good friend while exploring
this book.
For Mac users, there are lots of commercial or free text editors, such as TextWrangler, BBEdit,
Sublime Text, or WebStorm. They all handle HTML, JavaScript, and CSS beautifully.
For Windows users, there are different text editors as well, but Notepad++ is the most used
and recommended one.
Choosing an editor depends on your computer's habits, so there is no exact solution or
recommendation for users to select one editor. Everyone has a different perception that
affects these choices.
There is also need for an HTTP server to implement these recipes. There are a bunch of HTTP
servers including Apache, IIS, and so on. But the installation process of standalone servers
can be a problem for most users. We encourage you to use solutions that bundle HTTP Server,
Database Server, and a scripting language together. XAMPP and MAMP are these kinds of
solutions for the Windows and Mac OS X platforms respectively.
For better user experience, we have created a main application that allows the desired
recipe to run and show its source code. Suppose you have installed and configured a local
web server like XAMPP or MAMP, and the bundle code is copied within the HTTP server root
content folder in the googlemaps-cookbook folder, the user can run the main application
by accessing the http://localhost/googlemaps-cookbook/index.html URL in
the browser.
Who this book is for
This book is great for developers who are interested in adding a simple contact map embedded
in their websites as well as for those who wish to develop real-world complex GIS applications.
It is also for those who want to create map-based info graphics, such as heat maps, from their
geo-related data. It's assumed that you will have some experience in HTML, CSS, and JavaScript
already, and also experience in simple concepts related to GIS and prior knowledge of some GIS
servers or services.
Home Api Development Google Maps JavaScript API Cookbook