O'Reilly logo

OpenLayers 2.10 by Erik Hazzard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

  1. 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required