1. Sean Gillies
  2. zgeo.recipe.openlayers

Wiki

Clone wiki

zgeo.recipe.openlayers / Home

A zc.buildout recipe for profiles of OpenLayers

See also: http://pypi.python.org/pypi/zgeo.recipe.openlayers/

OpenLayers is fantastic. And big. Your application probably doesn't need all of it. It includes tools to build smaller profiles; all you need is dependable machinery for configuring and applying the tools in a replicable way. Using zgeo.recipe.openlayers with zc.buildout provides you with such machinery. A terse, descriptive, configuration like this:

[buildout]
parts = openlayers-2.7-wms

[openlayers-2.7-wms]
recipe = zgeo.recipe.openlayers
url = http://openlayers.org/download/OpenLayers-2.7.tar.gz
filename = OpenLayers-2.7-WMS.js
include =
    OpenLayers/Map.js
    OpenLayers/Layer/WMS.js

Yields a small, WMS-only, profile in a file named OpenLayers-2.7-WMS.js in the directory parts/openlayers-2.7-wms. You can add as many parts as you like and build a herd of profiles for different applications from one configuration file.

Getting started

Probably better to do all of this in a virtualenv, which I'll assume you know. Download bootstrap.py and buildout.cfg from http://bitbucket.org/sgillies/zgeorecipeopenlayers/downloads/ into your clean working directory or virtualenv. Then:

$ python bootstrap.py

to fetch zc.buildout and its dependencies. When complete, just execute:

$ bin/buildout -c buildout.cfg

to build your profile(s).

Updated