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

Events


The standard KVO events beforepropertychange and change are available, as well as one event for each of the observable properties: change:layergroup, change:size, change:target, and change:view. Review the section on KVO in Chapter 2, Key Concepts in OpenLayers if you don't remember how these events work.

In addition to the KVO related events, however, there are quite a few new events that can be triggered from a map object. As with any other event, you can register for these events using the on() and once() methods discussed earlier. We'll group these events into browser events, map events, and render events.

Browser events

The Browser events are all events that are provided in response to the user interacting with the map's HTML element. The available events are:

  • click: This event is fired once for every discrete click on the map. If the user double-clicks on the map, this event will be fired twice. If you want to distinguish between a click and a double-click, use the singleclick...