AGSWebMap Class Reference


Description

Instances of this class represent a webmap. A webmap is basically 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. At this time, only reading layer information, popup definitions, and bookmarks in a webmap is supported. All other information in the webmap is ignored.

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>

List of all members.

Public Member Functions

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

Static Public Member Functions

(AGSWebMap *) + webMapWithItemId:credential:
(AGSWebMap *) + webMapWithItemId:credential:error:
(AGSWebMap *) + webMapWithItemId:sharingEndPoint:credential:
(AGSWebMap *) + webMapWithItemId:sharingEndPoint:credential:error:
(AGSWebMap *) + webMapWithURL:credential:
(AGSWebMap *) + webMapWithURL:credential:error:

Properties

NSArray * bookmarks
BOOL containsBingLayer
AGSCredentialcredential
id< AGSWebMapDelegatedelegate
BOOL loaded
NSURL * URL
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
credential: (AGSCredential *)  cred 

Initializes a webmap. This is a synchronous operation. The calling thread will be blocked while the webmap data is retrieved from the server.

Parameters:
itemId The item id of the webmap. The webmap will be searched on ArcGIS.com
cred The credential to access the webmap.
error Will be populated with any error that occurs.
Deprecated:
Deprecated at 2.0. Use initWithItemId:credential: instead.
Since:
1.8
- (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 . 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) initWithItemId: (NSString *)  itemId
sharingEndPoint: (NSURL *)  sharingEndPoint
credential: (AGSCredential *)  cred 

Initializes a webmap. This is a synchronous operation. The calling thread will be blocked while the webmap data is retrieved from the server.

Parameters:
itemId The item id of the web webmapmap.
sharingEndPoint The sharing endpoint of the portal where the webmap is stored. For example, http://<my_arcgis_portal>/sharing . Can be nil, in which case it is assumed the webmap is stored on ArcGIS.com.
cred The credential to access the webmap.
error Will be populated with any error that occurs.
Deprecated:
Deprecated at 2.0. Use initWithItemId:sharingEndPoint:credential instead.
Since:
1.8
- (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
- (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
- (id) initWithURL: (NSURL *)  url
credential: (AGSCredential *)  cred 

Initializes a webmap. This is a synchronous operation. The calling thread will be blocked while the webmap data is retrieved from the server.

Parameters:
url where the webmap's data can be accessed from. For example, http://<my_arcgis_portal>/sharing/content/items/<web_map_id>/data
cred The credential to access the webmap.
error Will be populated with any error that occurs.
Deprecated:
Deprecated at 2.0. Use initWithURL:credential: instead.
Since:
1.8
- (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: (AGSWebMap *)  baseMap 

Starts opening a webmap into an AGSMapView.

Parameters:
mapView The mapView to open the webmap into.
baseMap A webmap that contains an alternate basemap to use, this basemap webmap must be loaded. Will ignore the operational layers of this webmap. Can pass nil for this parameter, in which case it will use the default basemap.
Since:
1.8
- (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
credential: (AGSCredential *)  cred 

Returns an autoreleased webmap. This is a synchronous operation. The calling thread will be blocked while the webmap data is retrieved from the server.

Parameters:
itemId The item id of the webmap. The webmap will be searched on ArcGIS.com
cred The credential to access the webmap.
error Will be populated with any error that occurs.
Deprecated:
Deprecated at 2.0. Use webMapWithItemId:credential: instead.
Since:
1.8
+ (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 . 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*) webMapWithItemId: (NSString *)  itemId
sharingEndPoint: (NSURL *)  sharingEndPoint
credential: (AGSCredential *)  cred 

Returns an autoreleased webmap. This is a synchronous operation. The calling thread will be blocked while the webmap data is retrieved from the server.

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 . Can be nil, in which case it is assumed the webmap is stored on ArcGIS.com.
cred The credential to access the webmap.
error Will be populated with any error that occurs.
Deprecated:
Deprecated at 2.0. Use webMapWithItemId:sharingEndPoint:credential: instead.
Since:
1.8
+ (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
+ (AGSWebMap*) webMapWithURL: (NSURL *)  url
credential: (AGSCredential *)  cred 

Returns an autoreleased webmap. This is a synchronous operation. The calling thread will be blocked while the webmap data is retrieved from the server.

Parameters:
url where the webmap's data can be accessed from. For example, http://<my_arcgis_portal>/sharing/content/items/<web_map_id>/data
cred The credential to access the webmap.
error Will be populated with any error that occurs.
Deprecated:
Deprecated at 2.0. Use webMapWithURL:credential: instead.
Since:
1.8

Property Documentation

- (NSArray*) bookmarks [read, retain]

The bookmarks that this AGSWebMap contains.

Since:
2.0
- (BOOL) containsBingLayer [read, assign]

Whether or not the webmap contains a bing layer. This property isn't guaranteed populated until the webmap is opened into a mapview. The reason is that it's value depends on the basemap used to open into a mapview.

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

Credential used to access a secured resource

Since:
1.8
- (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
- (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
- (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