diff --git a/build/docs.sh b/build/docs.sh index 2877c613c5..3ec415f1c3 100755 --- a/build/docs.sh +++ b/build/docs.sh @@ -1,7 +1,7 @@ #!/bin/sh rm ../doc/reference.html -CLASSES="Map Layer Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MousePosition Control.MouseToolbar Control.OverviewMap Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util Ajax" +CLASSES="Map Layer Layer.Image Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MousePosition Control.MouseToolbar Control.OverviewMap Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util Ajax" echo "
+ The "City Lights" layer above is created from a single web accessible + image. If you construct it without any resolution related options, + the layer will be given a single resolution based on the extent/size. + Otherwise, it behaves much like a regular layer. This is primarily + intended to be used in an overview map - where another layer type + might not make a good overview. +
+ + diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index 94f9686db3..323bda974e 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + //// /// This blob sucks in all the files in uncompressed form for ease of use /// @@ -65,6 +66,7 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") { "OpenLayers/Feature/WFS.js", "OpenLayers/Tile/Image.js", "OpenLayers/Tile/WFS.js", + "OpenLayers/Layer/Image.js", "OpenLayers/Layer/EventPane.js", "OpenLayers/Layer/FixedZoomLevels.js", "OpenLayers/Layer/Google.js", diff --git a/lib/OpenLayers/Ajax.js b/lib/OpenLayers/Ajax.js index 6759223827..d6687b97ea 100644 --- a/lib/OpenLayers/Ajax.js +++ b/lib/OpenLayers/Ajax.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + OpenLayers.ProxyHost = ""; //OpenLayers.ProxyHost = "examples/proxy.cgi?url="; diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js index 3fdd2aa2b0..9c00d05222 100644 --- a/lib/OpenLayers/BaseTypes.js +++ b/lib/OpenLayers/BaseTypes.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /* OpenLayers.Class metaclass */ OpenLayers.Class = { diff --git a/lib/OpenLayers/Control.js b/lib/OpenLayers/Control.js index 3122262af9..9e3df434f0 100644 --- a/lib/OpenLayers/Control.js +++ b/lib/OpenLayers/Control.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/ArgParser.js b/lib/OpenLayers/Control/ArgParser.js index 52fd93de5e..272ced4ca9 100644 --- a/lib/OpenLayers/Control/ArgParser.js +++ b/lib/OpenLayers/Control/ArgParser.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/KeyboardDefaults.js b/lib/OpenLayers/Control/KeyboardDefaults.js index a494be1a20..9b78819092 100644 --- a/lib/OpenLayers/Control/KeyboardDefaults.js +++ b/lib/OpenLayers/Control/KeyboardDefaults.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/LayerSwitcher.js b/lib/OpenLayers/Control/LayerSwitcher.js index 784528f931..ed04d15f2e 100644 --- a/lib/OpenLayers/Control/LayerSwitcher.js +++ b/lib/OpenLayers/Control/LayerSwitcher.js @@ -1,6 +1,6 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ /** * @class diff --git a/lib/OpenLayers/Control/MouseDefaults.js b/lib/OpenLayers/Control/MouseDefaults.js index 5e3fab886e..296ca28cc1 100644 --- a/lib/OpenLayers/Control/MouseDefaults.js +++ b/lib/OpenLayers/Control/MouseDefaults.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/MousePosition.js b/lib/OpenLayers/Control/MousePosition.js index a8d7650387..28adb68afc 100644 --- a/lib/OpenLayers/Control/MousePosition.js +++ b/lib/OpenLayers/Control/MousePosition.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/MouseToolbar.js b/lib/OpenLayers/Control/MouseToolbar.js index c72d3561a0..9973a367f4 100644 --- a/lib/OpenLayers/Control/MouseToolbar.js +++ b/lib/OpenLayers/Control/MouseToolbar.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/OverviewMap.js b/lib/OpenLayers/Control/OverviewMap.js index 0c5b471b65..e3fb5f6064 100644 --- a/lib/OpenLayers/Control/OverviewMap.js +++ b/lib/OpenLayers/Control/OverviewMap.js @@ -1,3 +1,6 @@ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ /** * @fileoverview Locator Map Control * @author Tim Schaub diff --git a/lib/OpenLayers/Control/PanZoom.js b/lib/OpenLayers/Control/PanZoom.js index 8b6803b7e6..ad4b795174 100644 --- a/lib/OpenLayers/Control/PanZoom.js +++ b/lib/OpenLayers/Control/PanZoom.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index 0be1ebccc7..d67030aa2c 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/Permalink.js b/lib/OpenLayers/Control/Permalink.js index d3f45f5f78..f6cc6508d6 100644 --- a/lib/OpenLayers/Control/Permalink.js +++ b/lib/OpenLayers/Control/Permalink.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Control/Scale.js b/lib/OpenLayers/Control/Scale.js index 75c274b3f1..de7ee41b07 100644 --- a/lib/OpenLayers/Control/Scale.js +++ b/lib/OpenLayers/Control/Scale.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js index de38204103..3ef1e53d8b 100644 --- a/lib/OpenLayers/Events.js +++ b/lib/OpenLayers/Events.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + OpenLayers.Event = { KEY_BACKSPACE: 8, diff --git a/lib/OpenLayers/Feature.js b/lib/OpenLayers/Feature.js index 10715ce808..d1afa7a2b6 100644 --- a/lib/OpenLayers/Feature.js +++ b/lib/OpenLayers/Feature.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Feature/WFS.js b/lib/OpenLayers/Feature/WFS.js index 2fccc4f1e0..da424f727d 100644 --- a/lib/OpenLayers/Feature/WFS.js +++ b/lib/OpenLayers/Feature/WFS.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index 98a28ab3b1..94567b47d0 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 7cd494760d..cb9b780d70 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/Boxes.js b/lib/OpenLayers/Layer/Boxes.js index 8edb9838f4..c99b22a644 100644 --- a/lib/OpenLayers/Layer/Boxes.js +++ b/lib/OpenLayers/Layer/Boxes.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/Canvas.js b/lib/OpenLayers/Layer/Canvas.js index 481a8dfca1..c2569d5407 100644 --- a/lib/OpenLayers/Layer/Canvas.js +++ b/lib/OpenLayers/Layer/Canvas.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/EventPane.js b/lib/OpenLayers/Layer/EventPane.js index 4ba2a9c32c..8dca860459 100644 --- a/lib/OpenLayers/Layer/EventPane.js +++ b/lib/OpenLayers/Layer/EventPane.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/FixedZoomLevels.js b/lib/OpenLayers/Layer/FixedZoomLevels.js index f536ddfc94..31c63a198d 100644 --- a/lib/OpenLayers/Layer/FixedZoomLevels.js +++ b/lib/OpenLayers/Layer/FixedZoomLevels.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** diff --git a/lib/OpenLayers/Layer/GeoRSS.js b/lib/OpenLayers/Layer/GeoRSS.js index e8ab689fbf..d76f4ea75b 100644 --- a/lib/OpenLayers/Layer/GeoRSS.js +++ b/lib/OpenLayers/Layer/GeoRSS.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/Google.js b/lib/OpenLayers/Layer/Google.js index ebd5987a2c..53d43d2c7b 100644 --- a/lib/OpenLayers/Layer/Google.js +++ b/lib/OpenLayers/Layer/Google.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 1cde67834e..17d9696753 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/HTTPRequest.js b/lib/OpenLayers/Layer/HTTPRequest.js index 6a6e9cb539..5953983cce 100644 --- a/lib/OpenLayers/Layer/HTTPRequest.js +++ b/lib/OpenLayers/Layer/HTTPRequest.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/Image.js b/lib/OpenLayers/Layer/Image.js new file mode 100644 index 0000000000..659dc11619 --- /dev/null +++ b/lib/OpenLayers/Layer/Image.js @@ -0,0 +1,161 @@ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + +/** + * @fileoverview Image Layer + * @author Tim Schaub + */ + +/** + * @class + * + * @requires OpenLayers/Layer.js + */ +OpenLayers.Layer.Image = OpenLayers.Class.create(); +OpenLayers.Layer.Image.prototype = + OpenLayers.Class.inherit(OpenLayers.Layer, { + + /** By default, Layer.Image will be a baselayer + * + * @type Boolean */ + isBaseLayer: true, + + /** @type String */ + url: null, + + /** @type OpenLayers.Bounds */ + extent: null, + + /** @type OpenLayers.Size */ + size: null, + + /** @type OpenLayers.Tile.Image */ + tile: null, + + /** The ratio of height/width represented by a single pixel in the graphic + * + * @type Float */ + aspectRatio: null, + + /** + * @constructor + * + * @param {String} name + * @param {String} url Relative or absolute path to the image + * @param {OpenLayers.Bounds} extent The extent represented by the image + * @param {OpenLayers.Size} size The size (in pixels) of the image + * @param {Object} options Hashtable of extra options to tag onto the layer + */ + initialize: function(name, url, extent, size, options) { + this.url = url; + this.extent = extent; + this.size = size; + OpenLayers.Layer.prototype.initialize.apply(this, [name, options]); + + this.aspectRatio = (this.extent.getHeight() / this.size.h) / + (this.extent.getWidth() / this.size.w); + }, + + /** + * + */ + destroy: function() { + this.tile.destroy(); + this.tile = null; + OpenLayers.Layer.prototype.destroy.apply(this, arguments); + }, + + /** + * @param {Object} obj + * + * @returns An exact clone of this OpenLayers.Layer.Image + * @type OpenLayers.Layer.Image + */ + clone: function(obj) { + + if(obj == null) { + obj = new OpenLayers.Layer.Image(this.name, + this.url, + this.extent, + this.size, + this.options); + } + + //get all additions from superclasses + obj = OpenLayers.Layer.prototype.clone.apply(this, [obj]); + + // copy/set any non-init, non-simple values here + + return obj; + }, + + /** + * @param {OpenLayers.Map} map + */ + setMap: function(map) { + // If nothing to do with resolutions has been set, assume a single + // resolution determined by extent/size + if( this.options.maxResolution == null ) { + this.options.maxResolution = this.extent.getWidth() / this.size.w; + } + OpenLayers.Layer.prototype.setMap.apply(this, arguments); + }, + + /** Create the tile for the image or resize it for the new resolution + * + * @param {OpenLayers.Bounds} bounds + * @param {Boolean} zoomChanged + * @param {Boolean} dragging + */ + moveTo:function(bounds, zoomChanged, dragging) { + OpenLayers.Layer.prototype.moveTo.apply(this, arguments); + + var firstRendering = (this.tile == null); + + if(zoomChanged || firstRendering) { + + //determine new tile size + var tileWidth = this.extent.getWidth() / this.map.getResolution(); + var tileHeight = this.extent.getHeight() / + (this.map.getResolution() * this.aspectRatio); + var tileSize = new OpenLayers.Size(tileWidth, tileHeight); + + //determine new position (upper left corner of new bounds) + var ul = new OpenLayers.LonLat(this.extent.left, this.extent.top); + var ulPx = this.map.getLayerPxFromLonLat(ul); + + if(firstRendering) { + //create the new tile + this.tile = new OpenLayers.Tile.Image(this, ulPx, this.extent, + this.url, tileSize); + } else { + //just resize the tile and set it's new position + this.tile.size = tileSize.clone(); + this.tile.position = ulPx.clone(); + } + this.tile.draw(); + } + }, + + /** + * @param {String} newUrl + */ + setUrl: function(newUrl) { + this.url = newUrl; + this.draw(); + }, + + /** The url we return is always the same (the image itself never changes) + * so we can ignore the bounds parameter (it will always be the same, + * anyways) + * + * @param {OpenLayers.Bounds} bounds + */ + getURL: function(bounds) { + return this.url; + }, + + /** @final @type String */ + CLASS_NAME: "OpenLayers.Layer.Image" +}); diff --git a/lib/OpenLayers/Layer/KaMap.js b/lib/OpenLayers/Layer/KaMap.js index d8966a30fe..89b7ec6a1d 100644 --- a/lib/OpenLayers/Layer/KaMap.js +++ b/lib/OpenLayers/Layer/KaMap.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/MapServer.js b/lib/OpenLayers/Layer/MapServer.js index 670249c1db..1c9e446572 100644 --- a/lib/OpenLayers/Layer/MapServer.js +++ b/lib/OpenLayers/Layer/MapServer.js @@ -1,6 +1,6 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ // @requires OpenLayers/Layer/Grid.js /** * @class diff --git a/lib/OpenLayers/Layer/Markers.js b/lib/OpenLayers/Layer/Markers.js index 8691bfefa2..55150f0a2c 100644 --- a/lib/OpenLayers/Layer/Markers.js +++ b/lib/OpenLayers/Layer/Markers.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/MultiMap.js b/lib/OpenLayers/Layer/MultiMap.js index ee7e75f447..44cdb72890 100644 --- a/lib/OpenLayers/Layer/MultiMap.js +++ b/lib/OpenLayers/Layer/MultiMap.js @@ -1,6 +1,6 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ /** * @class diff --git a/lib/OpenLayers/Layer/Text.js b/lib/OpenLayers/Layer/Text.js index 429ad8f708..6a4ed8eb61 100644 --- a/lib/OpenLayers/Layer/Text.js +++ b/lib/OpenLayers/Layer/Text.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/VirtualEarth.js b/lib/OpenLayers/Layer/VirtualEarth.js index 80ce12d636..7c2069f702 100644 --- a/lib/OpenLayers/Layer/VirtualEarth.js +++ b/lib/OpenLayers/Layer/VirtualEarth.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/WFS.js b/lib/OpenLayers/Layer/WFS.js index c5aa8fb691..6a6fbe7a1f 100644 --- a/lib/OpenLayers/Layer/WFS.js +++ b/lib/OpenLayers/Layer/WFS.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/WMS.js b/lib/OpenLayers/Layer/WMS.js index ec4f84583e..68a7827bd6 100644 --- a/lib/OpenLayers/Layer/WMS.js +++ b/lib/OpenLayers/Layer/WMS.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/WMS/Untiled.js b/lib/OpenLayers/Layer/WMS/Untiled.js index 356b30c7e0..23e1cea2fd 100644 --- a/lib/OpenLayers/Layer/WMS/Untiled.js +++ b/lib/OpenLayers/Layer/WMS/Untiled.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/WorldWind.js b/lib/OpenLayers/Layer/WorldWind.js index 7b15da1054..5dd34f8b39 100644 --- a/lib/OpenLayers/Layer/WorldWind.js +++ b/lib/OpenLayers/Layer/WorldWind.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Layer/Yahoo.js b/lib/OpenLayers/Layer/Yahoo.js index 8029c0116c..31b0842052 100644 --- a/lib/OpenLayers/Layer/Yahoo.js +++ b/lib/OpenLayers/Layer/Yahoo.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 501c8fa428..2116c2f9bf 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Marker.js b/lib/OpenLayers/Marker.js index f9126aaceb..c370e828cc 100644 --- a/lib/OpenLayers/Marker.js +++ b/lib/OpenLayers/Marker.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Marker/Box.js b/lib/OpenLayers/Marker/Box.js index 31b850bb14..05e3223e15 100644 --- a/lib/OpenLayers/Marker/Box.js +++ b/lib/OpenLayers/Marker/Box.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index ed2242289e..0f7e810656 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index a9b39edfad..0b5c628ac3 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Popup/AnchoredBubble.js b/lib/OpenLayers/Popup/AnchoredBubble.js index 4b271cff68..4fced7e180 100644 --- a/lib/OpenLayers/Popup/AnchoredBubble.js +++ b/lib/OpenLayers/Popup/AnchoredBubble.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/SingleFile.js b/lib/OpenLayers/SingleFile.js index 857c48490c..99c37d6a82 100644 --- a/lib/OpenLayers/SingleFile.js +++ b/lib/OpenLayers/SingleFile.js @@ -1,5 +1,6 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + _OPENLAYERS_SFL_=true diff --git a/lib/OpenLayers/Tile.js b/lib/OpenLayers/Tile.js index 26183b8f3e..cbc53a949a 100644 --- a/lib/OpenLayers/Tile.js +++ b/lib/OpenLayers/Tile.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /* * @class @@ -82,7 +83,7 @@ OpenLayers.Tile.prototype = { redraw = true; } - OpenLayers.Util.clearArray(this); + this.clear(); this.bounds = bounds.clone(); this.position = position.clone(); if (redraw) { @@ -120,3 +121,4 @@ OpenLayers.Tile.prototype = { CLASS_NAME: "OpenLayers.Tile" }; + diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index f5b9fb5984..e82f16cb8d 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/lib/OpenLayers/Tile/WFS.js b/lib/OpenLayers/Tile/WFS.js index 2dad373811..889873b089 100644 --- a/lib/OpenLayers/Tile/WFS.js +++ b/lib/OpenLayers/Tile/WFS.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class @@ -57,7 +58,7 @@ OpenLayers.Tile.WFS.prototype = */ draw:function() { if (this.drawn) { - OpenLayers.Util.clearArray(this); + this.clear(); } OpenLayers.Tile.prototype.draw.apply(this, arguments); if (this.layer.displayOutsideMaxExtent || (this.layer.maxExtent && @@ -130,3 +131,4 @@ OpenLayers.Tile.WFS.prototype = } ); + diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index 2cbf0254a0..d7582583b8 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -1,6 +1,7 @@ -/* 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. */ +/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license. + * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt + * for the full text of the license. */ + /** * @class diff --git a/license.txt b/release-license.txt similarity index 95% rename from license.txt rename to release-license.txt index 3f8302b898..5799697a51 100644 --- a/license.txt +++ b/release-license.txt @@ -1,3 +1,5 @@ +This license applies to official code releases at www.openlayers.org: + Copyright (c) 2005-2006 MetaCarta, Inc. All rights reserved. diff --git a/repository-license.txt b/repository-license.txt new file mode 100644 index 0000000000..596af4a2d3 --- /dev/null +++ b/repository-license.txt @@ -0,0 +1,35 @@ +This license applies to all code and content in the OpenLayers code +repository at svn.openlayers.org: + +Copyright (c) 2005-2006 MetaCarta, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of MetaCarta, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This license grants no rights to any components related to natural language +processing, free text querying, or unstructured information retrieval. This +license grants no rights to components that implement inventions on which +MetaCarta has patents or has filed applications for patents. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tests/list-tests.html b/tests/list-tests.html index 9fb3df2819..74c8dc7852 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -11,6 +11,7 @@