dojo.require("esri.arcgis.utils");The esri.arcgis.utils namespace has several utility methods to work with maps from ArcGIS.com.
| Method | Return Value | Description |
|---|---|---|
| esri.arcgis.utils.createMap(itemId/itemInfo, mapDiv, options?) | dojo.Deferred | Create a map using information from an ArcGIS.com item. At version 2.0 an object with the following specification will be passed to the callback.
{
map:<esri.Map>
}
At version 2.1 the response object also includes itemInfo, an array of information about each layer.
{
map: <esri.Map>,
itemInfo:{
item: <Object>,
itemData:<Object>
}
}
The createMap method appends base for all basemap layers and operational for operational layers to the index of each layer in the map. This allows you to easily access either the basemap or operational layers.
var layers = response.itemInfo.itemData.operationalLayers; |
| esri.arcgis.utils.getItem(itemId) | dojo.Deferred | Get details about the input ArcGIS.com item. An object with the following specification is passed to the callback:
{
item: <Object>,
itemData: <Object>
}
|
Create a map using information from an ArcGIS.com item. At version 2.0 an object with the following specification will be passed to the callback.
{
map:<esri.Map>
}
At version 2.1 the response object also includes itemInfo, an array of information about each layer.
{
map: <esri.Map>,
itemInfo:{
item: <Object>,
itemData:<Object>
}
}
The createMap method appends base for all basemap layers and operational for operational layers to the index of each layer in the map. This allows you to easily access either the basemap or operational layers.
var layers = response.itemInfo.itemData.operationalLayers;
| <String/Object> itemId/itemInfo | Required | An itemId for an ArcGIS.com item or the response object obtained from calling the esri.arcgis.utils.getItem method. | ||||||
| <String> mapDiv | Required | Container ID for referencing map. | ||||||
| <Object> options | Optional |
Optional parameters that define the map functionality:
|
var deferred = esri.arcgis.utils.createMap(agoId, "map", {
mapOptions: {
slider: true
},
bingMapsKey: bingMapsKey,
geometryServiceURL: "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
});
Get details about the input ArcGIS.com item. An object with the following specification is passed to the callback:
{
item: <Object>,
itemData: <Object>
}
| <String> itemId | Required | The itemId for the ArcGIS.com item. |