[OpenLayers-Users] why is your code entirely lacking in whitespace

Christopher Schmidt crschmidt at metacarta.com
Tue May 15 01:23:29 EDT 2007


On Mon, May 14, 2007 at 10:05:15PM -0700, mfrumin wrote:
> 
> it is often useful to look at the code in the libraries to figure out how to
> do do stuff.  unfortunately, it lacks any sane whitespacing scheme, and is
> impossible to peruse.  eg (from
> http://openlayers.org/api/2.4-rc3/OpenLayers.js or the OpenLayers.js that
> comes in the download):

The OpenLayers code is a set of 98 files, in the 'lib' directory of the
distribution. What you are looking at is the 'compressed' version of the
code -- due to the way browsers work, downloading those 98 files will
take in excess of 60 seconds. Compressing it into one file saves those
60 seconds, making it more like 2 or 3.

If you make a modification to the code in the 'lib' directory, then run
the './build.py' script in the build directory, you will get the
'compressed' version you are looking at, suitable for deployment, rather
than for readability. If you wish to modify code, you should *not* touch
the compressed code, and instead edit what is in lib/ and run
./build.py. (The functionality of this script is described in
http://trac.openlayers.org/wiki/Profiles .) Note that it is also
possible to use the non-compressed code in your page, useful for
debugging: just include lib/OpenLayers.js in your code directly.

> does that look helpful to you?  clean your stuff up, then maybe when we have
> bugs we can possibly help report where they might be coming from.

It's impolite to attack the project without taking the time to
understand what's happening. I understand that our documentation is
weak, but we do have this covered relatively well, and I've never had
anyone ask this particular question before, so I'm not sure how we could
have made it easier for you. Where should we link this description from
so that you would have found it? 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list