Free Sample
+ Collection

Google Maps JavaScript API Cookbook

Alper Dincer, Balkan Uraz

This book will help you use the amazing resource that is Google Maps to your own ends. From showing maps on mobiles to creating GIS applications, this lively, recipe-packed guide is all you need.
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849698825
Paperback316 pages

About This Book

  • Add to your website's functionality by utilizing Google Maps' power
  • Full of code examples and screenshots for practical and efficient learning
  • Empowers you to build your own mapping application from the ground up

Who This Book Is For

Google Maps JavaScript API Cookbook is for developers who wish to learn how to do anything from adding a simple embedded map to a website to developing complex GIS applications with the Google Maps JavaScript API. It is targeted at JavaScript developers who know how to get by but who are also seeking the immediacy of recipe-based advice.

Table of Contents

Chapter 1: Google Maps JavaScript API Basics
Creating a simple map in a custom DIV element
Creating a simple fullscreen map
Moving from the Web to mobile devices
Changing map properties programmatically
Changing base maps
Chapter 2: Adding Raster Layers
Styling of Google base maps
Using different tile sources as base maps
Adding tile overlays to maps
Adding image overlays to maps
Changing the transparency of overlays
Creating a heat map
Adding the traffic layer
Adding the transit layer
Adding the bicycling layer
Adding the weather and cloud layers
Adding the Panoramio layer
Chapter 3: Adding Vector Layers
Adding markers to maps
Adding popups to markers or maps
Adding lines to maps
Adding polygons to maps
Adding circles/rectangles to maps
Adding animated lines to maps
Adding KML/GeoRSS layers
Adding GeoJSON to the Google Maps JavaScript API
Adding WKT to the Google Maps JavaScript API
Chapter 4: Working with Controls
Adding and removing controls
Changing the position of controls
Creating and adding a geolocation control
Creating a table of contents control for layers
Adding your own logo as a control
Chapter 5: Understanding Google Maps JavaScript API Events
Creating two synced maps side by side
Getting the coordinates of a mouse click
Creating a context menu on a map
Restricting the map extent
Creating a control that shows coordinates
Creating your own events
Chapter 6: Google Maps JavaScript Libraries
Drawing shapes on the map
Calculating the length/area of polylines and polygons
Encoding coordinates
Searching for and showing nearby places
Finding places with the autocomplete option
Adding drag zoom to the map
Creating custom popups/infoboxes
Chapter 7: Working with Services
Finding coordinates for an address
Finding addresses on a map with a click
Getting elevations on a map with a click
Creating a distance matrix for the given locations
Getting directions for the given locations
Adding Street View to your maps
Chapter 8: Mastering the Google Maps JavaScript API through Advanced Recipes
Adding WMS layers to maps
Adding Fusion Tables layers to maps
Adding CartoDB layers to maps
Accessing ArcGIS Server with the Google Maps JavaScript API
Accessing GeoServer with the Google Maps JavaScript API

What You Will Learn

  • Create simple maps and display them on mobile devices
  • Style your own base maps
  • Add your own tile maps as base maps or overlays
  • Show vector layers on base maps in various types such as points, polylines or polygons
  • Parse various vector formats such as KML, GeoRSS, GeoJSON, WKT, and so on
  • Create a custom UI and customize your own ways to control it
  • Respond to various events including mobile gestures
  • Add additional libraries to extend the capabilities of the API
  • Work with Google Services for geocoding, directions, StreetView, and so on
  • Integrate open source or commercial GIS servers or services

In Detail

Day by day, the use of location data is becoming more and more popular, and Google is one of the main game changers in this area. The Google Maps JavaScript API is one of the most functional and robust mapping APIs used among Geo developers. With Google Maps, you can build location-based apps, maps for mobile apps, visualize geospatial data, and customize your own maps.

Google Maps JavaScript API Cookbook is a practical, hands-on guide that provides you with a number of clear, step-by-step recipes that will help you to unleash the capabilities of the Google Maps JavaScript API in conjunction with open source or commercial GIS servers and services through a number of practical examples of real world scenarios.

This book begins by covering the essentials of including simple maps for Web and mobile, adding vector and raster layers, styling your own base maps, creating your own controls and responding to events, and including your own events.

You will learn how to integrate open source or commercial GIS servers and services including ArcGIS Server, GeoServer, CartoDB, Fusion Tables, and Google Maps Engine with the Google Maps JavaScript API. You will also extend the Google Maps JavaScript API to push its capabilities to the limit with additional libraries and services including geometry, AdSense, geocoding, directions, and StreetView.

This book covers everything you need to know about creating a web map or GIS applications using the Google Maps JavaScript API on multiple platforms.


Read More