com.esri.adf.web.ve.data.imagery
Class VEImageryFunctionality

java.lang.Object
  extended by com.esri.adf.web.ve.data.imagery.VEImageryFunctionality
All Implemented Interfaces:
ExportFunctionality, GISFunctionality, MapFunctionality, MapFunctionality2, VEConstants, Serializable

public class VEImageryFunctionality
extends Object
implements MapFunctionality2, ExportFunctionality, VEConstants, Serializable

This class maintains the current, initial and full extent of the Bing™ Maps (formerly known as Virtual Earth) Imagery service. This class is necessary because the WebMap component needs an implementation of MapFunctionality to determine and maintain the different states of the extent. Also, the export method is needed by the Print task to compose a map image based on the Imagery serivce tiles.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.adf.web.data.MapFunctionality
FUNCTIONALITY_NAME
 
Fields inherited from interface com.esri.adf.web.data.export.ExportFunctionality
EXPORT_FUNCTIONALITY_NAME
 
Fields inherited from interface com.esri.adf.web.ve.data.VEConstants
MAP_STYLE_AERIAL, MAP_STYLE_AERIAL_WITH_LABEL, MAP_STYLE_ROAD, MAX_LEVEL_OF_DETAIL, MIN_LEVEL_OF_DETAIL, TILE_HEIGHT, TILE_WIDTH, VIRTUAL_EARTH_GEOCODE_WKID, VIRTUAL_EARTH_SPATIAL_REFERENCE_WKID, VIRTUAL_EARTH_XMAX, VIRTUAL_EARTH_XMIN, VIRTUAL_EARTH_YMAX, VIRTUAL_EARTH_YMIN
 
Constructor Summary
VEImageryFunctionality()
           
 
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.
 InputStream export(ExportProperties props)
           
 InputStream exportImage()
          This method is not implemented.
 WebExtent getCurrentExtent()
           Returns the current extent of this map.
 WebExtent getCurrentExtentInContextSR()
           Returns the current extent in the Web Context's spatial reference.
 WebExtent getCurrentVEExtent()
          Returns current extent in the spatial reference used by Bing Maps
 WebExtent getFullExtent()
           Returns the full extent of this map.
 WebExtent getInitialExtent()
           Returns the initial extent of this map.
 double getMapScale()
           Returns the current scale of this map.
 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.
 void setCurrentExtent(WebExtent newMapExtent)
           Sets the current extent of this map.
 void setDisabled(boolean disable)
           If true, this map functionality is disabled.
 void setMapScale(double mapScale)
          Sets the map scale
 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
 

Constructor Detail

VEImageryFunctionality

public VEImageryFunctionality()
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)

getCurrentExtentInContextSR

public WebExtent getCurrentExtentInContextSR()
Description copied from interface: MapFunctionality2

Returns the current extent in the Web Context's spatial reference.

Specified by:
getCurrentExtentInContextSR in interface MapFunctionality2
Returns:
the current WebExtent of this map
See Also:
WebContext.getSpatialReference()

exportImage

public InputStream exportImage()
This method is not implemented. Maps based on Bing Maps Imagery service tiles are provided by VETileFunctionality.

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

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

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

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. Note that transparency will not be applied for the lower most service. In a single service application that service is the lower most service and hence transparency will not be applied for it.

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

getCurrentVEExtent

public WebExtent getCurrentVEExtent()
Returns current extent in the spatial reference used by Bing Maps

Returns:
current extent in the spatial reference used by Bing Maps

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

setMapScale

public void setMapScale(double mapScale)
Sets the map scale

Parameters:
mapScale - the mapScale to set

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

setDisabled

public void setDisabled(boolean disable)
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:
disable - true if this map functionality is disabled

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. Note that transparency will not be applied for the lower most service. In a single service application that service is the lower most service and hence transparency will not be applied for it.

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

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()

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

export

public InputStream export(ExportProperties props)
Specified by:
export in interface ExportFunctionality

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