[OpenLayers-Users] build profile question

Christopher Schmidt crschmidt at metacarta.com
Tue Jan 30 07:05:18 EST 2007


On Tue, Jan 30, 2007 at 08:49:15AM +0100, Bart van den Eijnden (OSGIS) wrote:
> Hi list,
> 
> I am trying to make a build profile.
> 
> Does the @requires tag still work? I always seem to get a key error:
> 
> Traceback (most recent call last):
>   File "build.py", line 18, in ?
>     merged = mergejs.run(sourceDirectory, None, configFilename)
>   File "../tools/mergejs.py", line 193, in run
>     if max([order.index(rfp) for rfp in files[fp].requires] +
> KeyError: 'OpenLayers/Control.js'
> 
> I started by copying lite.cfg and adding only PanZoom.js:
> 
> [first]
> OpenLayers/SingleFile.js
> OpenLayers.js
> OpenLayers/BaseTypes.js
> OpenLayers/Util.js
> 
> [last]
> 
> [include]
> OpenLayers/Events.js
> OpenLayers/Map.js
> OpenLayers/Layer.js
> OpenLayers/Layer/Grid.js
> OpenLayers/Layer/HTTPRequest.js
> OpenLayers/Layer/WMS.js
> OpenLayers/Layer/WMS/Untiled.js
> OpenLayers/Tile.js
> OpenLayers/Tile/Image.js
> OpenLayers/Control/PanZoom.js
> 
> [exclude]
> 
> If I add in OpenLayers/Control.js before I include PanZoom.js all is fine,
> i.e. if I resolve the dependencies in the build file myself.

The dependancy resolution still requires you to include the files
yourself, it simply resoles the order they end up in the build. So, if
you want to build something which depends on Controls, you need to
include OpenLayers/Control.js -- however, it can be at the end of the
include list. Changing this behavior is an obvious feature request once
you look at it, but I'd simply never thought about it: patches
graciously accepted.

> Also, the OverviewMap.js has @require: instead of @requires!

The OverviewMap requires line is definitely a bug. That one can be filed
against the 2.3 release since it's so cheap to fix.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list