Time for Action – using Goole Maps V3 (standard way)
Let's create a map using V3 of the Google Maps API. We've already done this in Chapter 3, so you should be somewhat familiar with it. This is the standard way to use the Google Maps Layer, and you should use this method unless you specifically need a layer type in V2 that V3 does not yet support.
Note
With versions of OpenLayers prior to 2.10, accessing Google Maps V3 may not work.
Version 3 of the Google Maps API does not require an API key. However, you still must include the following in your
<head>
section, so OpenLayers knows where to look for the Google Maps API library. We'll be asking the map's API and specify that we wantv3.2
of the Google Maps API (you can leave the&v=3.2
parameter if you'd like to let Google Maps provide the latest version for you automatically). Add this before your OpenLayers inclusion script:<script src="http://maps.google.com/maps/api/js?sensor=false&v=3.2"></script>
Let's start by...