OpenLayers.Layer.HTTPRequest - OpenLayers

# OpenLayers. Layer. HTTPRequest

#### Inherits from

- OpenLayers.Layer

Summary

OpenLayers. Layer. HTTPRequest |
Constants |
URL_HASH_FACTOR | {Float} Used to hash URL param strings for multi-WMS server selection.
Properties |
url | {Array(String) or String} This is either an array of url strings or a single url string.
params | {Object} Hashtable of key/value parameters
reproject | Deprecated.
Constructor |
OpenLayers. Layer. HTTPRequest |
Functions |
destroy |
clone |
setUrl |
mergeNewParams |
redraw | Redraws the layer.
selectUrl | selectUrl() implements the standard floating-point multiplicative hash function described by Knuth, and hashes the contents of the given param string into a float between 0 and 1.
getFullRequestString | Combine url with layer’s params and these newParams.

### Constants

### URL_HASH_FACTOR

{Float} Used to hash URL param strings for multi-WMS server selection. Set to the Golden Ratio per Knuth’s recommendation.

### Properties

### url

{Array(String) or String} This is either an array of url strings or a single url string.

### params

{Object} Hashtable of key/value parameters

### reproject

Deprecated. See http://trac.openlayers.org/wiki/SpatialMercator for information on the replacement for this functionality. {Boolean} Whether layer should reproject itself based on base layer locations. This allows reprojection onto commercial layers. Default is false: Most layers can’t reproject, but layers which can create non-square geographic pixels can, like WMS.

### Constructor

### OpenLayers. Layer. HTTPRequest

#### Parameters

name | {String}
url | {Array(String) or String}
params | {Object}
options | {Object} Hashtable of extra options to tag onto the layer

### Functions

### destroy

> destroy: function()

### clone

> clone: function ( | obj | )

#### Parameters

obj | {Object}

#### Returns

{OpenLayers.Layer.HTTPRequest} An exact clone of this OpenLayers.Layer.HTTPRequest

### setUrl

> setUrl: function( | newUrl | )

#### Parameters

newUrl | {String}

### mergeNewParams

> mergeNewParams:function( | newParams | )

#### Parameters

newParams | {Object}

#### Returns

redrawn: {Boolean} whether the layer was actually redrawn.

### redraw

> redraw: function( | force | )

Redraws the layer. Returns true if the layer was redrawn, false if not.

#### Parameters

force | {Boolean} Force redraw by adding random parameter.

#### Returns

{Boolean} The layer was redrawn.

### selectUrl

> selectUrl: function( | paramString,
> | urls | )

selectUrl() implements the standard floating-point multiplicative hash function described by Knuth, and hashes the contents of the given param string into a float between 0 and 1. This float is then scaled to the size of the provided urls array, and used to select a URL.

#### Parameters

paramString | {String}
urls | {Array(String)}

#### Returns

{String} An entry from the urls array, deterministically selected based on the paramString.

### getFullRequestString

> getFullRequestString:function( | newParams,
> | altUrl | )

Combine url with layer’s params and these newParams.

does checking on the serverPath variable, allowing for cases when it is supplied with trailing ? or &, as well as cases where not.

#### return in formatted string like this

”server?key1=value1&key2=value2&key3=value3”

WARNING: The altUrl parameter is deprecated and will be removed in 3.0.

#### Parameters

newParams | {Object}
altUrl | {String} Use this as the url instead of the layer’s url

#### Returns

{String}

> destroy: function()

> clone: function ( | obj | )

> setUrl: function( | newUrl | )

> mergeNewParams:function( | newParams | )

> redraw: function( | force | )

Redraws the layer.

> selectUrl: function( | paramString,
> | urls | )

selectUrl() implements the standard floating-point multiplicative hash function described by Knuth, and hashes the contents of the given param string into a float between 0 and 1.

> getFullRequestString:function( | newParams,
> | altUrl | )

Combine url with layer’s params and these newParams.
Close