English

How To: Create an ArcGIS.com Web map using URL parameters

Summary

Instructions provided describe how to create an ArcGIS.com Web map using parameters within a URL.

Note:
This article has been superceded by ArcGIS.com online help. See the topic entitled Using URL Parameters for the latest information.

Procedure

An ArcGIS.com Web map is composed of certain URL parameters. The URL always begins with the code shown below.

Code:
http://www.arcgis.com/home/webmap/viewer.html?

The URL also includes one or more of the parameters listed below. To see how each parameter works, click the Live Example link.

Note:
To include more than one parameter, use an ampersand (&) to separate the parameters. For example:

Code:
http://www.arcgis.com/home/webmap/viewer.html?center=20,45&level=4




  • Define the basemap used in the viewer.
    Set basemapUrl= to the map service. If a basemap is not defined, the default basemap will be the World Topo Basemap.

    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?
    basemapUrl=http://services.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer


  • Define the operational layers that overlay the basemap.
    Use either webmap= or url=.

    The webmap parameter accepts the Item ID of a Web Map saved to ArcGIS.com.
    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?webmap=2def3f0c7be74f05af33ac87b8d03ef2.

    The url parameter accepts a single service URL.
    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?
    url=http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Daytime_Population/MapServer


  • Center the map at a particular location.
    Set center= using geographic coordinates (X,Y) or projected coordinates (X,Y,WKID).

    Geographic Coordinates
    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?center=20,45

    Projected Coordinates
    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?center=500000,5500000,102100


  • Define the extent of the map.
    Use extent=. The extent parameter accepts geographic coordinates (GCS) as: MinX,MinY,MaxX,MaxY
    or projected coordinates (PCS) as: MinX,MinY,MaxX,MaxY,WKID.

    Geographic Coordinates
    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?extent=-117.20,34.055,-117.19,34.06

    Projected Coordinates
    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?extent=-13079253.954115,3959110.38566837,-12918205.318785,4086639.70193162,102113


  • Define the scale level of the map viewer.
    Use the center parameter and level=. The level parameter accepts the LevelID of the cache scale as listed in the REST service endpoint.

    The cache scale level can be determined using the information on the Map Service's REST endpoint. The resolution is inversely related to the scale.

    [O-Image] Cache Resolution Example
    Geographic Coordinates
    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?center=20,45&level=4

    Projected Coordinates
    Live Example
    Code:
    http://www.arcgis.com/home/webmap/viewer.html?center=500000,5500000,102100&level=4

Related Information