OpenLayers. Layer.WMS

Instances of OpenLayers.Layer.WMS are used to display data from OGC Web Mapping Services.  Create a new WMS layer with the OpenLayers.Layer.WMS constructor.

Inherits from

  • <OpenLayers.Layer.Grid>
Summary
Instances of OpenLayers.Layer.WMS are used to display data from OGC Web Mapping Services.
{Object} Hashtable of default parameter key/value pairs
{Boolean} Try to reproject this layer if its coordinate reference system is different than that of the base layer.
Create a new WMS layer object
Destroy this layer
Create a clone of this layer
Return a GetMap query string for this layer
{String} OpenLayers.Layer.WMS

Constants

DEFAULT_PARAMS

{Object} Hashtable of default parameter key/value pairs

Properties

reproject

{Boolean} Try to reproject this layer if its coordinate reference system is different than that of the base layer.  Default is true.  Set this in the layer options.  Should be set to false in most cases.

Functions

OpenLayers. Layer.WMS

Create a new WMS layer object

Example

var wms = new OpenLayers.Layer.WMS("NASA Global Mosaic",
"http://wms.jpl.nasa.gov/wms.cgi",
{layers: "modis,global_mosaic"});

Parameters

name{String} A name for the layer
url{String} Base url for the WMS (e.g.  http://wms.jpl.nasa.gov/wms.cgi)
params{Object} An object with key/value pairs representing the GetMap query string parameters and parameter values.
options{Ojbect} Hashtable of extra options to tag onto the layer

Return

A new OpenLayers.Layer.WMS instance

destroy

destroy: function()

Destroy this layer

clone

clone: function (obj)

Create a clone of this layer

Return

{OpenLayers.Layer.WMS} An exact clone of this layer

getURL

getURL: function (bounds)

Return a GetMap query string for this layer

Parameters

bounds{OpenLayers.Bounds} A bounds representing the bbox for the request

Return

{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters

Constants

CLASS_NAME

{String} OpenLayers.Layer.WMS

destroy: function()
Destroy this layer
clone: function (obj)
Create a clone of this layer
getURL: function (bounds)
Return a GetMap query string for this layer
Create a new WMS layer object
Instances of this class represent bounding boxes.