com.esri.core.portal
Class WebMap

java.lang.Object
  extended by com.esri.core.portal.WebMap

public class WebMap
extends Object

This class represents a WebMap and provides access to the base layers and operational layers within a WebMap


Method Summary
 BaseMap getBaseMap()
          Returns the BaseMap of this WebMap.
 UserCredentials getCredentials()
          Returns the user credentials using on this webmap object.
 PortalItem getInfo()
          Returns the PortalItem that describes this WebMap.
 Envelope getInitExtent()
          Gets the initial extent of the web map
 List<WebMapLayer> getOperationalLayers()
          Returns the operational layers of this WebMap.
 String getVersion()
          Returns the version of this WebMap.
static WebMap newInstance(BaseMap basemap, Envelope extent, SpatialReference sr)
          Creates a WebMap using a BaseMap and Extent.
static WebMap newInstance(org.codehaus.jackson.JsonParser parser, Envelope extent, SpatialReference sr)
          Creates a WebMap using JSON data and Extent.
static void newInstance(PortalItem portalItem, CallbackListener<WebMap> callbackListener)
          Creates a WebMap from a PortalItem.
static void newInstance(String itemId, Portal portal, CallbackListener<WebMap> callbackListener)
          Creates a WebMap using an Item's id obtained from a Portal.
static void newInstance(URL itemIdURL, String username, String password, CallbackListener<WebMap> callbackListener)
          Creates a WebMap from a URL to an item id that represents this Web Map stored in a Portal.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInfo

public PortalItem getInfo()
Returns the PortalItem that describes this WebMap.

Returns:
the PortalItem that describes this WebMap

getBaseMap

public BaseMap getBaseMap()
Returns the BaseMap of this WebMap.

Returns:
the BaseMap

getOperationalLayers

public List<WebMapLayer> getOperationalLayers()
Returns the operational layers of this WebMap.

Returns:
a list of WebMapLayer

getVersion

public String getVersion()
Returns the version of this WebMap.

Returns:
the version

newInstance

public static void newInstance(PortalItem portalItem,
                               CallbackListener<WebMap> callbackListener)
Creates a WebMap from a PortalItem.

Parameters:
portalItem - - the item for which the webmap is to be created
callbackListener - - the callbacklistener returns with a webmap

newInstance

public static void newInstance(URL itemIdURL,
                               String username,
                               String password,
                               CallbackListener<WebMap> callbackListener)
Creates a WebMap from a URL to an item id that represents this Web Map stored in a Portal. A user name and password will be required if the requested WebMap is accessible only to authorized users. If a token is supplied with the URL, then the uname and pwd are ignored.

Parameters:
itemIdURL - A URL to an item stored in a portal
username - the username of a Portal user
password - the password of a Portal user
callbackListener - the listener returns with a initialized webmap

newInstance

public static void newInstance(String itemId,
                               Portal portal,
                               CallbackListener<WebMap> callbackListener)
Creates a WebMap using an Item's id obtained from a Portal. This constructor is useful for applications that prefer persisting the Item Id of an Item previously obtained from a Portal and then using the Id to retrieve the associated Item data.

Parameters:
itemId - the item ID - item id of the item
portal - the Portal - portal the user is a member of
callbackListener - - callback returns with an initialized webmap

newInstance

public static WebMap newInstance(org.codehaus.jackson.JsonParser parser,
                                 Envelope extent,
                                 SpatialReference sr)
                          throws Exception
Creates a WebMap using JSON data and Extent. Be cautious when using this method to create a WebMap, as there isn't a PortalItem backing it.

Parameters:
parser -
extent -
Throws:
Exception

newInstance

public static WebMap newInstance(BaseMap basemap,
                                 Envelope extent,
                                 SpatialReference sr)
Creates a WebMap using a BaseMap and Extent. Be cautious when using this method to create a WebMap, as there isn't a PortalItem backing it.

Parameters:
basemap -
sr -
extent -

getCredentials

public UserCredentials getCredentials()
Returns the user credentials using on this webmap object.

Returns:
The user credentials

getInitExtent

public Envelope getInitExtent()
Gets the initial extent of the web map

Returns:
the extent in EPSG:4326


Copyright © 2012. All Rights Reserved.