Book Image

OpenLayers 3.x Cookbook - Second Edition

By : Peter J. Langley, Antonio Santiago Perez
Book Image

OpenLayers 3.x Cookbook - Second Edition

By: Peter J. Langley, Antonio Santiago Perez

Overview of this book

OpenLayers 3 is one of the most important and complete open source JavaScript mapping libraries today. Throughout this book, you will go through recipes that expose various features of OpenLayers 3, allowing you to gain an insight into building complex GIS web applications. You will get to grips with the basics of creating a map with common functionality and quickly advance to more complicated solutions that address modern challenges. You will explore into maps, raster and vector layers, and styling in depth. This book also includes problem solving and how-to recipes for the most common and important tasks.
Table of Contents (14 chapters)
OpenLayers 3.x Cookbook Second Edition
About the Authors
About the Reviewer


This chapter talks about vector layers. In addition to raster imagery, vector information is the other important type of data that we can work with in a GIS system. Throughout the coming recipes, we'll summarize the most common and important concepts that you may need to work with in OpenLayers.


We will make some AJAX requests during this chapter. If you're following along with this book's source code, then be sure to download and install Node.js ( and follow the instructions.

In GIS, a real-world phenomenon is represented by the concept of a feature. This can be a place, such as a city or a village; it can be a road or a railway, it can be a region, a lake, the border of a country, or something entirely arbitrary.

Features can have a set of attributes, such as population, length, and so on. These can be represented visually through the use of points, lines, polygons, and so on, using some visual style: color, radius, width, and so on.

As you can...