Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying OpenLayers 2.10 Beginner's Guide
  • Table Of Contents Toc
  • Feedback & Rating feedback
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)
close
close
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)

Overview of this book

Table of Contents (18 chapters)
close
close
OpenLayers 2.10
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 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>
  2. Let's start by...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY