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

Key-Value Observing with the Object class

OpenLayers' Object class inherits from Observable and implements a software pattern called Key-Value Observing (KVO). With KVO, an object representing some data maintains a list of other objects that wish to observe it. When the data value changes, the observers are notified automatically.

The following methods are available in all OpenLayers classes, which inherit from ol.Object. Note that the Object class also contains all the methods provided by the Observable class even though they are not listed here:

Method

Parameters

Description

bindTo(key,target, targetKey)

  • keystring
  • targetol.Object
  • targetKeystring

This method is used to add an observer to a property on the object. The key parameter ...

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