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

Doing stuff with events


In Chapter 6, we introduced the notion of events and how OpenLayers uses events. At the core, there are essentially two types of events used by OpenLayers: Browser events and Map events. Browser events are things like clicking on the map div with your mouse, while Map events are things such as zooming the map to some coordinate. We worked a little bit with events in Chapter 6, so let's extend that knowledge and add even more custom functionality to our map.

Note

We won't go over browser events much, but the ideas behind them are essentially the same as map events. A great resource to find out more about browser events can be found at https://developer.mozilla.org/en/DOM/event.

Map event types

There are a number of supported map event types. Let's take a look at them, and then we'll cover how to use them in your map. You can also call map.EVENT_TYPES, which will return an array of valid map events. Some event types will return an event object to the event listener. If...

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