java.lang.Object | |
↳ | com.esri.android.map.Layer |
Known Direct Subclasses |
Known Indirect Subclasses |
The base layer for all layers that can be added into MapView
.
For more information about map layer types, read the Layer developer guide.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected UserCredentials | credentials | Gets the direct access of the credentials; You can access the credentials by the getCredentials() or
setCredentials(UserCredentials) ; but those two methods copy the instance internally. |
|||||||||
protected long | nativeHandle | ||||||||||
protected Map<Integer, ArcGISPopupInfo> | popUpInfos | ||||||||||
protected Object | serviceInfo |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Layer()
Instantiates an object of Layer.
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Layer(boolean initLayer) | |||||||||||
Layer(long handle)
Instantiates an object of Layer.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Popup |
createPopup(MapView mapView, int sublayerId, Graphic graphic)
Creates the popup.
| ||||||||||
UserCredentials |
getCredentials()
Gets a copy of the credentials attached to the Layer.
| ||||||||||
SpatialReference |
getDefaultSpatialReference()
Gets the defaultSpatialReference of the Layer.
| ||||||||||
Polygon |
getExtent()
Gets the current extent.
| ||||||||||
Envelope |
getFullExtent()
Returns the full extent of the layer.
| ||||||||||
int |
getHeight()
Gets the height of the Layer in screen units.
| ||||||||||
long |
getID()
Return the Layer runtime ID which is a long integer.
| ||||||||||
double |
getMaxScale()
Gets max scale.
| ||||||||||
double |
getMinScale()
Gets min scale.
| ||||||||||
String |
getName()
Gets the name of the layer.
| ||||||||||
float |
getOpacity()
Gets the opacity of the Layer.
| ||||||||||
Layer |
getParent()
Returns parent layer if the layer is in a group layer otherwise returning null.
| ||||||||||
ArcGISPopupInfo |
getPopupInfo(int sublayerId)
Gets the
PopupInfo associated with the sub-layer id. | ||||||||||
Map<Integer, ArcGISPopupInfo> |
getPopupInfos()
Gets the popup infos.
| ||||||||||
String |
getQueryUrl(int subLayerId)
Gets the query url.
| ||||||||||
double |
getResolution()
Gets the resolution of the Layer.
| ||||||||||
SpatialReference |
getSpatialReference()
Gets the current spatial reference of the Layer.
| ||||||||||
String |
getTitle()
Gets the title of the Layer.
| ||||||||||
String |
getUrl()
Gets the URL of the map service associated with the layer.
| ||||||||||
int |
getUrlHashCode()
A convenience method that returns the hash code of the map service URL.
| ||||||||||
String |
getWebMapLayerID()
Gets the web map layer id.
| ||||||||||
int |
getWidth()
Gets the width of the Layer in screen units.
| ||||||||||
boolean |
isInitialized()
Gets the initialized of the Layer.
| ||||||||||
boolean |
isRecycled()
Returns true or false if the Layer object has been recycled.
| ||||||||||
boolean |
isShowLegend()
Returns true if legend of the layer will be shown up; by default it is true; The property is usually defined in the
web map, a operation layer legend could be on or off.
| ||||||||||
boolean |
isVisible()
Gets the visibility of the Layer.
| ||||||||||
boolean |
isWebMapBaselayer()
Returns true if the layer is used as base layer in a web map.
| ||||||||||
void |
recycle()
Releases resources referenced by the Layer so that they can be recycled.
| ||||||||||
void |
reinitializeLayer(UserCredentials usercredentials)
Re-initializes the layer with the given credentials.
| ||||||||||
void |
setMaxScale(double maxScale)
Sets max scale.
| ||||||||||
void |
setMinScale(double minScale)
Sets min scale.
| ||||||||||
void |
setName(String name)
Sets the layer name.
| ||||||||||
void |
setOnStatusChangedListener(OnStatusChangedListener onStatusChangedListener)
Sets the onStatusChangedListener.
| ||||||||||
void |
setOpacity(float opacity)
Sets the opacity of the Layer.
| ||||||||||
void |
setPopupInfos(Map<Integer, ArcGISPopupInfo> popUpInfos)
Sets the popup infos.
| ||||||||||
void |
setQueryUrls(Map<Integer, String> queryUrls)
Sets the query urls.
| ||||||||||
void |
setVisible(boolean visible)
Sets the visibility of the Layer.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
changeStatus(OnStatusChangedListener.STATUS status)
Changes the STATUS of the layer and notifies the listener.
| ||||||||||
abstract long | create() | ||||||||||
void | finalize() | ||||||||||
float | getDpi() | ||||||||||
Envelope |
getInitialExtent()
Returns the initial extent of the layer.
| ||||||||||
ExecutorService |
getPoolExecutor()
Returns the ThreadPoolExecutor based on the context.
| ||||||||||
ExecutorService |
getServiceExecutor()
Returns the ThreadPoolExecutor based on the context.
| ||||||||||
abstract void |
initLayer()
Initializes the layer.
| ||||||||||
void |
initializeMinMaxScale(double initalMinScale, double initalMaxScale)
honor the webmaplayer min/max scale first, if it is not override, then using service min/max if they are set.
| ||||||||||
<T> T |
loadServiceInfo(Callable<T> task)
If the Layer is loaded as a WebMapLayer and the OnWebMapLoadListener is specified, the service information will be
loaded interactively.
| ||||||||||
synchronized long | lock() | ||||||||||
void |
setCredentials(UserCredentials credentials)
Sets the credentials of the Layer.
| ||||||||||
void |
setDefaultSpatialReference(SpatialReference defaultSpatialReference)
Sets the defaultSpatialReference of the Layer.
| ||||||||||
void | setFullExtent(Envelope extent) | ||||||||||
void |
setInitialExtent(Envelope e)
Sets the initial extent of layer.
| ||||||||||
void |
setUrl(String url)
Sets the URL of the map service associated with the layer.
| ||||||||||
void | unlock(long handle) | ||||||||||
void |
updateSpatialReferenceStatus(int SRStatus)
The callback method is invoked when the layer is added to map.
| ||||||||||
boolean |
verifyCredentials()
Returns true if the credentials is valid.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Gets the direct access of the credentials; You can access the credentials by the getCredentials()
or
setCredentials(UserCredentials)
; but those two methods copy the instance internally.
Instantiates an object of Layer.
Instantiates an object of Layer.
Creates the popup.
mapView | the map view |
---|---|
sublayerId | the sublayer id |
graphic | the graphic |
Gets a copy of the credentials attached to the Layer.
Gets the defaultSpatialReference of the Layer.
Gets the current extent.
Returns the full extent of the layer. Returns NULL if the layer does not have a full extent.
Gets the height of the Layer in screen units.
Return the Layer runtime ID which is a long integer. A zero will be returned if the Layer object is invalid.
Gets max scale. When map zooms in beyond max scale, graphics are not visible.
Gets min scale. When map zooms out beyond min scale, graphics are not visible.
Gets the name of the layer. The name is the name of the service if the layer is associated with a service, otherwise it is null. You should not call this method until the layer is initialized.
Gets the opacity of the Layer.
Returns parent layer if the layer is in a group layer otherwise returning null.
Gets the query url.
subLayerId | the sub layer id |
---|
Gets the resolution of the Layer.
Gets the current spatial reference of the Layer.
Gets the title of the Layer. WebMap may define title of a layer, when the layer is instantiated from a WebMap, it may have a tile.
Gets the URL of the map service associated with the layer.
A convenience method that returns the hash code of the map service URL. The hash codes for map service URLs are cached and this method spares the effort of the developer programmatically calculating the hash code.
Gets the width of the Layer in screen units.
Gets the initialized of the Layer.
Returns true or false if the Layer object has been recycled.
Returns true if legend of the layer will be shown up; by default it is true; The property is usually defined in the web map, a operation layer legend could be on or off.
Gets the visibility of the Layer.
Returns true if the layer is used as base layer in a web map.
Releases resources referenced by the Layer so that they can be recycled.
Re-initializes the layer with the given credentials.
usercredentials | the new credentials to try. |
---|
Sets max scale.
maxScale | max scale. |
---|
Sets min scale.
minScale | min scale. |
---|
Sets the onStatusChangedListener. When initialize a Layer, the OnStatusChangedListener notifies you the status
changes for INITIALIZED
or INITIALIZATION_FAILED
. When the initialization is failed,
you can use the getError()
to get the error details.
onStatusChangedListener | The onStatusChangedListener to set. |
---|
Sets the opacity of the Layer.
opacity | the opacity to set. |
---|
Sets the popup infos.
popUpInfos | the popup infos |
---|
Sets the query urls.
queryUrls | the query urls |
---|
Sets the visibility of the Layer.
visible | The visibility to set. |
---|
Changes the STATUS of the layer and notifies the listener.
status | the new STATUS. |
---|
Returns the initial extent of the layer. Returns the full extent if the initial extent is not valid.
Returns the ThreadPoolExecutor based on the context.
Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS
event accordingly.
honor the webmaplayer min/max scale first, if it is not override, then using service min/max if they are set.
initalMinScale | - min scale of service. |
---|---|
initalMaxScale | - max scale of service. |
If the Layer is loaded as a WebMapLayer and the OnWebMapLoadListener is specified, the service information will be loaded interactively.
task | the Task to load the service information. |
---|
Exception |
---|
Sets the credentials of the Layer. The layer holds the copy of the given instance.
credentials | The credentials to set. |
---|
Sets the defaultSpatialReference of the Layer.
defaultSpatialReference | The defaultSpatialReference to set. |
---|
Sets the initial extent of layer.
e | --an Envelope object. |
---|
Sets the URL of the map service associated with the layer.
url | the URL pointing to your map service. |
---|
The callback method is invoked when the layer is added to map. 0 - Spatial Reference Invalid 1 - Spatial Reference NotNeeded 2 - Spatial Reference Projected 3 - Spatial Reference Good
SRStatus | an integer indicating the spatial reference status of layer |
---|
Returns true if the credentials is valid.