Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • OpenLayers 2.10 Beginner's Guide
  • Toc
  • feedback
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)
close
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)

Overview of this book

Table of Contents (18 chapters)
close
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...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete