Book Image

OpenLayers 3.x Cookbook - Second Edition

By : J. Langley, Antonio Santiago
Book Image

OpenLayers 3.x Cookbook - Second Edition

By: J. Langley, Antonio Santiago

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 (9 chapters)
8
Index

Introduction

Controls allow us to navigate around the map, play with layers, zoom in or out, and perform actions, such as editing features, measuring distances, and so on. In essence, controls allow us to interact.

OpenLayers comes with controls that are visually represented on the map through DOM elements and can be styled with CSS. Such controls, such as Attribution, FullScreen, and Zoom, fall under this category. These types of controls are subclasses of ol.control.Control.

There are also other kinds of controls that are invisible to the user, but they provide just as important interactions. Controls, such as KeyboardPan, Select, and PinchZoom, are of this type. These types of controls are part of the ol.interaction object.

There are also other helper methods that one could consider a type of control, such as the ol.Geolocation class that provides HTML5 geolocation capabilities.

Controls can be activated or deactivated as desired. Many controls or interactions are already included on a...