Book Image

Google Maps JavaScript API Cookbook

Book Image

Google Maps JavaScript API Cookbook

Overview of this book

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 (15 chapters)
Google Maps JavaScript API Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Finding coordinates for an address


Locating an address or place on the map has always been a tedious task, and the Google Maps JavaScript API eases this task with the geocoding service. Geocoding, in its simplest definition, is to associate geographic coordinates with the address information, be it only a street name, the detailed building number and zip code, or only a locality name.

By having the coordinates of your respective addresses, you can easily overlay them in your map applications.

In this recipe, you will succeed in entering your holiday places and addresses and then map them as markers on top of your base maps in your application.

Getting ready

This recipe will make use of the concepts related to adding vector layers, particularly markers, introduced in the Adding markers to maps recipe in Chapter 3, Adding Vector Layers. It is advised to go through this recipe to have a general understanding of vector layers and their properties.

How to do it…

You can locate your addresses by following...