PacktLib: Google Maps JavaScript API Cookbook

Google Maps JavaScript API Cookbook


About the Authors

About the Reviewers


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

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

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

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

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

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

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

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