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 – using Closure Linter to fix JavaScript

We will retrieve one file from the previous OpenLayers library Version 2.12.

For this, download the file Map.js from https://raw.github.com/openlayers/openlayers/release-2.12/lib/OpenLayers/Map.js.

Type the following command:

gjslint Map.js

You will get 605 errors with messages like below:

 ----- FILE  :  /home/thomas/Map.js -----
Line 1,  E:0001: Extra space at end of line
Line 7,  E:0200: Invalid JsDoc tag: requires
Line 266, E:0131: Single-quoted string preferred over double-quoted string.
Line 982, E:0120: Binary operator should go on previous line "+"
Line 1106, E:0002: Missing space before "("
Line 1131, E:0002: Missing space after "function"
Line 1089, E:0110: Line too long (83 characters). ...

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