Book Image

OpenLayers 3: Beginner's Guide

By : Thomas Gratier, Paul Spencer, Erik Hazzard
Book Image

OpenLayers 3: Beginner's Guide

By: Thomas Gratier, Paul Spencer, Erik Hazzard

Overview of this book

<p>This book is a practical, hands-on guide that provides you with all the information you need to get started with mapping using the OpenLayers 3 library.</p> <p>The book starts off by showing you how to create a simple map. Through the course of the book, we will review each component needed to make a map in OpenLayers 3, and you will end up with a full-fledged web map application. You will learn the key role of each OpenLayers 3 component in making a map, and important mapping principles such as projections and layers. You will create your own data files and connect to backend servers for mapping. A key part of this book will also be dedicated to building a mapping application for mobile devices and its specific components.</p>
Table of Contents (22 chapters)
OpenLayers 3 Beginner's Guide
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 3. Charting the Map Class

The Map class is, as you have probably realized by now, the core piece behind your map. The map object(s) you create is the most important thing behind your map, as without a map object you can't do anything with layers or controls. In this chapter, we'll talk about the Map class, which we've been taking for granted so far.

We will also introduce the concept of a view, which is used to change what we see in a map, and several core concepts you'll need to understand the rest of this book.

We used the Map and View classes so far in this book, without really understanding what's going on. This chapter aims to not only explain how and why we've been doing things, but will also provide thorough coverage of two core classes—the Map and View classes. Specifically, we'll look at:

  • What the Map class is

  • How the Map class relates to the other classes we've discussed

  • Options that can be used when creating a map

  • Using functions of the Map class

  • Using the View class to change...