com.esri.map
Class ArcGISTiledMapServiceLayer

java.lang.Object
  extended by com.esri.map.Layer
      extended by com.esri.map.ArcGISTiledMapServiceLayer

public class ArcGISTiledMapServiceLayer
extends Layer

An implementation of an ArcGIS Tiled Map Service. This class draws to a JComponent graphics context (JMap) and to an in-memory graphics context (JMap, Map) Additionally, it also draws its contents to an in-memory image maintained within this class for quick redraws of the contents of this individual layer if the state of the layer hasn't changed during a draw operation


Nested Class Summary
 
Nested classes/interfaces inherited from class com.esri.map.Layer
Layer.LayerStatus
 
Field Summary
protected  int[] displayLevels
           
protected  boolean isDirty
           
protected  ConcurrentHashMap<String,Future<?>> pending
           
protected static ExecutorService pool
           
 
Fields inherited from class com.esri.map.Layer
_credentials, _progress, _resolutionList, serviceInfo
 
Constructor Summary
ArcGISTiledMapServiceLayer()
          Constructs a new tiled map service layer.
ArcGISTiledMapServiceLayer(String url)
          Constructs a tiled map service layer.
ArcGISTiledMapServiceLayer(String url, UserCredentials credentials)
          Constructs a tiled map service layer from a URL and credentials for the secure service.
 
Method Summary
protected  void cancelRequest(int lod, int col, int row)
           
 void clearTiles()
          Cancels all current tile request.
protected  void createNativeLayer()
           
protected  void createResolutionList(TileInfo tileInfo)
          Creates the resolution list.
 SpatialReference getDefaultSpatialReference()
          Gets the defaultSpatialReference of the Layer.
protected  Rectangle getExtentBoundsOnScreen()
           
 LayerLegendInfoCollection getLegend()
           
 ArcGISPopupInfo getPopupInfo(int sublayerId)
           
 double getResolution()
          Gets the resolution of the Layer.
protected  void getTileAsynch(int lod, int col, int row, com.esri.map.TiledMapServiceLayer.TileListener tilecallback)
           
protected  void init(boolean isVisible, int[] displayLevels, String title, float opacity)
          This method is called only when composing a Map from a Web Map.
protected  void initializeNativeLayer()
           
protected  void internalInit()
           
protected  long nativeCreateLayer()
           
protected  boolean nativeInitialize(long layerHandle, int pWKT, String wkt, double originX, double originY, double minX, double minY, double maxX, double maxY, double[] lodScale, double[] lodResolution, int lodCount, int dpi, int tilePixelWidth, int tilePixelHeight)
           
protected  void nativeSetCachePath(long layerHandle, String path)
           
protected  void nativeSetTile(long layerHandle, int lod, int col, int row, byte[] pData, int size)
           
protected  void requestTile(int lod, int col, int row)
           
protected  void retrieveNoDataTileETag()
           
 void setUrl(String url)
          Sets the URL.
protected  void updateProgress()
          Update progress.
 
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, 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, updateSpatialReferenceStatus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isDirty

protected boolean isDirty

displayLevels

protected int[] displayLevels

pending

protected final ConcurrentHashMap<String,Future<?>> pending

pool

protected static final ExecutorService pool
Constructor Detail

ArcGISTiledMapServiceLayer

public ArcGISTiledMapServiceLayer()
Constructs a new tiled map service layer.


ArcGISTiledMapServiceLayer

public ArcGISTiledMapServiceLayer(String url)
Constructs a tiled map service layer.

Parameters:
url - A URL to the ArcGIS tiled map service end-point.

ArcGISTiledMapServiceLayer

public ArcGISTiledMapServiceLayer(String url,
                                  UserCredentials credentials)
Constructs a tiled map service layer from a URL and credentials for the secure service.

Parameters:
url - the URL
credentials - the credentials
Method Detail

internalInit

protected void internalInit()

createResolutionList

protected void createResolutionList(TileInfo tileInfo)
Creates the resolution list.

Parameters:
tileInfo - the tile info

getLegend

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

getResolution

public double getResolution()
Description copied from class: Layer
Gets the resolution of the Layer.

Overrides:
getResolution in class Layer
Returns:
resolution.

getDefaultSpatialReference

public SpatialReference getDefaultSpatialReference()
Description copied from class: Layer
Gets the defaultSpatialReference of the Layer. For service layers this is defined by the service.

Overrides:
getDefaultSpatialReference in class Layer
Returns:
Returns the defaultSpatialReference.

getPopupInfo

public ArcGISPopupInfo getPopupInfo(int sublayerId)
Overrides:
getPopupInfo in class Layer

getExtentBoundsOnScreen

protected Rectangle getExtentBoundsOnScreen()

getTileAsynch

protected void getTileAsynch(int lod,
                             int col,
                             int row,
                             com.esri.map.TiledMapServiceLayer.TileListener tilecallback)

initializeNativeLayer

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

retrieveNoDataTileETag

protected void retrieveNoDataTileETag()

requestTile

protected void requestTile(int lod,
                           int col,
                           int row)

cancelRequest

protected void cancelRequest(int lod,
                             int col,
                             int row)

setUrl

public void setUrl(String url)
Sets the URL.

Overrides:
setUrl in class Layer
Parameters:
url - the URL

clearTiles

public void clearTiles()
Cancels all current tile request. This method will cause the tiled layer to fetch new tiles in current extent and redraw.


init

protected void init(boolean isVisible,
                    int[] displayLevels,
                    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

createNativeLayer

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

updateProgress

protected void updateProgress()
Update progress.


nativeCreateLayer

protected long nativeCreateLayer()

nativeInitialize

protected boolean nativeInitialize(long layerHandle,
                                   int pWKT,
                                   String wkt,
                                   double originX,
                                   double originY,
                                   double minX,
                                   double minY,
                                   double maxX,
                                   double maxY,
                                   double[] lodScale,
                                   double[] lodResolution,
                                   int lodCount,
                                   int dpi,
                                   int tilePixelWidth,
                                   int tilePixelHeight)

nativeSetTile

protected void nativeSetTile(long layerHandle,
                             int lod,
                             int col,
                             int row,
                             byte[] pData,
                             int size)

nativeSetCachePath

protected void nativeSetCachePath(long layerHandle,
                                  String path)


Copyright © 2012. All Rights Reserved.