-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

OpenLayers 2.10 Beginner's Guide

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.
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 want v3.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...
Change the font size
Change margin width
Change background colour