AGSWebMap Class Reference


Description

Instances of this class represent a webmap. A webmap is essentially a simple configuration file that describes the contents to be displayed in a map. You can use, create, and share webmaps interactively on www.ArcGIS.com or your own ArcGIS Portal.

Instantiating an object of AGSWebMap loads the webmap by retrieving its data from a server. To view the contents of the webmap, you need to open it using openIntoMapView: (AGSWebMap)

The webmap's delegate is kept informed whenver operations performed by the webmap complete successfully or encounter an error. For exmaple, as each layer in the webmap is loaded successfully, the delegate is informed. If any layers fail to load, the delegate is given an opportunity to skip to the next layer, or re-try loading the current layer with proper credentials if the layer was using a secured service. If the webmap contains a Bing Maps layer, the delegate is asked to provide a valid Bing Maps app ID to use with that layer.

Note, you should always open a webmap into a map view on the main thread.

See also:
Conceptual Doc: Viewing a Web Map
Since:
1.8
Inheritance diagram for AGSWebMap:
<AGSCoding> <AGSSecuredResource>

List of all members.

Public Member Functions

(void) - cancelOpen
(void) - continueOpenAndSkipCurrentLayer
(void) - continueOpenWithCredential:
(void) - decodeWithJSON:
(NSDictionary *) - encodeToJSON
(id) - initWithItemId:credential:
(id) - initWithItemId:portal:
(id) - initWithItemId:sharingEndPoint:credential:
(id) - initWithJSON:
(id) - initWithPortalItem:
(id) - initWithURL:credential:
(void) - openIntoMapView:
(void) - openIntoMapView:withAlternateBaseMap:
(void) - openIntoMapView:withAlternateBaseMap:resetMapView:
(AGSPopupInfo *) - popupInfoForDynamicMapServiceLayer:sublayerId:
(AGSPopupInfo *) - popupInfoForFeatureLayer:
(AGSPopupInfo *) - popupInfoForMapServiceLayerWithURL:sublayerId:
(AGSPopupInfo *) - popupInfoForTiledMapServiceLayer:sublayerId:

Static Public Member Functions

(AGSWebMap *) + webMapWithItemId:credential:
(AGSWebMap *) + webMapWithItemId:portal:
(AGSWebMap *) + webMapWithItemId:sharingEndPoint:credential:
(AGSWebMap *) + webMapWithPortalItem:
(AGSWebMap *) + webMapWithURL:credential:

Properties

AGSWebMapBaseMapbaseMap
NSArray * bookmarks
AGSCredentialcredential
id< AGSWebMapDelegatedelegate
BOOL loaded
NSArray * operationalLayers
AGSPortalItemportalItem
NSArray * queries
NSURL * URL
float version
BOOL zoomToDefaultExtentOnOpen

Member Function Documentation

- (void) cancelOpen  

Cancels opening the webmap.

Since:
1.8
- (void) continueOpenAndSkipCurrentLayer  

Continues opening the webmap and skips the current layer that failed.

Since:
1.8
- (void) continueOpenWithCredential: (AGSCredential *)  credential  

Continues opening the webmap with a credential.

Since:
1.8
- (void) decodeWithJSON: (NSDictionary *)  json   [optional, inherited]

Decode object from JSON representation.

Parameters:
json The JSON representation of the object to be decoded.
Since:
1.0
- (NSDictionary *) encodeToJSON   [optional, inherited]

Encode and return JSON representation for object.

Returns:
JSON representation of object.
Since:
1.0
- (id) initWithItemId: (NSString *)  itemId
credential: (AGSCredential *)  cred 

Initializes a webmap. The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
itemId The item id of the webmap on ArcGIS.com
cred The credential to access the webmap.
Since:
2.0
- (id) initWithItemId: (NSString *)  itemId
portal: (AGSPortal *)  portal 

Initializes a webmap based on the given portal and itemId. The item's type must be AGSPortalItemTypeWebMap.

The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
itemId The id of the item which is a webmap
portal The portal where the item resides
Since:
2.2
- (id) initWithItemId: (NSString *)  itemId
sharingEndPoint: (NSURL *)  sharingEndPoint
credential: (AGSCredential *)  cred 

Initializes a webmap. The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
itemId The item id of the webmap.
sharingEndPoint The sharing endpoint of the portal where the webmap is stored. For example, http://<my_arcgis_portal>/sharing/rest . Can be nil, in which case it is assumed the webmap is stored on ArcGIS.com.
cred The credential to access the webmap.
Since:
2.0
- (id) initWithJSON: (NSDictionary *)  json   [optional, inherited]

Initialize and return object from JSON representation.

Parameters:
json The JSON representation of the object to be created.
Returns:
Object decoded from JSON representation.
Since:
1.0

Reimplemented in AGSWebMapFeatureCollection.

- (id) initWithPortalItem: (AGSPortalItem *)  item  

Initializes a webmap based on the given portal item. The item's type must be AGSPortalItemTypeWebMap.

The delegate will be informed when the webmap's data is successfully retrieved from the server or if an error is encountered.

Parameters:
item The item which is a webmap
Since:
2.2
- (id) initWithURL: (NSURL *)  url
credential: (AGSCredential *)  cred 

Initializes a webmap. The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
url where the webmap's data can be accessed. For example, http://<my_arcgis_portal>/sharing/content/items/<web_map_id>/data
cred The credential to access the webmap.
Since:
2.0
- (void) openIntoMapView: (AGSMapView *)  mapView  

Starts opening a webmap into an AGSMapView. This method must be called on the main thread. The mapview will be reset before opening the webmap.

Parameters:
mapView The mapView to open the webmap into.
Since:
1.8
- (void) openIntoMapView: (AGSMapView *)  mapView
withAlternateBaseMap: (AGSWebMapBaseMap *)  baseMap 

Starts opening a webmap into an AGSMapView.

Parameters:
mapView The mapView to open the webmap into.
baseMap The alternate base map to use for opening the webmap. Can pass nil for this parameter, in which case it will use the default basemap.
Since:
2.2
- (void) openIntoMapView: (AGSMapView *)  mapView
withAlternateBaseMap: (AGSWebMapBaseMap *)  baseMap
resetMapView: (BOOL)  reset 

Starts opening a webmap into an AGSMapView. The other openIntoMapView methods all reset the AGSMapView before-hand. This method gives you the option of overriding that behavior. This is useful if you have your own basemap layers and you want to open the AGSWebMap over those layers. If you want to add only the operational layers (skipping the basemap layers), you can pass in an empty AGSWebMapBaseMap for the baseMap parameter. To get an empty AGSWebMapBaseMap you simply alloc and init it.

Parameters:
mapView The mapView to open the webmap into.
baseMap The alternate base map to use for opening the webmap. Can pass nil for this parameter, in which case it will use the default basemap.
reset Whether or not you want this method to reset the AGSMapView before it starts opening the AGSWebMap.
Since:
2.2
- (AGSPopupInfo*) popupInfoForDynamicMapServiceLayer: (AGSDynamicMapServiceLayer *)  dmsl
sublayerId: (NSInteger)  sublayerId 

Returns the AGSPopupInfo that is associated with the AGSDynamicMapSerciceLayer. This method does not create a new AGSPopupInfo. It returns a reference to an existing AGSPopupInfo.

Since:
2.0
- (AGSPopupInfo*) popupInfoForFeatureLayer: (AGSFeatureLayer *)  featureLayer  

Returns the AGSPopupInfo that is associated with the AGSFeatureLayer. This method does not create a new AGSPopupInfo. It returns a reference to an existing AGSPopupInfo.

Since:
2.0
- (AGSPopupInfo*) popupInfoForMapServiceLayerWithURL: (NSURL *)  url
sublayerId: (NSInteger)  sublayerId 

Returns the AGSPopupInfo that is associated with the layer of a particular url. This method does not create a new AGSPopupInfo. It returns a reference to an existing AGSPopupInfo.

Since:
2.0
- (AGSPopupInfo*) popupInfoForTiledMapServiceLayer: (AGSTiledMapServiceLayer *)  tmsl
sublayerId: (NSInteger)  sublayerId 

Returns the AGSPopupInfo that is associated with the AGSTiledMapServiceLayer. This method does not create a new AGSPopupInfo. It returns a reference to an existing AGSPopupInfo.

Since:
2.0
+ (AGSWebMap*) webMapWithItemId: (NSString *)  itemId
credential: (AGSCredential *)  cred 

Returns an autoreleased webmap. The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
itemId The item id of the webmap on ArcGIS.com
cred The credential to access the webmap.
Since:
2.0
+ (AGSWebMap*) webMapWithItemId: (NSString *)  itemId
portal: (AGSPortal *)  portal 

Returns an autoreleased webmap based on the given portal and itemId. The item's type must be AGSPortalItemTypeWebMap.

The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
itemId The id of the item which is a webmap
portal The portal where the item resides
Since:
2.2
+ (AGSWebMap*) webMapWithItemId: (NSString *)  itemId
sharingEndPoint: (NSURL *)  sharingEndPoint
credential: (AGSCredential *)  cred 

Returns an autoreleased webmap. The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
itemId The item id of the webmap.
sharingEndPoint The sharing endpoint of the portal where the webmap is stored. For example, http://<my_arcgis_portal>/sharing/rest . Can be nil, in which case it is assumed the webmap is stored on ArcGIS.com.
cred The credential to access the webmap.
Since:
2.0
+ (AGSWebMap*) webMapWithPortalItem: (AGSPortalItem *)  item  

Returns an autoreleased webmap based on the given portal item. The item's type must be AGSPortalItemTypeWebMap.

The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
item The item which is a webmap
Since:
2.2
+ (AGSWebMap*) webMapWithURL: (NSURL *)  url
credential: (AGSCredential *)  cred 

Returns an autoreleased webmap. The delegate will be informed when the webmap data is successfully retrieved from the server or if an error is encountered.

Parameters:
url where the webmap's data can be accessed. For example, http://<my_arcgis_portal>/sharing/content/items/<web_map_id>/data
cred The credential to access the webmap.
Since:
2.0

Property Documentation

- (AGSWebMapBaseMap*) baseMap [read, retain]

The basemap layer(s) in this webmap.

Since:
2.2
- (NSArray*) bookmarks [read, retain]

The bookmarks that this AGSWebMap contains.

Since:
2.0
- (AGSCredential*) credential [read, copy]

Credential used to access a secured resource

Since:
1.8

Reimplemented from <AGSSecuredResource>.

- (id<AGSWebMapDelegate>) delegate [read, write, assign]

The delegate for the webmap.

Since:
1.8
- (BOOL) loaded [read, assign]

Whether or not the webmap is loaded.

Since:
2.0
- (NSArray*) operationalLayers [read, retain]

An array of AGSWebMapLayerInfo objects representing the operational layers in this webmap.

Since:
2.2
- (AGSPortalItem*) portalItem [read, retain]

An instance of AGSPortalItem class representing this webmap.

Since:
2.2
- (NSArray*) queries [read, retain]

An array of AGSWebMapQuery objects representing the predefined queries that were authored with this webmap.

Since:
2.2
- (NSURL*) URL [read, copy]

The URL where the webmap's data can be accessed from. For example, http://<my_arcgis_portal>/sharing/content/items/<web_map_id>/data

Since:
1.8
- (float) version [read, assign]

This webmap's version information.

Since:
2.2
- (BOOL) zoomToDefaultExtentOnOpen [read, write, assign]

Determines whether the webmap zooms to the default webmap extent when it is opened into a mapview.

Since:
1.8