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

Creating custom builds

OpenLayers provides an easy way to create a custom build of the library to include in your page that contains only the things you need. Throughout this book, we've been including a file called ol.js (or ol-debug.js), a file that contains all the functionality (classes, functions, and so on) that OpenLayers provides. So far, this has been great—we've been developing up to this point, so we want to be sure that we have access to all the classes that we may use.

Benefits of serving small files

Well, the ol.js file we've been using is around 391 KB, and the debug version is 3.5 MB! Both are quite large files to load, especially since they contain only JavaScript code. Even though large file sizes aren't as much of an issue as ...

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