Build HSLayers

HSLayers is extension of OpenLayers, which consist from patches to original OpenLayers.js file and addons - custom widgets, controls, layers. It also adds some new stuff into style.css as well as customises some images. To get all of this integrated and setuped easily, you have to run the build script.

The script makes following:

  1. Adds patches to OpenLayers.js
  2. Adds patches to style.css
  3. Merges images with orignal ones
  4. Makes compressed version of each JavaScript file
  5. Makes comprehensive all-in-one files for each HSLayers widget (as MapPortal.js for example)

Everything is stored in the build directory (originally empty).

Now, we can build HSLayers:

cd hslayers/tools
python build.py --help

    Usage:
        build.py [options]

    Options:
    -h, --help            show this help message and exit
    -b, --build           Build all sources
    -r, --clear           Clear the build directory
    -d, --documentation   Build the documentation
    -p, --patch           Patch the OpenLayers with HSLayers patches
    -c, --compress        Compress HSLayers files
    -a, --apps            Build compressed classes needed by some high-level
                            classes and applications
    -i, --imagescss       Merge CSS and Images
    -D, --debug           Build the uncompressed version of HSLayers
                            and all libraries
    -t dir, --target=dir  Target directory:
                            /home/jachym/usr/src/hsrs/hslayers/trunk/build

The building script should have self-explaining help, but let’s talk about it more detaily:

-b, –build
Shortcut for clear, patch, compress, apps and documentation
-r, –clear
Delete everything from target directory
-d, –documentation
Build API documentation using jsdoc-toolkit utility (assumes, jsdoc is in the PATH)
-p, –patch
Add patches, CSS and images to OpenLayers
-c, –compress
Compress all JavaScripts - compress HSLayers
-a, –apps
Compress stuff in the Apps directory
-i, –imagescss
Do only images and CSS
-t, –target=dir
Store the results to any directory, default is hslayers/build
-D, –debug
This option will cause, that the javascripts will not be compressed and so it is easier for debugging. In general, this is useful when developing the application. When it goes to production phase, -D should be omitted.

So, the easiest way how to build everything is:

python tools/build.py -b

Build everything without documentation in debug mode:

python tools/build.py -rpciaD

Build Configuration

Configuration files for each component of HSLayers are located in the tool/config/ directory. Some files available there will be described lower:

  • Editing.cfg – Files needed for vector data editation
  • HSLayers.cfg – For compilation (comprimation) of all source files
  • LayerSwitcher.cfg – Everything needed for the HSLayers.LayerSwitcher()
  • MapPanel.cfg – Everything needed for the HSLayers.MapPanel()
  • MapPortal.cfg – Everything needed for the HSLayers.MapPortal() (basically “everything”)
  • MapViewer.cfg – Everything needed for the HSLayers.MapViewer()
  • openlayers-full-with-cze.cfg – Config files for building original OpenLayers code
  • OpenLayersPatches.cfgpatches configuration from HSLayers to OpenLayers
  • SLD.cfg – Files needed for the work with SLD
  • WPSClient.cfg – Files needed for the HSLayers.WPSClient()

Main Menu


Table Of Contents

Previous topic

Get HSLayers

Next topic

Setup & Configure HSLayers Server components

This Page