Time for action – first steps with Closure Library

Although we can download the library on our computer, to remain simple, we will use a remote JavaScript library version.

  1. Create an HTML page using your text editor and cut and paste the following code:
    <!DOCTYPE html> <html> <head> <title>Dom manipulation</title> <script src='https://rawgit.com/google/closure-library/master/closure/goog/base.js'></script> <script> goog.require('goog.dom'); </script> </head> <body> <ul id="my_layers_list"> <li>My first layer</li> <li>My second layer</li> <li>My third layer</li> <li>My background or base layer</li> </ul> <script> var my_layers_list = goog.dom.getElement('my_layers_list'); var myTitle = goog.dom.createDom('h1'); var myText = goog.dom.createTextNode("My ...

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.