Time for action – creating object literals

We will introduce object literals and get acclimated with how to manipulate them now, so that we can better work with the OpenLayers code:

  1. Open up Chrome and the DevTools Console panel—again, it doesn't matter right now what page you're on.
  2. Type in the following code, and then execute it by pressing Enter:
    var my_parameters = {zoom: false, attribution: false, otherControl: 'myslider'};
  3. The preceding code should display, in the console log area, something similar to {zoom: false, attribution: false; otherControl: 'mySlider'}. In this case, the object is not complex but when the object is more complex, you will see an arrow before the object, and if you click on it, it will show ...

Get OpenLayers 3 : Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.