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

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 ...

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