Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • OpenLayers 2.10 Beginner's Guide
  • Toc
  • feedback
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)
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
OpenLayers 2.10
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The Map class


OpenLayers' Map class is what drives our maps. All the things we'd like to do with our maps—moving them, zooming, adding layers—all these things are made possible by this class. We've worked extensively with it already by creating a map object, adding controls and layers to it, then telling the map to zoom to the max extent. While we've covered Layers and Controls in pretty good detail, we have yet to really discuss the functionality behind the Map class, the core component of our applications.

In OpenLayers, control and layer objects belong to a map object. Control and layer objects must be hooked up to a map if we want them to do anything. So, we need a map object to actually make a useful map—and as you might imagine, we'll see later in the chapter that it is possible to make an application that uses multiple map objects.

Creating a map object

Before we jump in, let's review the base code for instantiating a map object. We've done this many times before, but a little review...

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