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 - building your custom OpenLayers library

We will reuse the animation sample, from the local OpenLayers installation, to try out both ways of building code:

  1. Copy the animation.html and animation.js files from the examples folder into animation-exports.html and animation-exports.js.
  2. Create a file config/ol-animation-exports.json inspired by the config/examples-all.json with the following content:
    { "exports": ["ol.Map", "ol.Map#*", "ol.View", "ol.animation.*", "ol.control.*", "ol.layer.Tile", "ol.proj.*", "ol.source.OSM" ], "src": ["src/**/*.js"], "compile": { "externs": [ "externs/bingmaps.js", "externs/bootstrap.js", "externs/closure-compiler.js", "externs/example.js", "externs/geojson.js", "externs/jquery-1.7.js", "externs/oli.js", ...

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