Files
openlayers/lib/OpenLayers.js
euzuro f582775d11 - Removed unnecessary accessors from OpenLayers.Layer: getProjection(),
getMaxExtent(), getMaxResolution(), and getNumZoomLevels(). They were just 
   wrapping around the properties. better to just access the property directly. 
   Needed to update for these removals in many different files. 

- Improved initResolutions() functionality. It is now I believe both thorough
   and complete. The only exception is that we should maybe allow a way for 
   the user to set up resolutions[] array using only minResolution and 
   numZoomLevels instead of only maxResolution and numZoomLevels... but I'm not
   really sure anyone would ever really want to use that. And at any rate, I
   don't know the math for how to do it. I'm sure schuyler or Dr. 5 would.
   Oh. for a summary of how initResolutions works, see:
   http://trac.openlayers.org/wiki/SettingZoomLevels

- Move getResolution(), initResolutions() out of HTTPRequest and into Layer. On 
   thinking this through (and trying to write documentation), I realized that 
   the real, true, GENERIC case for a layer will be using this awesome 
   resolutions[] array that allows for setting number of zoom levels, default 
   max resolutions, special scale arrays, etc. 

- Updated code for getZoomForExtent() to work with resolutions[] array, instead 
   of using the the log 2 equation. 

- Move standard getZoomForExtent() and getExtent() out of Grid and into 
   Layer. Like above, there is no reason for these methods to be found so far
   down in the food chain. They are part of the generic calculations for 
   generic layers, so they belong in Layer. 



git-svn-id: http://svn.openlayers.org/trunk/openlayers@1379 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 02:51:38 +00:00

118 lines
3.9 KiB
JavaScript

/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
////
/// This blob sucks in all the files in uncompressed form for ease of use
///
OpenLayers = new Object();
OpenLayers._scriptName = (
typeof(_OPENLAYERS_SFL_) == "undefined" ? "lib/OpenLayers.js"
: "OpenLayers.js" );
OpenLayers._getScriptLocation = function () {
var scriptLocation = "";
var SCRIPT_NAME = OpenLayers._scriptName;
var scripts = document.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
var src = scripts[i].getAttribute('src');
if (src) {
var index = src.lastIndexOf(SCRIPT_NAME);
// is it found, at the end of the URL?
if ((index > -1) && (index + SCRIPT_NAME.length == src.length)) {
scriptLocation = src.slice(0, -SCRIPT_NAME.length);
break;
}
}
}
return scriptLocation;
}
/*
`_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",
"Rico/Color.js",
"OpenLayers/BaseTypes.js",
"OpenLayers/Util.js",
"OpenLayers/Ajax.js",
"OpenLayers/Events.js",
"OpenLayers/Map.js",
"OpenLayers/Layer.js",
"OpenLayers/Icon.js",
"OpenLayers/Marker.js",
"OpenLayers/Marker/Box.js",
"OpenLayers/Popup.js",
"OpenLayers/Tile.js",
"OpenLayers/Feature.js",
"OpenLayers/Feature/WFS.js",
"OpenLayers/Tile/Image.js",
"OpenLayers/Tile/WFS.js",
"OpenLayers/Layer/EventPane.js",
"OpenLayers/Layer/FixedZoomLevels.js",
"OpenLayers/Layer/Google.js",
"OpenLayers/Layer/VirtualEarth.js",
// "OpenLayers/Layer/Yahoo.js",
"OpenLayers/Layer/HTTPRequest.js",
"OpenLayers/Layer/Grid.js",
"OpenLayers/Layer/KaMap.js",
"OpenLayers/Layer/MultiMap.js",
"OpenLayers/Layer/Markers.js",
"OpenLayers/Layer/Text.js",
"OpenLayers/Layer/WorldWind.js",
"OpenLayers/Layer/WMS.js",
"OpenLayers/Layer/WFS.js",
"OpenLayers/Layer/WMS/Untiled.js",
"OpenLayers/Layer/GeoRSS.js",
"OpenLayers/Layer/Boxes.js",
"OpenLayers/Layer/Canvas.js",
"OpenLayers/Popup/Anchored.js",
"OpenLayers/Popup/AnchoredBubble.js",
"OpenLayers/Control.js",
"OpenLayers/Control/MouseDefaults.js",
"OpenLayers/Control/MouseToolbar.js",
"OpenLayers/Control/KeyboardDefaults.js",
"OpenLayers/Control/PanZoom.js",
"OpenLayers/Control/PanZoomBar.js",
"OpenLayers/Control/Permalink.js",
"OpenLayers/Control/Scale.js",
"OpenLayers/Control/LayerSwitcher.js",
"OpenLayers/Control/LayerTabs.js"
); // etc.
var allScriptTags = "";
var host = OpenLayers._getScriptLocation() + "lib/";
// check to see if prototype.js was already loaded
// if so, skip the first dynamic include
//
var start=1;
try { x = Prototype; }
catch (e) { start=0; }
for (var i = start; i < jsfiles.length; i++) {
var currentScriptTag = "<script src='" + host + jsfiles[i] + "'></script>";
allScriptTags += currentScriptTag;
}
document.write(allScriptTags);
})();
}