Merge all changes from the naturaldocs sandbox. This brings all the work that

has been done in the NaturalDocs branch back to trunk. Thanks to everyone who
helped out in making this happen. (I could list people, but the list would
be long, and I'm already mentally on vacation.)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-06-29 15:59:20 +00:00
parent f1c61fd0d6
commit 3948913bfc
107 changed files with 8658 additions and 4011 deletions

View File

@@ -3,57 +3,67 @@
* for the full text of the license. */
/**
* @fileoverview Image Layer
* @author Tim Schaub
*/
/**
* @class
*
* @requires OpenLayers/Layer.js
* @requires OpenLayers/Tile/Image.js
*
* Class: OpenLayers.Layer.Image
* Instances of OpenLayers.Layer.Image are used to display data from a web
* accessible image as a map layer. Create a new image layer with the
* <OpenLayers.Layer.Image> constructor. Inherits from <OpenLayers.Layer>.
*/
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 */
/**
* Property: isBaseLayer
* {Boolean} The layer is a base layer. Default is true. Set this property
* in the layer options
*/
isBaseLayer: true,
/** @type String */
/**
* Property: url
* {String} URL of the image to use
*/
url: null,
/**
* The image bounds in map units
* @type OpenLayers.Bounds
* Property: extent
* {<OpenLayers.Bounds>} The image bounds in map units
*/
extent: null,
/**
* The image size in pixels
* @type OpenLayers.Size
* Property: size
* {<OpenLayers.Size>} The image size in pixels
*/
size: null,
/** @type OpenLayers.Tile.Image */
/**
* Property: tile
* {<OpenLayers.Tile.Image>}
*/
tile: null,
/**
* The ratio of height/width represented by a single pixel in the graphic
* @type Float */
* Property: aspectRatio
* {Float} The ratio of height/width represented by a single pixel in the
* graphic
*/
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
*/
* Constructor: OpenLayers.Layer.Image
* Create a new image layer
*
* Parameters:
* name - {String} A name for the layer.
* url - {String} Relative or absolute path to the image
* extent - {<OpenLayers.Bounds>} The extent represented by the image
* size - {<OpenLayers.Size>} The size (in pixels) of the image
* options - {Object} Hashtable of extra options to tag onto the layer
*/
initialize: function(name, url, extent, size, options) {
this.url = url;
this.extent = extent;
@@ -65,7 +75,8 @@ OpenLayers.Layer.Image.prototype =
},
/**
*
* Method: destroy
* Destroy this layer
*/
destroy: function() {
if (this.tile) {
@@ -76,10 +87,14 @@ OpenLayers.Layer.Image.prototype =
},
/**
* @param {Object} obj
*
* @returns An exact clone of this OpenLayers.Layer.Image
* @type OpenLayers.Layer.Image
* Method: clone
* Create a clone of this layer
*
* Paramters:
* obj - {Object} An optional layer (is this ever used?)
*
* Return:
* {<OpenLayers.Layer.Image>} An exact copy of this layer
*/
clone: function(obj) {
@@ -100,7 +115,10 @@ OpenLayers.Layer.Image.prototype =
},
/**
* @param {OpenLayers.Map} map
* APIMethod: setMap
*
* Parameters:
* map - {<OpenLayers.Map>}
*/
setMap: function(map) {
/**
@@ -117,11 +135,14 @@ OpenLayers.Layer.Image.prototype =
OpenLayers.Layer.prototype.setMap.apply(this, arguments);
},
/** Create the tile for the image or resize it for the new resolution
/**
* Method: moveTo
* Create the tile for the image or resize it for the new resolution
*
* @param {OpenLayers.Bounds} bounds
* @param {Boolean} zoomChanged
* @param {Boolean} dragging
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* zoomChanged - {Boolean}
* dragging - {Boolean}
*/
moveTo:function(bounds, zoomChanged, dragging) {
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
@@ -163,23 +184,32 @@ OpenLayers.Layer.Image.prototype =
},
/**
* @param {String} newUrl
* APIMethod: setUrl
*
* Parameters:
* newUrl - {String}
*/
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)
/**
* APIMethod: getURL
* 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
* Parameters:
* bounds - {<OpenLayers.Bounds>}
*/
getURL: function(bounds) {
return this.url;
},
/** @final @type String */
/**
* Constant: CLASS_NAME
* {String} OpenLayers.Layer.Image
*/
CLASS_NAME: "OpenLayers.Layer.Image"
});