Book Image

OpenLayers 2.10 Beginner's Guide

Book Image

OpenLayers 2.10 Beginner's Guide

Overview of this book

Table of Contents (18 chapters)
OpenLayers 2.10
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for Action – building a Config file


Let's take a look at how to write a build config file.

  1. Copy the lite.cfg file found in the build directory and name the copied version example_1.cfg (or whatever you'd like, but that's what we'll refer to it as).

  2. Let's manually specify some files. We'll add in a couple controls. Add in the following and then save the file. The full file should look like this:

    # Config File
    
    [first] 
    OpenLayers/SingleFile.js 
    OpenLayers.js 
    OpenLayers/BaseTypes.js 
    OpenLayers/BaseTypes/Class.js 
    OpenLayers/Util.js 
    
    [last] 
    
    [include] 
    OpenLayers/Map.js 
    OpenLayers/Layer/WMS.js 
    OpenLayers/Control/LayerSwitcher.js 
    OpenLayers/Control/Navigation.js 
    OpenLayers/Control/Scale.js 
    
    [exclude]

What Just Happened?

We just created a configuration file for our build named example_1.cfg. We'll be using this file to build the OpenLayers.js file. Notice that we did not have to include the base Control.js class—the build script will automatically look for and include the dependencies...