1 /* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
2 * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
3 * text of the license. */
5 /// This blob sucks in all the files in uncompressed form for ease of use
8 OpenLayers = new Object();
10 OpenLayers._scriptName = (
11 typeof(_OPENLAYERS_SFL_) == "undefined" ? "lib/OpenLayers.js"
14 OpenLayers._getScriptLocation = function () {
15 var scriptLocation = "";
16 var SCRIPT_NAME = OpenLayers._scriptName;
18 var scripts = document.getElementsByTagName('script');
19 for (var i = 0; i < scripts.length; i++) {
20 var src = scripts[i].getAttribute('src');
22 var index = src.lastIndexOf(SCRIPT_NAME);
23 // is it found, at the end of the URL?
24 if ((index > -1) && (index + SCRIPT_NAME.length == src.length)) {
25 scriptLocation = src.slice(0, -SCRIPT_NAME.length);
30 return scriptLocation;
34 `_OPENLAYERS_SFL_` is a flag indicating this file is being included
35 in a Single File Library build of the OpenLayers Library.
37 When we are *not* part of a SFL build we dynamically include the
38 OpenLayers library code.
40 When we *are* part of a SFL build we do not dynamically include the
41 OpenLayers library code as it will be appended at the end of this file.
43 if (typeof(_OPENLAYERS_SFL_) == "undefined") {
45 The original code appeared to use a try/catch block
46 to avoid polluting the global namespace,
47 we now use a anonymous function to achieve the same result.
50 var jsfiles=new Array(
56 "OpenLayers/Events.js",
58 "OpenLayers/Layer.js",
60 "OpenLayers/Marker.js",
61 "OpenLayers/Popup.js",
63 "OpenLayers/Feature.js",
64 "OpenLayers/Feature/WFS.js",
65 "OpenLayers/Tile/Image.js",
66 "OpenLayers/Tile/WFS.js",
67 // "OpenLayers/Layer/Google.js",
68 // "OpenLayers/Layer/VirtualEarth.js",
69 // "OpenLayers/Layer/Yahoo.js",
70 "OpenLayers/Layer/Grid.js",
71 "OpenLayers/Layer/KaMap.js",
72 "OpenLayers/Layer/Markers.js",
73 "OpenLayers/Layer/Text.js",
74 "OpenLayers/Layer/WMS.js",
75 "OpenLayers/Layer/WFS.js",
76 "OpenLayers/Layer/WMS/Untiled.js",
77 "OpenLayers/Popup/Anchored.js",
78 "OpenLayers/Popup/AnchoredBubble.js",
79 "OpenLayers/Control.js",
80 "OpenLayers/Control/MouseDefaults.js",
81 "OpenLayers/Control/MouseToolbar.js",
82 "OpenLayers/Control/KeyboardDefaults.js",
83 "OpenLayers/Control/PanZoom.js",
84 "OpenLayers/Control/PanZoomBar.js",
85 "OpenLayers/Control/LayerSwitcher.js"
88 var allScriptTags = "";
89 var host = OpenLayers._getScriptLocation() + "lib/";
91 // check to see if prototype.js was already loaded
92 // if so, skip the first dynamic include
95 try { x = Prototype; }
96 catch (e) { start=0; }
98 for (var i = start; i < jsfiles.length; i++) {
99 var currentScriptTag = "<script src='" + host + jsfiles[i] + "'></script>";
100 allScriptTags += currentScriptTag;
102 document.write(allScriptTags);