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

Map methods

The Map class, being the central organizing point for OpenLayers, provides methods for managing many aspects of the map. As there are quite a few methods, we've grouped them into some logical groups—Control methods, Interaction methods, Layer methods, Overlay methods, Rendering methods, Conversion methods, and other methods.

Control methods

These methods are used to manage Controls associated with a map. Controls are covered in more detail in Chapter 9, Taking Control of Controls; so, we won't go into any detail here:

Method

Parameters

Description

addControl( control )

control - ol.Control

This method adds a control to the map.

removeControl( control )

control - ol.Control

This method removes a control from the map.

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