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

java.lang.Object
  extended by com.esri.adf.web.ve.data.imagery.VETileFunctionality
All Implemented Interfaces:
GISFunctionality, TileFunctionality, VEConstants, Serializable

public class VETileFunctionality
extends Object
implements TileFunctionality, VEConstants, Serializable

This class connects to the Bing™ Maps (formerly known as Virtual Earth) Imagery Web Service to retrieve map tile metadata. It allows users to set the locale for the map labels as well as the map style: road, aerial or aerial with labels.

   <managed-property>
     <property-name>locale</property-name>
     <value>it_IT</value>
   </managed-property>
   <managed-property>
     <property-name>mapStyle</property-name>
     <value>AerialWithLabels</value>
   </managed-property>
 

See Also:
Serialized Form

Field Summary
static String VIRTUAL_EARTH_TILE_FUNCTIONALITY
          Returns the String identifying this tile functionality
 
Fields inherited from interface com.esri.adf.web.data.TileFunctionality
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
VETileFunctionality()
           
 
Method Summary
 void applyCandidateTileInfo(CandidateTileInfo candidate)
           Computes the tiles to be fetched by applying the info contained in the given candidate tile.
 void computeCurrentOriginContainingTile()
           Computes the top-left tile for the current extent.
 void destroyFunctionality()
           The cleanup chores (such as releasing held resources) for the functionality must be performed in this method.
 String getBaseUrl()
           Returns the base URL for the tiled images.
 String getBaseUrlWithdomain()
          Return the base URL with the subdomain field filled
 WebLodInfo getCurrentLodInfo()
           Returns the level of detail (LOD) used to display the current extent.
 ContainingTile getCurrentOriginContainingTile()
           Returns the top-left tile for the current extent.
 String getLocale()
          Returns the locale for this tile functionality.
 List<WebLodInfo> getLodInfos()
           Returns a List of the levels of detail (LODs) supported by this resource.
 String getMapStyle()
          Returns the map style set for this tile functionality.
 WebPoint getOrigin()
           Returns the origin of the tiling scheme used by this resource.
 GISResource getResource()
           Returns the GISResource associated with this functionality.
 String[] getSubDomain()
          Returns the sub-domains available for this tile functionality
 int getTileHeight()
           Returns the height of the tiled images.
 String getTileImageFormat()
           Returns the format of the tiled images.
 int getTileWidth()
           Returns the width of the tiled images.
 WebMap getWmap()
          Returns the WebMap associated to this tile functionality
 void initFunctionality(GISResource resource)
           The initialization chores for the functionality must be performed in this method.
 boolean isTilingAvailable()
           Returns true if tiling is available for this resource.
 boolean isUseVirtualCacheDirectory()
           Returns true if tiles are to be fetched using a direct URL to the tile image.
 void setLocale(String locale)
          Sets the locale for this tile functionality.
 void setMapStyle(String mapStyle)
          Sets the map style for this tile functionality.
 void zoomToLevel(int level)
           Zooms the map to the given level of detail (LOD).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIRTUAL_EARTH_TILE_FUNCTIONALITY

public static final String VIRTUAL_EARTH_TILE_FUNCTIONALITY
Returns the String identifying this tile functionality

See Also:
Constant Field Values
Constructor Detail

VETileFunctionality

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

applyCandidateTileInfo

public void applyCandidateTileInfo(CandidateTileInfo candidate)
Description copied from interface: TileFunctionality

Computes the tiles to be fetched by applying the info contained in the given candidate tile.

If there are no matching LODs for the LOD info contained in the candidate, no tiles will be fetched for this functionality and subsequent calls to TileFunctionality.getCurrentOriginContainingTile() will return null.

Specified by:
applyCandidateTileInfo in interface TileFunctionality
Parameters:
candidate - the CandidateTileInfo based on which the tiles to be fetched will be computed

computeCurrentOriginContainingTile

public void computeCurrentOriginContainingTile()
Description copied from interface: TileFunctionality

Computes the top-left tile for the current extent.

This is important because only this information is passed by the MapControl to the client browser. The JavaScript residing on the browser uses this information to fetch the required tiles by directly requesting the tile images from the server.

Specified by:
computeCurrentOriginContainingTile in interface TileFunctionality

getBaseUrl

public String getBaseUrl()
Description copied from interface: TileFunctionality

Returns the base URL for the tiled images. The client-side JavaScript append the virtual path or append the query string to this base URL to fetch the appropriate tiled image from the server.

Specified by:
getBaseUrl in interface TileFunctionality
Returns:
the base URL for the tiled images

getBaseUrlWithdomain

public String getBaseUrlWithdomain()
Return the base URL with the subdomain field filled


getWmap

public WebMap getWmap()
Returns the WebMap associated to this tile functionality

Returns:
the wmap

getCurrentLodInfo

public WebLodInfo getCurrentLodInfo()
Description copied from interface: TileFunctionality

Returns the level of detail (LOD) used to display the current extent.

The map tiles are generated by the server for pre-defined scales (LODs). This information is important to compute which LOD should be used to display the current extent requested by the user.

Specified by:
getCurrentLodInfo in interface TileFunctionality
Returns:
the level of detail (LOD) used to display the current extent

getCurrentOriginContainingTile

public ContainingTile getCurrentOriginContainingTile()
Description copied from interface: TileFunctionality

Returns the top-left tile for the current extent.

This is important because only this information is passed by the MapControl to the client browser. The JavaScript residing on the browser uses this information to fetch the required tiles by directly requesting the tile images from the server.

Specified by:
getCurrentOriginContainingTile in interface TileFunctionality
Returns:
the top-left tile for the current extent.

getLodInfos

public List<WebLodInfo> getLodInfos()
Description copied from interface: TileFunctionality

Returns a List of the levels of detail (LODs) supported by this resource.

The map tiles are generated by the server for pre-defined scales (LODs). This information is important to compute which LOD should be used to display the current extent requested by the user.

Specified by:
getLodInfos in interface TileFunctionality
Returns:
a List of the levels of detail supported by this resource

getOrigin

public WebPoint getOrigin()
Description copied from interface: TileFunctionality

Returns the origin of the tiling scheme used by this resource.

Specified by:
getOrigin in interface TileFunctionality
Returns:
the origin of the tiling scheme used by this resource

getTileHeight

public int getTileHeight()
Description copied from interface: TileFunctionality

Returns the height of the tiled images.

Specified by:
getTileHeight in interface TileFunctionality
Returns:
the height of the tiled images

getTileImageFormat

public String getTileImageFormat()
Description copied from interface: TileFunctionality

Returns the format of the tiled images. (For ex. jpg, png, etc.)

Specified by:
getTileImageFormat in interface TileFunctionality
Returns:
the format of the tiled images. (For ex. jpg, png, etc.)

getTileWidth

public int getTileWidth()
Description copied from interface: TileFunctionality

Returns the width of the tiled images.

Specified by:
getTileWidth in interface TileFunctionality
Returns:
the width of the tiled images

isTilingAvailable

public boolean isTilingAvailable()
Description copied from interface: TileFunctionality

Returns true if tiling is available for this resource.

If users try to use this functionality even when tiled maps are not supported by this resource, this method should return false. The WebMap uses this method to determine if it should fetch tiles or dynamically export images.

Specified by:
isTilingAvailable in interface TileFunctionality
Returns:
true if tiling is available

isUseVirtualCacheDirectory

public boolean isUseVirtualCacheDirectory()
Description copied from interface: TileFunctionality

Returns true if tiles are to be fetched using a direct URL to the tile image. If false, the tiles are fetched using a query string encoded URL.

Specified by:
isUseVirtualCacheDirectory in interface TileFunctionality
Returns:
true if tiles are to be fetched using a direct URL to the tile image

getMapStyle

public String getMapStyle()
Returns the map style set for this tile functionality. Road is used by default.

Returns:
the mapStyle

getSubDomain

public String[] getSubDomain()
Returns the sub-domains available for this tile functionality

Returns:
the subDomain

setMapStyle

public void setMapStyle(String mapStyle)
Sets the map style for this tile functionality. The map style is not case-sensitive. Possible styles are : Road, Aerial, AerialWithLabels

Parameters:
mapStyle - the mapStyle to set

zoomToLevel

public void zoomToLevel(int level)
Description copied from interface: TileFunctionality

Zooms the map to the given level of detail (LOD). If the requested level is not supported no action should be taken.

Specified by:
zoomToLevel in interface TileFunctionality
Parameters:
level - the level of detail (LOD) that the map should be zoomed to

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

setLocale

public void setLocale(String locale)
Sets the locale for this tile functionality. By default, the system's locale is used. Please see the Bing Maps Imagery Service's ImageryMetadataRequest.Culture documentation for a list of supported locales.

Parameters:
locale - the locale to set. The locale string can be in either Java format (eg: de_DE) or Microsoft format (eg: de-DE).

getLocale

public String getLocale()
Returns the locale for this tile functionality. By default, the system's locale is used.

Returns:
the locale