[OpenLayers-Dev] Dynamic Build Technique -- from script.aculo.us

Cameron Shorter cameron.shorter at gmail.com
Sat Oct 28 20:54:57 EDT 2006


We dynamic loading in Mapbuilder.
However, we have plans to drop this functionality.

The downsides of dynamic loading are:
* The user needs to download multiple JS files instead of one. This is 
slower.
* It is harder to compress JS if it is spread across multiple files.
The best compression is achieved when you reduce the size of variable 
names from "counter" to "x1" or similar. This only works if the 
compression program is assessing all the JS source at once. Ie, you 
can't run:
compress file1
compress file2
compress file3

You need to run
compress file1 file2 file3



Paul Spencer wrote:
> This is actually pretty cool ... for me, this would replace compiling  
> a sub-set of OpenLayers when developing and testing for something  
> like WebMap.js.
> 
> Cheers
> 
> Paul
> 
> On 26-Oct-06, at 7:17 AM, Erik Uzureau wrote:
> 
> 
>>I was looking through the script.aculo.us wiki this morning and  
>>came accross
>>this bit on how they allow optional loading of different  
>>components. Seems like
>>something we might want to look into for OpenLayers.
>>
>>Thoughts?
>>-erik
>>
>>---------------------------------------------------------------------- 
>>--------------
>>from: http://wiki.script.aculo.us/scriptaculous/show/Usage
>>
>>3. Link to script.aculo.us
>>
>>Link to the scripts in the head of your document:
>>
>>
>><script src="javascripts/prototype.js" type="text/javascript"></ 
>>script>
>><script src="javascripts/scriptaculous.js" type="text/javascript"></ 
>>script>
>>
>>By default, scriptaculous.js loads all of the other javascript files
>>necessary for effects, drag-and-drop, sliders, and all of the other
>>script.aculo.us features. If you don't need all of the features, you
>>can limit the additional scripts that get loaded by specifying them in
>>a comma-separated list, e.g.:
>>
>>
>><script src="scriptaculous.js?load=effects,dragdrop" type=...></ 
>>script>
>>
>>The scripts that can be specified are:
>>
>>    * builder
>>    * effects
>>    * dragdrop
>>    * controls
>>    * slider
>>
>>Note that some of the scripts require that others be loaded in order
>>to function properly.
>>_______________________________________________
>>Dev mailing list
>>Dev at openlayers.org
>>http://openlayers.org/mailman/listinfo/dev
> 
> 
> +-----------------------------------------------------------------+
> |Paul Spencer                          pspencer at dmsolutions.ca    |
> +-----------------------------------------------------------------+
> |Chief Technology Officer                                         |
> |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
> +-----------------------------------------------------------------+
> 
> 
> 
> 
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
> 


-- 
Cameron Shorter
http://cameron.shorter.net



More information about the Dev mailing list