Packagecom.esri.ags.layers
Classpublic class WMSLayer
InheritanceWMSLayer Inheritance DynamicMapServiceLayer Inheritance Layer Inheritance mx.core.UIComponent

Since : ArcGIS API for Flex 2.1

A layer for OGC Web Map Services.

Tip: If the WMS server doesn't have a crossdomain.xml file, you can either use a proxy or set skipGetCapabilities to true.

View the examples

See also

http://en.wikipedia.org/wiki/Web_Map_Service
Live sample - Map with WMS service


Public Properties
 PropertyDefined By
  abstract : String
The abstract for the WMS service.
WMSLayer
  disableClientCaching : Boolean
If true, adds a timestamp parameter ("_ts") to the HTTP request to prevent the request from being loaded from the browser's cache.
WMSLayer
  imageFormat : String
The output image format.
WMSLayer
  initialExtent : Extent
[override] Initial extent as defined by the web map service.
WMSLayer
 InheritedisInScaleRange : Boolean
[read-only] Returns true if the current scale of the map is between the maximum and minimum scale of the layer [added in version 1.3].
Layer
  layerInfos : Array
The list of layers available in this service.
WMSLayer
 Inheritedloaded : Boolean
[read-only] When the layer is loaded, the value becomes "true" and layer properties can be accessed.
Layer
 InheritedloadFault : Fault
[read-only] A reference to the fault that is dispatched when the layer throws a loadError event.
Layer
 Inheritedmap : Map
[read-only] A reference to the Map this layer is in.
Layer
  maxImageHeight : int
The maximum height, in pixels, supported by the WMS service.
WMSLayer
  maxImageWidth : int
The maximum width, in pixels, supported by the WMS service.
WMSLayer
 InheritedmaxScale : Number
The maximum scale of the layer [added in version 1.3].
Layer
 InheritedminScale : Number
The minimum scale of the layer [added in version 1.3].
Layer
  password : String
The password used to log in to the WMS server.
WMSLayer
  proxyURL : String
The URL to proxy the request through.
WMSLayer
  requestTimeout : int
The request timeout in seconds.
WMSLayer
  skipGetCapabilities : Boolean
Whether to skip the initial request to get capabilities.
WMSLayer
  spatialReference : SpatialReference
[override] The spatial reference of the web map service.
WMSLayer
  title : String
The title for the WMS service.
WMSLayer
  units : String
[override] The units of the layer.
WMSLayer
  url : String
Required.
WMSLayer
  username : String
The user name used to log in to the WMS server.
WMSLayer
  version : String
Gets or sets the WMS version [optional].
WMSLayer
  visibleLayers : IList
Required.
WMSLayer
Public Methods
 MethodDefined By
  
WMSLayer(url:String = null, proxyURL:String = null)
Creates a new WMSLayer object.
WMSLayer
 Inherited
refresh():void
Causes the layer to redraw or reload its content.
Layer
Protected Methods
 MethodDefined By
 Inherited
Adds listeners for ExtentEvent.EXTENT_CHANGE, ZoomEvent.ZOOM_START, ZoomEvent.ZOOM_UPDATE and ZoomEvent.ZOOM_END.
Layer
 Inherited
When an EXTENT_CHANGE event occurs, this calls invalidateLayer();
Layer
 Inherited
hideHandler(event:FlexEvent):void
When the layer is hidden (visible is set to false), this calls removeMapListeners().
Layer
 Inherited
Subclasses should call this whenever they would like to have updateLayer() called on them.
Layer
 Inherited
loadMapImage(loader:Loader):void
Subclasses must override this method.
DynamicMapServiceLayer
 Inherited
Removes all the layers children.
Layer
 Inherited
Removes the four event listeners added by addMapListeners();
Layer
 Inherited
setLoaded(value:Boolean):void
Subclasses must call this when they've loaded all their properties and are ready to load their content.
Layer
 Inherited
showHandler(event:FlexEvent):void
When the layer is shown (visible is set to true), this calls addMapListeners() and invalidateLayer().
Layer
 Inherited
toScreenX(mapX:Number):Number
Converts the x-coordinate of map point to a screen point.
Layer
 Inherited
toScreenY(mapY:Number):Number
Converts the y-coordinate of map point to a screen point.
Layer
 Inherited
Subclasses must override this method.
Layer
 Inherited
Finishes the zoom animation.
Layer
 Inherited
Prepares the zoom animation by taking a bitmap of the layer.
Layer
 Inherited
Redraws the bitmap of the layer.
Layer
Events
 Event Summary Defined By
 InheritedFires if the value of isInScaleRange changes.Layer
 InheritedFires after layer properties for the layer are successfully populated.Layer
 InheritedFires if the layer is unable to load.Layer
 InheritedFires when the layer has finished updating its content.Layer
 InheritedFires when the layer begins to update its content.Layer
Property Detail
abstractproperty
abstract:String

The abstract for the WMS service.

This property can be used as the source for data binding.


Implementation
    public function get abstract():String
    public function set abstract(value:String):void
disableClientCachingproperty 
disableClientCaching:Boolean

If true, adds a timestamp parameter ("_ts") to the HTTP request to prevent the request from being loaded from the browser's cache.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get disableClientCaching():Boolean
    public function set disableClientCaching(value:Boolean):void
imageFormatproperty 
imageFormat:String

Since : ArcGIS API for Flex 2.2

The output image format. Valid types are: png | jpg | gif. Only png and gif formats support transparency.

The default value is png.

This property can be used as the source for data binding.


Implementation
    public function get imageFormat():String
    public function set imageFormat(value:String):void
initialExtentproperty 
initialExtent:Extent[override]

Initial extent as defined by the web map service. Used by the map if it is the first layer in the map and map doesn't have an extent specified.

This property can be used as the source for data binding.


Implementation
    public function get initialExtent():Extent
    public function set initialExtent(value:Extent):void
layerInfosproperty 
layerInfos:Array

The list of layers available in this service.

This property can be used as the source for data binding.


Implementation
    public function get layerInfos():Array
    public function set layerInfos(value:Array):void

See also

maxImageHeightproperty 
maxImageHeight:int

The maximum height, in pixels, supported by the WMS service. Only used if value is greater than 0.

The default value is 0.

This property can be used as the source for data binding.


Implementation
    public function get maxImageHeight():int
    public function set maxImageHeight(value:int):void
maxImageWidthproperty 
maxImageWidth:int

The maximum width, in pixels, supported by the WMS service. Only used if value is greater than 0.

The default value is 0.

This property can be used as the source for data binding.


Implementation
    public function get maxImageWidth():int
    public function set maxImageWidth(value:int):void
passwordproperty 
password:String

The password used to log in to the WMS server. Only Basic authentication is supported.


Implementation
    public function get password():String
    public function set password(value:String):void
proxyURLproperty 
proxyURL:String

The URL to proxy the request through.

This property can be used as the source for data binding.


Implementation
    public function get proxyURL():String
    public function set proxyURL(value:String):void
requestTimeoutproperty 
requestTimeout:int

The request timeout in seconds. A value less than or equal to zero prevents request timeout.

The default value is -1.

This property can be used as the source for data binding.


Implementation
    public function get requestTimeout():int
    public function set requestTimeout(value:int):void
skipGetCapabilitiesproperty 
skipGetCapabilities:Boolean

Whether to skip the initial request to get capabilities. Set skipGetCapabilities if the site hosting the WMS service does not provide a cross domain policy file and you don't have a proxy page.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get skipGetCapabilities():Boolean
    public function set skipGetCapabilities(value:Boolean):void
spatialReferenceproperty 
spatialReference:SpatialReference[override]

The spatial reference of the web map service. If this is explicitly set, then it will be used instead of the map's own spatial reference when requesting a map from the service (only wkid is supported).

This property can be used as the source for data binding.


Implementation
    public function get spatialReference():SpatialReference
    public function set spatialReference(value:SpatialReference):void
titleproperty 
title:String

The title for the WMS service.

This property can be used as the source for data binding.


Implementation
    public function get title():String
    public function set title(value:String):void
unitsproperty 
units:String[override]

The units of the layer. If the layer is the basemap, the map is in these units.

The default value is UNKNOWN_UNITS.

This property can be used as the source for data binding.


Implementation
    public function get units():String
    public function set units(value:String):void

See also

urlproperty 
url:String

Required. Gets or sets the URL to a WMS service endpoint. For example, http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer, http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi.

This property can be used as the source for data binding.


Implementation
    public function get url():String
    public function set url(value:String):void
usernameproperty 
username:String

The user name used to log in to the WMS server. Only Basic authentication is supported.


Implementation
    public function get username():String
    public function set username(value:String):void
versionproperty 
version:String

Gets or sets the WMS version [optional]. If skipGetCapabilities property is set to true, this value determines version requested. If skipGetCapabilities is false, this value determines version to retrieve. Allowed values are 1.1.0, 1.1.1 or 1.3.0.

The default value is 1.3.0.

This property can be used as the source for data binding.


Implementation
    public function get version():String
    public function set version(value:String):void

See also

visibleLayersproperty 
visibleLayers:IList

Required. Gets or sets the unique layer names in a WMS service. Each name is a string value. At least one layer name must be defined.

This property can be used as the source for data binding.


Implementation
    public function get visibleLayers():IList
    public function set visibleLayers(value:IList):void

See also

Constructor Detail
WMSLayer()Constructor
public function WMSLayer(url:String = null, proxyURL:String = null)

Creates a new WMSLayer object.

Parameters
url:String (default = null) — URL to the WMS resource that represents a web map service.
 
proxyURL:String (default = null) — The URL to proxy the request through.
Examples
MXML usage of WMSLayer:
 <esri:Map width="1024" height="768">
     <esri:extent>
         <esri:Extent xmin="-120" ymin="34.1" xmax="-119.3" ymax="34.6">
             <esri:SpatialReference wkid="4326"/>
         </esri:Extent>
     </esri:extent>
     <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
     <esri:WMSLayer skipGetCapabilities="true"
                    url="http://hazards.fema.gov/wmsconnector/wmsconnector/Servlet/NFHL"
                    version="1.1.1">
         <esri:visibleLayers>
             <s:ArrayList>
                 <fx:String>Flood_Hazard_Zones_General</fx:String>
             </s:ArrayList>
         </esri:visibleLayers>
     </esri:WMSLayer>
 </esri:Map>