O'Reilly logo

OpenLayers 3 : Beginner's Guide by Erik Hazzard, Paul Spencer, Thomas Gratier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Taking Control of Controls

So far, we've taken for granted that we will zoom in/out when clicking on plus or minus buttons. We haven't discussed much about what actually is behind the map interaction when you use buttons. The ol.control namespace contains numerous classes that make our maps interactive, in particular to configure behavior on your map. There are many built-in controls, each with their own unique functions. You can easily customize them with a CSS style or other parameters. Contrary to interactions, controls depend on DOM elements and not keyboard and mouse input only.

In this chapter, we'll cover the following topics:

  • What controls are
  • Adding controls to a map
  • Presenting all ol.control classes and their organization
  • Inspect ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required