com.esri.map
Class WmsDynamicMapServiceLayer

java.lang.Object
  extended by com.esri.map.Layer
      extended by com.esri.map.DynamicLayer
          extended by com.esri.map.WmsDynamicMapServiceLayer

public class WmsDynamicMapServiceLayer
extends DynamicLayer

The Class WmsDynamicMapServiceLayer.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.esri.map.Layer
Layer.LayerStatus
 
Field Summary
protected  SpatialReference[] supportedSRs
           
 
Fields inherited from class com.esri.map.DynamicLayer
_nativeCreateSpatialRef
 
Fields inherited from class com.esri.map.Layer
_credentials, _progress, _resolutionList, serviceInfo
 
Constructor Summary
WmsDynamicMapServiceLayer(String url)
          This constructor is used if you're instantiating the WMSLayer using a URL.
WmsDynamicMapServiceLayer(String url, boolean checkSupportedSRs)
          This constructor is used if you're instantiating the WMSLayer using a URL and checkSupportedSRs flag.
WmsDynamicMapServiceLayer(String url, List<String> initialLayers, List<String> initialStyles)
          Deprecated. 
WmsDynamicMapServiceLayer(String url, SpatialReference sr)
          This constructor is used if you're instantiating the WMSLayer using a URL and default spatial reference.
WmsDynamicMapServiceLayer(String url, SpatialReference sr, boolean checkSupportedSRs, String[] visibleLayers, UserCredentials credentials)
          This constructor is used if you're instantiating the WMSLayer using a URL, default spatial reference, checkSupportedSRs flag, visible layer names, user credential and initLayer flag.
WmsDynamicMapServiceLayer(String url, String[] visibleLayers)
          This constructor is used if you're instantiating the WMSLayer using a URL and visible layer names.
 
Method Summary
protected  void createNativeLayer()
           
 String getImageFormat()
          Returns the image format.
 WmsLayerInfo[] getLayers()
          Gets all layer information available in the service.
 LayerLegendInfoCollection getLegend()
           
 String[] getSupportedImageFormats()
          Gets the supported image formats.
 SpatialReference[] getSupportedSpatialReferences()
          Gets supported spatial references.
 String getVersion()
          Gets the WMS service's version.
 String[] getVisibleLayers()
          Gets visible layer names.
protected  void init(boolean isVisible, int[] visibleLayers, String title, float opacity)
          This method is called only when composing a Map from a Web Map.
protected  void initializeNativeLayer()
           
protected  void internalInit()
           
 boolean isTransparent()
          True if the image background is transparent.
 void setImageFormat(String format)
          Sets the image format as a string('image/png', etc.).
 void setTransparent(boolean transparent)
          Sets the image background to be transparent or not.
 void setVisibleLayers(String[] layerNames)
          Sets visible layers by specifying the layer names.
protected  void updateSpatialReferenceStatus(int SRStatus)
           
 
Methods inherited from class com.esri.map.DynamicLayer
getCenterMeridian, getDefaultSpatialReference, getResolution, isCrossesDateline, refresh, requestImage, setUrl, startlisteningToMapEvents, stopListeningToMapEvents
 
Methods inherited from class com.esri.map.Layer
addLayerInitializeCompleteListener, finalize, fireLayerCreateCompleteEvent, fireLayerCreateErrorEvent, fireLayerCreateErrorEvent, getCopyrightText, getCredentialsInternal, getDescription, getException, getExtent, getFullExtent, getInitialExtent, getInitializationError, getLayerHandle, getMap, getMapServer, getMapServerInfo, getMapServerLegendInfo, getMaxScale, getMinScale, getName, getOpacity, getPopupInfo, getResolutionList, getServiceDescription, getSpatialReference, getStatus, getUrl, getUrlHashCode, initializeAsync, internalGetLayerLegendInfos, isHidingNoDataTiles, isInitialized, isReady, isShowingCopyright, isVisible, loadServiceInfo, lock, recycle, reinitializeAsync, removeLayerInitializeCompleteListener, setCopyrightText, setCredentials, setDefaultSpatialReference, setDescription, setError, setException, setFullExtent, setInitialExtent, setLayerHandle, setMap, setMapServer, setName, setOpacity, setPopupInfos, setServiceDescription, setShowingCopyright, setStatus, setVisible, unlock
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

supportedSRs

protected SpatialReference[] supportedSRs
Constructor Detail

WmsDynamicMapServiceLayer

public WmsDynamicMapServiceLayer(String url)
This constructor is used if you're instantiating the WMSLayer using a URL.

Parameters:
url - URL string to the WMS layer.

WmsDynamicMapServiceLayer

public WmsDynamicMapServiceLayer(String url,
                                 String[] visibleLayers)
This constructor is used if you're instantiating the WMSLayer using a URL and visible layer names.

Parameters:
url - URL string to the WMS layer.
visibleLayers - names of sub-layers to be included in the image rendered(EPSG:3857, etc.).

WmsDynamicMapServiceLayer

public WmsDynamicMapServiceLayer(String url,
                                 SpatialReference sr)
This constructor is used if you're instantiating the WMSLayer using a URL and default spatial reference. A WMSLayer may support several spatial references. Users can specify a default spatial reference instead of asking WMSLayer to choose one automatically.

Parameters:
url - URL string to the WMS layer.
sr - default spatial reference of the layer.

WmsDynamicMapServiceLayer

public WmsDynamicMapServiceLayer(String url,
                                 boolean checkSupportedSRs)
This constructor is used if you're instantiating the WMSLayer using a URL and checkSupportedSRs flag. If checkSupportedSRs is false, it assumes that WMS layer can be projected to any spatial reference and it will not check if map's spatial reference is in the supported spatial reference list of the WMS layer. Users can set this flag to false if some spatial reference is supported by WMS service but not declared in its capability response.

Parameters:
url - URL string to the WMS layer.
checkSupportedSRs - a flag which indicate to check if map's spatial reference is in the WMSLayer's supported spatial reference list or not.

WmsDynamicMapServiceLayer

public WmsDynamicMapServiceLayer(String url,
                                 SpatialReference sr,
                                 boolean checkSupportedSRs,
                                 String[] visibleLayers,
                                 UserCredentials credentials)
This constructor is used if you're instantiating the WMSLayer using a URL, default spatial reference, checkSupportedSRs flag, visible layer names, user credential and initLayer flag.

Parameters:
url - URL string to the WMS layer.
sr - default spatial reference.
checkSupportedSRs - true if map's spatial reference is checked against spatial reference list supported by the WMS service when layer is added into map.
visibleLayers - names of sub-layers to be included in the image rendered.
credentials - user credential

WmsDynamicMapServiceLayer

@Deprecated
public WmsDynamicMapServiceLayer(String url,
                                            List<String> initialLayers,
                                            List<String> initialStyles)
Deprecated. 

Constructs the dynamic map service layer with a URL to the service end point.

Parameters:
url - the URL
initialLayers - the subset of layers from the service to display
initialStyles - the style of each of the initial layers
Method Detail

getLayers

public WmsLayerInfo[] getLayers()
Gets all layer information available in the service.

Returns:
an array of WMSLayerInfo objects.

getVisibleLayers

public String[] getVisibleLayers()
Gets visible layer names. If not set, all the layers are visible and a null is returned.

Returns:
visible layer name array.

setVisibleLayers

public void setVisibleLayers(String[] layerNames)
Sets visible layers by specifying the layer names.

Parameters:
layerNames - visible layer name array.

getSupportedImageFormats

public String[] getSupportedImageFormats()
Gets the supported image formats.

Returns:
supported image formats in String array.

getSupportedSpatialReferences

public SpatialReference[] getSupportedSpatialReferences()
Gets supported spatial references.

Returns:
spatial references in array.

setImageFormat

public void setImageFormat(String format)
Sets the image format as a string('image/png', etc.). Please ensure that the WMS service supports the requested image format.

Parameters:
format - image format in string.

isTransparent

public boolean isTransparent()
True if the image background is transparent. Please ensure that the WMS service supports this property. Default is true.

Returns:
true if image background is transparent.

setTransparent

public void setTransparent(boolean transparent)
Sets the image background to be transparent or not. Please ensure that the WMS service supports this property.

Parameters:
transparent - true if image background is set to transparent.

getImageFormat

public String getImageFormat()
Returns the image format. Default is 'image/png'.

Returns:
image format in String.

getVersion

public String getVersion()
Gets the WMS service's version.

Returns:
WMS service version in String.

updateSpatialReferenceStatus

protected void updateSpatialReferenceStatus(int SRStatus)
Overrides:
updateSpatialReferenceStatus in class Layer

internalInit

protected void internalInit()
Specified by:
internalInit in class Layer

createNativeLayer

protected void createNativeLayer()
Overrides:
createNativeLayer in class DynamicLayer

initializeNativeLayer

protected void initializeNativeLayer()
Overrides:
initializeNativeLayer in class DynamicLayer

init

protected void init(boolean isVisible,
                    int[] visibleLayers,
                    String title,
                    float opacity)
Description copied from class: Layer
This method is called only when composing a Map from a Web Map. The web map contains properties that every layer should be initialized with, up front.

Specified by:
init in class Layer

getLegend

public LayerLegendInfoCollection getLegend()
Specified by:
getLegend in class Layer


Copyright © 2012. All Rights Reserved.