Changeset 3532
- Timestamp:
- 06/29/07 03:25:23 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/tschaub/naturaldocs/lib/OpenLayers/Layer/HTTPRequest.js
r3037 r3532 5 5 6 6 /** 7 * @ class7 * @requires OpenLayers/Layer.js 8 8 * 9 * @requires OpenLayers/Layer.js 9 * Class: OpenLayers.Layer.HTTPRequest 10 * 11 * Inherits: 12 * - OpenLayers.Layer 10 13 */ 11 14 OpenLayers.Layer.HTTPRequest = OpenLayers.Class.create(); … … 13 16 OpenLayers.Class.inherit( OpenLayers.Layer, { 14 17 15 /** Used to hash URL param strings for multi-WMS server selection.16 * Set to the Golden Ratio per Knuth's recommendation.17 * 18 * @final @type Numeric18 /** 19 * Constant: URL_HASH_FACTOR 20 * {Float} Used to hash URL param strings for multi-WMS server selection. 21 * Set to the Golden Ratio per Knuth's recommendation. 19 22 */ 20 23 URL_HASH_FACTOR: (Math.sqrt(5) - 1) / 2, 21 24 22 /** This is either an array of url strings or a single url string. 23 * 24 * @type Array(String) or String */ 25 /** 26 * Property: url 27 * {Array(String) or String} This is either an array of url strings or 28 * a single url string. 29 */ 25 30 url: null, 26 31 27 /** Hashtable of key/value parameters 28 * 29 * @type Object */ 32 /** 33 * Property: params 34 * {Object} Hashtable of key/value parameters 35 */ 30 36 params: null, 31 37 32 /** Whether layer should reproject itself based on base layer locations.33 * This allows reprojection onto commercial layers. Default is false:34 * Most layers can't reproject, but layers which can create non-square35 * geographic pixels can, like WMS.36 * 37 * @type Boolean38 /** 39 * APIProperty: reproject 40 * {Boolean} Whether layer should reproject itself based on base layer 41 * locations. This allows reprojection onto commercial layers. 42 * Default is false: Most layers can't reproject, but layers 43 * which can create non-square geographic pixels can, like WMS. 38 44 */ 39 45 reproject: false, 40 46 41 47 /** 42 * @constructor 43 * 44 * @param {String} name 45 * @param {Array(String) or String} url 46 * @param {Object} params 47 * @param {Object} options Hashtable of extra options to tag onto the layer 48 * Constructor: OpenLayers.Layer.HTTPRequest 49 * 50 * Parameters: 51 * name - {String} 52 * url - {Array(String) or String} 53 * params - {Object} 54 * options - {Object} Hashtable of extra options to tag onto the layer 48 55 */ 49 56 initialize: function(name, url, params, options) { … … 56 63 57 64 /** 58 * 65 * APIMethod: destroy 59 66 */ 60 67 destroy: function() { … … 65 72 66 73 /** 67 * @param {Object} obj 68 * 69 * @returns An exact clone of this OpenLayers.Layer.HTTPRequest 70 * @type OpenLayers.Layer.HTTPRequest 74 * APIMethod: clone 75 * 76 * Parameters: 77 * obj - {Object} 78 * 79 * Return: 80 * {<OpenLayers.Layer.HTTPRequest>} An exact clone of this 81 * <OpenLayers.Layer.HTTPRequest> 71 82 */ 72 83 clone: function (obj) { … … 88 99 89 100 /** 90 * @param {String} newUrl 101 * APIMethod: setUrl 102 * 103 * Parameters: 104 * newUrl - {String} 91 105 */ 92 106 setUrl: function(newUrl) { … … 95 109 96 110 /** 97 * @param {Object} newParams 111 * APIMethod: mergeNewParams 112 * 113 * Parameters: 114 * newParams - {Object} 98 115 */ 99 116 mergeNewParams:function(newParams) { … … 102 119 103 120 /** 121 * Method: selectUrl 104 122 * selectUrl() implements the standard floating-point multiplicative 105 * hash function described by Knuth, and hashes the contents of the106 * given param string into a float between 0 and 1. This float is then107 * scaled to the size of the provided urls array, and used to select108 * a URL.123 * hash function described by Knuth, and hashes the contents of the 124 * given param string into a float between 0 and 1. This float is then 125 * scaled to the size of the provided urls array, and used to select 126 * a URL. 109 127 * 110 * @param {String} paramString111 * @param {Array(String)} urls112 * 113 * @returns An entry from the urls array, deterministically selected based114 * on the paramString.115 * @type String116 * 128 * Parameters: 129 * paramString - {String} 130 * urls - {Array(String)} 131 * 132 * Return: 133 * {String} An entry from the urls array, deterministically selected based 134 * on the paramString. 117 135 */ 118 136 selectUrl: function(paramString, urls) { … … 125 143 }, 126 144 127 /** combine url with layer's params and these newParams. 145 /** 146 * Method: getFullRequestString 147 * Combine url with layer's params and these newParams. 128 148 * 129 149 * does checking on the serverPath variable, allowing for cases when it … … 135 155 * WARNING: The altUrl parameter is deprecated and will be removed in 3.0. 136 156 * 137 * @param {Object} newParams 138 * @param {String} altUrl Use this as the url instead of the layer's url 157 * Parameters: 158 * newParams - {Object} 159 * altUrl - {String} Use this as the url instead of the layer's url 139 160 * 140 * 141 * @type String161 * Return: 162 * {String} 142 163 */ 143 164 getFullRequestString:function(newParams, altUrl) {
