com.esri.adf.web.ags.data
Class AGSMapFunctionality

java.lang.Object
  extended bycom.esri.adf.web.ags.data.AGSMapFunctionality
All Implemented Interfaces:
GISFunctionality, MapFunctionality

public class AGSMapFunctionality
extends java.lang.Object
implements MapFunctionality


Field Summary
protected  AGSMapResource agsmapResource
           
protected  boolean disabled
           
protected  WebExtent fullExtent
           
protected  ImageDescription imageDesc
           
protected  WebExtent initialExtent
           
protected  MapDescription mapDesc
           
protected  double mapScale
           
protected  MapServerInfo serverInfo
           
protected  double transparency
           
 
Fields inherited from interface com.esri.adf.web.data.MapFunctionality
FUNCTIONALITY_NAME
 
Constructor Summary
AGSMapFunctionality()
           
 
Method Summary
 double computeCurrentMapScale()
           Computes the current scale of this map and returns the same to the user.
 void destroyFunctionality()
           The cleanup chores (such as releasing held resources) for the functionality must be performed in this method.
 java.io.InputStream exportImage()
           Exports this map for the current extent.
 EnvelopeN getCurrentAGSExtent()
           
 WebExtent getCurrentExtent()
           Returns the current extent of this map.
 WebExtent getFullExtent()
           Returns the full extent of this map.
 ImageDescription getImageDescription()
           
 WebExtent getInitialExtent()
           Returns the initial extent of this map.
 LayerDescription getLayerDescription(int layerId)
           
 LayerDescription[] getLayerDescriptions()
           
 MapLayerInfo getLayerInfo(int layerId)
           
 MapLayerInfo[] getLayerInfos()
           
 MapDescription getMapDescription()
           
 double getMapScale()
           Returns the current scale of this map.
 MapServerInfo getMapServerInfo()
           
 GISResource getResource()
           Returns the GISResource associated with this functionality.
 double getTransparency()
           Returns the transparency factor for this map functionality.
 void initFunctionality(GISResource resource)
           The initialization chores for the functionality must be performed in this method.
 boolean isDisabled()
           Returns true if this map functionality is disabled.
 boolean isHasSingleFusedMapCache()
           
 void setCurrentAGSExtent(EnvelopeN env)
           
 void setCurrentExtent(WebExtent newMapExtent)
           Sets the current extent of this map.
 void setDisabled(boolean disabled)
           If true, this map functionality is disabled.
 void setFullExtent(WebExtent extent)
           
 void setInitialExtent(WebExtent extent)
           
 void setMapDescription(MapDescription mapDesc)
           
 void setTransparency(double transparency)
           Sets the transparency factor for this map functionality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agsmapResource

protected AGSMapResource agsmapResource

initialExtent

protected WebExtent initialExtent

fullExtent

protected WebExtent fullExtent

disabled

protected boolean disabled

mapScale

protected double mapScale

serverInfo

protected MapServerInfo serverInfo

imageDesc

protected ImageDescription imageDesc

mapDesc

protected MapDescription mapDesc

transparency

protected double transparency
Constructor Detail

AGSMapFunctionality

public AGSMapFunctionality()
Method Detail

initFunctionality

public void initFunctionality(GISResource resource)
Description copied from interface: GISFunctionality

The initialization chores for the functionality must be performed in this method. This method is called by the resource when the functionality needs to be initialized. This happens either when the resource itself is being initialized or if users add this functionality to the resource using the GISResource.addFunctionality(String, GISFunctionality) method after the resource has already been initialized.

Classes which implement this method should maintain the resource as a class instance variable and return the same in the GISFunctionality.getResource() method. The functionality is ready for use only after this method has been called.

Specified by:
initFunctionality in interface GISFunctionality
Parameters:
resource - the GISResource that this functionality supports
See Also:
GISResource.init(WebContext)

destroyFunctionality

public void destroyFunctionality()
Description copied from interface: GISFunctionality

The cleanup chores (such as releasing held resources) for the functionality must be performed in this method. This method is called by the GISResource when the resource itself is being destroyed.

The functionality is no longer usable after this method has been called.

Specified by:
destroyFunctionality in interface GISFunctionality
See Also:
GISResource.destroy()

getMapServerInfo

public MapServerInfo getMapServerInfo()

getMapDescription

public MapDescription getMapDescription()

setMapDescription

public void setMapDescription(MapDescription mapDesc)

getLayerDescriptions

public LayerDescription[] getLayerDescriptions()

getLayerDescription

public LayerDescription getLayerDescription(int layerId)

getLayerInfos

public MapLayerInfo[] getLayerInfos()

getLayerInfo

public MapLayerInfo getLayerInfo(int layerId)

setCurrentAGSExtent

public void setCurrentAGSExtent(EnvelopeN env)

getCurrentAGSExtent

public EnvelopeN getCurrentAGSExtent()

getCurrentExtent

public WebExtent getCurrentExtent()
Description copied from interface: MapFunctionality

Returns the current extent of this map.

Specified by:
getCurrentExtent in interface MapFunctionality
Returns:
the current WebExtent of this map

setCurrentExtent

public void setCurrentExtent(WebExtent newMapExtent)
Description copied from interface: MapFunctionality

Sets the current extent of this map.

Specified by:
setCurrentExtent in interface MapFunctionality
Parameters:
newMapExtent - the current WebExtent of this map

exportImage

public java.io.InputStream exportImage()
Description copied from interface: MapFunctionality

Exports this map for the current extent. Implementations should ensure the following:

The WebMap calls this method on all its map functionalities and eventually fuses all the exported maps before streaming it to the user.

Specified by:
exportImage in interface MapFunctionality
Returns:
a java.io.InputStream to the exported image

isHasSingleFusedMapCache

public boolean isHasSingleFusedMapCache()

getImageDescription

public ImageDescription getImageDescription()

getFullExtent

public WebExtent getFullExtent()
Description copied from interface: MapFunctionality

Returns the full extent of this map.

Typically, this extent should be determined by the functionality when it is initialized.

Specified by:
getFullExtent in interface MapFunctionality
Returns:
the full WebExtent of this map

getInitialExtent

public WebExtent getInitialExtent()
Description copied from interface: MapFunctionality

Returns the initial extent of this map.

Typically, this extent should be determined by the functionality when it is initialized.

Specified by:
getInitialExtent in interface MapFunctionality
Returns:
the initial WebExtent of this map

getMapScale

public double getMapScale()
Description copied from interface: MapFunctionality

Returns the current scale of this map.

Specified by:
getMapScale in interface MapFunctionality
Returns:
the current scale of this map

computeCurrentMapScale

public double computeCurrentMapScale()

Computes the current scale of this map and returns the same to the user.

If the map is tiled, the scale of the current level of detail is assigned as the current map scale. Otherwise, the computeScale() method of the MapServer is called to compute the scale.

Returns:
the current scale of this map

isDisabled

public boolean isDisabled()
Description copied from interface: MapFunctionality

Returns true if this map functionality is disabled. If a map functionality is disabled, the WebMap will not call the MapFunctionality.exportImage() on that functionality while it is disabled.

A map functionality is typically disabled by unchecking the resource node in the Table of Contents control.

Specified by:
isDisabled in interface MapFunctionality
Returns:
true if this map functionality is disabled

getResource

public GISResource getResource()
Description copied from interface: GISFunctionality

Returns the GISResource associated with this functionality.

The resource passed to GISFunctionality.initFunctionality(GISResource) is maintained as a class variable and is accessible through this method.

Specified by:
getResource in interface GISFunctionality
Returns:
the GISResource associated with this functionality

setFullExtent

public void setFullExtent(WebExtent extent)

setInitialExtent

public void setInitialExtent(WebExtent extent)

setDisabled

public void setDisabled(boolean disabled)
Description copied from interface: MapFunctionality

If true, this map functionality is disabled. If a map functionality is disabled, the WebMap will not call the MapFunctionality.exportImage() on that functionality while it is disabled.

A map functionality is typically disabled by unchecking the resource node in the Table of Contents control.

Specified by:
setDisabled in interface MapFunctionality
Parameters:
disabled - true if this map functionality is disabled

getTransparency

public double getTransparency()
Description copied from interface: MapFunctionality

Returns the transparency factor for this map functionality. Valid values are from 0.0 through 1.0. A value of 1 means it is completely opaque while a value of 0 means it is completely transparent.

The WebMap uses this value after the map image has been exported and applies the transparency appropriately.

Specified by:
getTransparency in interface MapFunctionality
Returns:
the transparency factor for this map functionality

setTransparency

public void setTransparency(double transparency)
Description copied from interface: MapFunctionality

Sets the transparency factor for this map functionality. Valid values are from 0.0 through 1.0. A value of 1 means it is completely opaque while a value of 0 means it is completely transparent.

The WebMap uses this value after the map image has been exported and applies the transparency appropriately.

Specified by:
setTransparency in interface MapFunctionality
Parameters:
transparency - the transparency factor for this map functionality