Google Maps JavaScript API Cookbook

Book description

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.

  • 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

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.

Table of contents

  1. Google Maps JavaScript API Cookbook
    1. Table of Contents
    2. Google Maps JavaScript API Cookbook
    3. Credits
    4. About the Authors
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Google Maps JavaScript API Basics
      1. Introduction
      2. Creating a simple map in a custom DIV element
        1. Getting ready
        2. How to do it…
        3. How it works...
      3. Creating a simple fullscreen map
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
      4. Moving from the Web to mobile devices
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
      5. Changing map properties programmatically
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      6. Changing base maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
    9. 2. Adding Raster Layers
      1. Introduction
      2. Styling of Google base maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
      3. Using different tile sources as base maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      4. Adding tile overlays to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
      5. Adding image overlays to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
      6. Changing the transparency of overlays
        1. Getting ready
        2. How to do it…
        3. How it works...
      7. Creating a heat map
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
      8. Adding the traffic layer
        1. Getting ready
        2. How to do it…
        3. How it works...
      9. Adding the transit layer
        1. Getting ready
        2. How to do it…
        3. How it works...
      10. Adding the bicycling layer
        1. Getting ready
        2. How to do it…
        3. How it works...
      11. Adding the weather and cloud layers
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
      12. Adding the Panoramio layer
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
    10. 3. Adding Vector Layers
      1. Introduction
      2. Adding markers to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
      3. Adding popups to markers or maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      4. Adding lines to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      5. Adding polygons to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      6. Adding circles/rectangles to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
      7. Adding animated lines to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
      8. Adding KML/GeoRSS layers
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      9. Adding GeoJSON to the Google Maps JavaScript API
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      10. Adding WKT to the Google Maps JavaScript API
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
    11. 4. Working with Controls
      1. Introduction
      2. Adding and removing controls
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
      3. Changing the position of controls
        1. Getting ready
        2. How to do it…
        3. How it works...
      4. Creating and adding a geolocation control
        1. Getting ready
        2. How to do it…
        3. How it works...
      5. Creating a table of contents control for layers
        1. Getting ready
        2. How to do it…
        3. How it works...
      6. Adding your own logo as a control
        1. Getting ready
        2. How to do it…
        3. How it works...
    12. 5. Understanding Google Maps JavaScript API Events
      1. Introduction
      2. Creating two synced maps side by side
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more…
        5. See also
      3. Getting the coordinates of a mouse click
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more…
        5. See also
      4. Creating a context menu on a map
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      5. Restricting the map extent
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      6. Creating a control that shows coordinates
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      7. Creating your own events
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
    13. 6. Google Maps JavaScript Libraries
      1. Introduction
      2. Drawing shapes on the map
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. Calculating the length/area of polylines and polygons
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      4. Encoding coordinates
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Searching for and showing nearby places
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Finding places with the autocomplete option
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      7. Adding drag zoom to the map
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      8. Creating custom popups/infoboxes
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
    14. 7. Working with Services
      1. Introduction
      2. Finding coordinates for an address
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
        5. See also
      3. Finding addresses on a map with a click
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      4. Getting elevations on a map with a click
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      5. Creating a distance matrix for the given locations
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      6. Getting directions for the given locations
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      7. Adding Street View to your maps
        1. Getting ready
        2. How to do it…
        3. How it works...
    15. 8. Mastering the Google Maps JavaScript API through Advanced Recipes
      1. Introduction
      2. Adding WMS layers to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more…
        5. See also
      3. Adding Fusion Tables layers to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      4. Adding CartoDB layers to maps
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
      5. Accessing ArcGIS Server with the Google Maps JavaScript API
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more…
        5. See also
      6. Accessing GeoServer with the Google Maps JavaScript API
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. See also
    16. Index

Product information

  • Title: Google Maps JavaScript API Cookbook
  • Author(s): Alper Dincer, Balkan Uraz
  • Release date: December 2013
  • Publisher(s): Packt Publishing
  • ISBN: 9781849698825