public class

WebMap

extends Object
java.lang.Object
   ↳ com.esri.core.portal.WebMap

Class Overview

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

Summary

Protected Constructors
WebMap(JsonParser parser, PortalItem item)
Constructs an empty WebMap.
WebMap(PortalItem item)
Constructs an empty WebMap.
Public Methods
String getApplicationPropertiesJson()
Returns the Json string representing the application properties defined in the web map.
BaseMap getBaseMap()
Returns the BaseMap of this WebMap.
List<Bookmark> getBookmarks()
Returns a list of bookmarks defined for 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.
List<WebMapQuery> getPredefinedQueries()
Returns a list of predefined query that were authored with this WebMap.
String getVersion()
Returns the version of this WebMap.
static WebMap newInstance(PortalItem portalitem)
Creates a WebMap using an PortalItem.
static void newInstance(String itemId, Portal portal, CallbackListener<WebMap> callbackListener)
Creates a WebMap using an Item's id obtained from a Portal.
static WebMap newInstance(JsonParser parser, Envelope extent, SpatialReference sr)
Creates a WebMap using JSON data and Extent.
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.
static WebMap newInstance(String itemId, Portal portal)
Creates a WebMap using an Item's id obtained from a Portal.
static WebMap newInstance(BaseMap basemap, Envelope extent, SpatialReference sr)
Creates a WebMap using a BaseMap and Extent.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected WebMap (JsonParser parser, PortalItem item)

Constructs an empty WebMap. Users will never programmatically create a new instance of a WebMap.

Throws
Exception

protected WebMap (PortalItem item)

Constructs an empty WebMap. Users will never programmatically create a new instance of a WebMap.

Throws
Exception

Public Methods

public String getApplicationPropertiesJson ()

Returns the Json string representing the application properties defined in the web map.

Returns
  • a json string.

public BaseMap getBaseMap ()

Returns the BaseMap of this WebMap.

Returns
  • the BaseMap

public List<Bookmark> getBookmarks ()

Returns a list of bookmarks defined for this WebMap.

Returns
  • a list of Bookmark

public UserCredentials getCredentials ()

Returns the user credentials using on this webmap object.

Returns
  • The user credentials

public PortalItem getInfo ()

Returns the PortalItem that describes this WebMap.

Returns
  • the PortalItem that describes this WebMap

public Envelope getInitExtent ()

Gets the initial extent of the web map.

Returns
  • the extent in EPSG:4326

public List<WebMapLayer> getOperationalLayers ()

Returns the operational layers of this WebMap.

Returns
  • a list of WebMapLayer

public List<WebMapQuery> getPredefinedQueries ()

Returns a list of predefined query that were authored with this WebMap.

Returns
  • a list of Tasks

public String getVersion ()

Returns the version of this WebMap.

Returns
  • the version

public static WebMap newInstance (PortalItem portalitem)

Creates a WebMap using an PortalItem.

Parameters
portalitem the given PortalItem.
Returns
  • the web map
Throws
Exception the exception

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

public static WebMap newInstance (JsonParser parser, Envelope extent, SpatialReference sr)

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 the parser
extent the extent
sr the sr
Returns
  • the web map
Throws
Exception the exception

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

public static WebMap newInstance (String itemId, Portal portal)

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
Returns
  • the web map
Throws
Exception the exception

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 the base map of the webmap
extent the full extent of the web map.
sr the spatial reference of the map extent.
Returns
  • the web map