You are viewing an older version of Mapbox.js. Check out v3.3.1 for the latest.


Used to display WMS services as tile layers on the map. Extends TileLayer.

Usage example

var nexrad = L.tileLayer.wms("", {
	layers: 'nexrad-n0r-900913',
	format: 'image/png',
	transparent: true,
	attribution: "Weather data © 2012 IEM Nexrad"


Factory Description
L.tileLayer.wms( <String> baseUrl, <TileLayer.WMS options> options ) Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.


Includes all TileLayer options and additionally:

Option Type Default Description
layers String '' (required) Comma-separated list of WMS layers to show.
styles String '' Comma-separated list of WMS styles.
format String 'image/jpeg' WMS image format (use 'image/png' for layers with transparency).
transparent Boolean false If true, the WMS service will return images with transparency.
version String '1.1.1' Version of the WMS service to use.
crs CRS null Coordinate Reference System to use for the WMS requests, defaults to map CRS. Don't change this if you're not sure what it means.


Method Returns Description
setParams( <WMS parameters> params, <Boolean> noRedraw? ) this Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).