O'Reilly logo

OpenLayers 2.10 by Erik Hazzard

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

Time for Action – creating object literals

We're going to introduce object literals and get acclimated with how to manipulate them now, so we can better work with OpenLayers code.

  1. Open up Firefox and Firebug's Console panel (enabling it if it disabled)—again, it doesn't matter right now what page you're on.
  2. Click on the red arrow on the bottom right, above the Firebug icon. This will open up a side panel where we can type in multiple lines of code. The code will not be executed when we press Enter, like in single line mode. Instead, we can execute the code by either pressing Ctrl + Enter or clicking Run.
  3. Type in the following code, and then execute it by pressing Ctrl+Enter or clicking Run.
    var my_parameters = {'answer': 42, 'question': null}; console.log(my_parameters); ...

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