Merged r[280]:[358] from source:/sandbox/follower/b-singlefile/ (Enable building of Single File Library version of OpenLayers library).

git-svn-id: http://svn.openlayers.org/trunk/openlayers@359 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
follower
2006-05-25 12:26:53 +00:00
parent e665e10a53
commit 2d440e36b0
6 changed files with 517 additions and 3 deletions

View File

@@ -29,8 +29,23 @@ OpenLayers._getScriptLocation = function () {
return scriptLocation;
}
try{new OpenLayers.Map();}
catch(e){
/*
`_OPENLAYERS_SFL_` is a flag indicating this file is being included
in a Single File Library build of the OpenLayers Library.
When we are *not* part of a SFL build we dynamically include the
OpenLayers library code.
When we *are* part of a SFL build we do not dynamically include the
OpenLayers library code as it will be appended at the end of this file.
*/
if (typeof(_OPENLAYERS_SFL_) == "undefined") {
/*
The original code appeared to use a try/catch block
to avoid polluting the global namespace,
we now use a anonymous function to achieve the same result.
*/
(function() {
var jsfiles=new Array(
"Prototype.js",
"Rico/Corner.js",
@@ -78,4 +93,5 @@ catch(e){
allScriptTags += currentScriptTag;
}
document.write(allScriptTags);
};
})();
}

2
lib/_sfl_header.js Normal file
View File

@@ -0,0 +1,2 @@
_OPENLAYERS_SFL_=true