Using Google Maps imagery
Google Maps is probably the most known web map application around the world. Their imageries, in the way of tiled layers, are well known by people; they are accustomed to their layer style and because of this you may be interested in using them in your own web mapping project.
OpenLayers counts with the OpenLayers.Layer.Google
class, which is in fact a wrapper code around the Google Maps API, that allows us to use the Google Maps tiles in a homogeneous way within the OpenLayers API.
Note
Do not confuse Google Maps API with the Google Maps imagery. Google Maps API is a bunch of JavaScript code, which is free to use, while the access to the Google Maps imagery has some usage restrictions and, depending on the number of hits, will be subject to some payments.
How to do it...
To use Google Maps imagery, perform the following steps:
Create an HTML file and add the OpenLayers dependencies.
Include the Google Maps API as follows:
<script type="text/javascript" src="http://maps...