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:
@@ -4,17 +4,22 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Layer/HTTPRequest.js
|
||||
* @requires OpenLayers/Layer/WMS.js
|
||||
*
|
||||
* Class: OpenLayers.Layer.WMS
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer.HTTPRequest>
|
||||
*/
|
||||
OpenLayers.Layer.WMS.Untiled = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Layer.HTTPRequest, {
|
||||
|
||||
/** Hashtable of default parameter key/value pairs
|
||||
* @final @type Object */
|
||||
/**
|
||||
* Property: DEFAULT_PARAMS
|
||||
* Hashtable of default parameter key/value pairs
|
||||
*/
|
||||
DEFAULT_PARAMS: { service: "WMS",
|
||||
version: "1.1.1",
|
||||
request: "GetMap",
|
||||
@@ -22,25 +27,40 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
exceptions: "application/vnd.ogc.se_inimage",
|
||||
format: "image/jpeg"
|
||||
},
|
||||
/**
|
||||
* APIProperty: reproject
|
||||
* Whether or not to use the base layer as a basis for 'staking' the corners
|
||||
* of the image geographically.
|
||||
*/
|
||||
reproject: true,
|
||||
|
||||
/** the ratio of image/tile size to map size (this is the untiled buffer)
|
||||
* @type int */
|
||||
/**
|
||||
* APIProperty: ratio
|
||||
* {Float} the ratio of image/tile size to map size (this is the untiled
|
||||
* buffer)
|
||||
*/
|
||||
ratio: 2,
|
||||
|
||||
/** @type OpenLayers.Tile.Image */
|
||||
/**
|
||||
* Property: tile
|
||||
* {<OpenLayers.Tile.Image>}
|
||||
*/
|
||||
tile: null,
|
||||
|
||||
/** did the image finish loading before a new draw was initiated?
|
||||
* @type Boolean */
|
||||
/**
|
||||
* Property: doneLoading
|
||||
* {Boolean} did the image finish loading before a new draw was initiated?
|
||||
*/
|
||||
doneLoading: false,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Layer.WMS.Untiled
|
||||
*
|
||||
* @param {String} name
|
||||
* @param {String} url
|
||||
* @param {Object} params
|
||||
* Parameters:
|
||||
* name - {String}
|
||||
* url - {String}
|
||||
* params - {Object}
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(name, url, params, options) {
|
||||
var newArguments = new Array();
|
||||
@@ -64,7 +84,7 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
if (this.tile) {
|
||||
@@ -75,10 +95,14 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Object} obj
|
||||
* APIMethod: clone
|
||||
* Makes an exact clone of this OpenLayers.Layer.WMS.Untiled
|
||||
*
|
||||
* @returns An exact clone of this OpenLayers.Layer.WMS.Untiled
|
||||
* @type OpenLayers.Layer.WMS.Untiled
|
||||
* Parameters:
|
||||
* obj - {Object}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Layer.WMS.Untiled>}
|
||||
*/
|
||||
clone: function (obj) {
|
||||
|
||||
@@ -100,15 +124,19 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
},
|
||||
|
||||
|
||||
/** Once HTTPRequest has set the map, we can load the image div
|
||||
/**
|
||||
* Method: setMap
|
||||
* Once HTTPRequest has set the map, we can load the image div
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
* Parameters:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Layer.HTTPRequest.prototype.setMap.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: setTileSize
|
||||
* Set the tile size based on the map size. This also sets layer.imageSize
|
||||
* and layer.imageOffset for use by Tile.Image.
|
||||
*/
|
||||
@@ -121,12 +149,15 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
this.imageOffset = new OpenLayers.Pixel(0, 0);
|
||||
},
|
||||
|
||||
/** When it is not a dragging move (ie when done dragging)
|
||||
/**
|
||||
* Method: moveTo
|
||||
* When it is not a dragging move (ie when done dragging)
|
||||
* reload and recenter the div.
|
||||
*
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} zoomChanged
|
||||
* @param {Boolean} dragging
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
* zoomChanged - {Boolean}
|
||||
* dragging - {Boolean}
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, dragging) {
|
||||
if (!this.doneLoading) {
|
||||
@@ -197,6 +228,12 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: getURL
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
*/
|
||||
getURL: function(bounds) {
|
||||
return this.getFullRequestString( {'BBOX': bounds.toBBOX(),
|
||||
'WIDTH': this.tileSize.w,
|
||||
@@ -204,16 +241,24 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
},
|
||||
|
||||
|
||||
/** Once HTTPRequest has updated the url, reload the image div
|
||||
* @param {String} newUrl
|
||||
/**
|
||||
* Method: setURL
|
||||
* Once HTTPRequest has updated the url, reload the image div
|
||||
*
|
||||
* Parameters:
|
||||
* newUrl - {String}
|
||||
*/
|
||||
setUrl: function(newUrl) {
|
||||
OpenLayers.Layer.HTTPRequest.prototype.setUrl.apply(this, arguments);
|
||||
this.moveTo();
|
||||
},
|
||||
|
||||
/** Once HTTPRequest has updated new params, reload the image div
|
||||
* @param {Object} newParams
|
||||
/**
|
||||
* APIMethod: mergeNewParams
|
||||
* Once HTTPRequest has updated new params, reload the image div
|
||||
*
|
||||
* Parameters:
|
||||
* newParams - {Object}
|
||||
*/
|
||||
mergeNewParams:function(newParams) {
|
||||
var upperParams = OpenLayers.Util.upperCaseObject(newParams);
|
||||
@@ -224,15 +269,16 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
this.moveTo(null, true);
|
||||
},
|
||||
|
||||
/** combine the layer's url with its params and these newParams.
|
||||
/**
|
||||
* APIMethod: getFullRequestString
|
||||
* combine the layer's url with its params and these newParams.
|
||||
*
|
||||
* Add the SRS parameter from 'projection' -- this is probably
|
||||
* more eloquently done via a setProjection() method, but this
|
||||
* works for now and always.
|
||||
*
|
||||
* @param {Object} newParams
|
||||
*
|
||||
* @type String
|
||||
* Parameters:
|
||||
* newParams - {Object}
|
||||
*/
|
||||
getFullRequestString:function(newParams) {
|
||||
var projection = this.map.getProjection();
|
||||
|
||||
Reference in New Issue
Block a user