The following example URLs demonstrate how to access ArcWeb Services using REST. See map parameters and raster tile parameters for details on the different options you have for building your maps.
See the following sections for examples to get started using REST with ArcWeb Services:
The following samples demonstrate the required map parameters and best available map option.
The required parameters for a REST map are center point (c), scale factor (sf), and data source (ds). You also need to send in a token (tkn or usrid) validating you as an authorized ArcWeb user. The following examples show some basic map requests.
This request contains only the required parameters: token (tkn), center point (c), scale factor (sf), and data source (ds).
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200 |
This request returns the above map with an image width (w) of 800 pixels and a height (h) of 600 pixels.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200 &w=800&h=600 |
This request returns the above map with a grayscale style sheet (stl).
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200&w=800&h=600&stl=gs |
This request returns the above map in PNG format (fmt).
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200&w=800&h=600&stl=gs&fmt=png |
This request rotates the above map by an angle (a) of 45 degrees in a clockwise direction.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200&w=800&h=600&stl=gs&fmt=png&a=45 |
You can request the best available map (ds=bam), and the generated map will use the most appropriate data source for your input scale and center point. The following examples show how the data source changes as you change the center point (c) and scale factor (sf) parameter values.
In this example, the generated map uses the data source ArcWeb:TA.Streets.US.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=bam&sf=116200 |
If you change the center point to a place in Canada (c=-80.58657|45.99326), the generated map uses the data source ArcWeb:TA.Streets.NA.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-80.58657|45.99326&ds=bam&sf=116200 |
If you change the center point to a place in Europe (c=1.58657|45.99326), the generated map uses the data source ArcWeb:TA.Streets.EU.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=1.58657|45.99326&ds=bam&sf=116200 |
If you change the scale to a world view (sf=110000000), the generated map uses the data source ArcWeb:AND.World.Roads.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=1.58657|45.99326&ds=bam&sf=110000000 |
The following sample demonstrates how to pan a map using the c parameter. The first request gets a map. The second request pans the map.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117|34&sf=5000000&ds=ArcWeb:TA.Streets.US |
The map is returned in the default projection of 4326.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-120|33&sf=5000000&ds=ArcWeb:TA.Streets.US |
Note that the map is panned 3 decimal degrees to the west and 1 decimal degree to the south.
Use a ServiceInfo request to get a list of layer names and scale visibility information for a data source. Then use the layer parameters to turn layers on and off.
This request is used to obtain information on a data source's (ds) layer names and the scales at which they are visible. The response can be sorted by layer name or visibility using the order parameter (ord).
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMapServiceInfo<&tkn=ArcWeb Token OR &usrid=ArcWeb userid>&ds=ArcWeb:TA.Streets.US&ord=<scale or name> |
This request turns off the Oceans and Seas layer using two parameters: layer list (ll) and layer visibility (lv).
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=75000000&ds=ArcWeb:TA.Streets.US&c=-80.875871|33.93265&fmt=png&ocs=54015&ll=Oceans+and+Seas&lv=f |
This request turns off multiple layers using two parameters: layer list (ll) and layer visibility (lv). Note that each layer name is separated by a pipeline (|) and that layer visibility is turned off for each layer using a pipeline.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=75000000&ds=ArcWeb:TA.Streets.US&c=-80.875871|33.93265&fmt=png&ocs=54015&ll=U.S.+States+1|Oceans+and+Seas&lv=f|f |
The following samples demonstrate the acetate line, acetate point, and acetate polygon parameters.
This request overlays two polylines on a map. Notice for each polyline, three parameters are set: x|y coordinate series for line location (ln), color (lnc), and width (lnw).
|
EXAMPLE |
|
http://arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=83920754&ds=ArcWeb:TA.Streets.US&c=-117|34&ln=-117|34|-95|45|-85|40|-80|45&lnc=DD00FF00&lnw=5&ln=-100|30|-85|35|-95|40&lnc=DDFF0000&lnw=9 |
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=83920754&fmt=png&ds=ArcWeb:TA.Streets.US&c=-117|34&p=-117|34&p=-120|45&p=-100|40&pl=start&pi=airport.gif&pl=via&pi=pushpin_red.gif&pi=pushpin_blue.gif&pl=stop |
This request adds two polygons on your map. Notice for each polygon, two parameters are set: x|y coordinate series for vertices location (plg) and color (plc).
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=83920754&ds=ArcWeb:TA.Streets.US&c=-117|34&plg=-117|34|-120|45|-100|50&plc=330000FF&plg=-80|45|-100|50|-110|35|-90|30&plc=DD00DD00 |
The following samples demonstrate the graticule, legend, north arrow, scale bar, and combined north arrow and scale bar parameters.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=110000000&g=5 |
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200&l=10|5 |
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200&na=40|60&naw=70&nah=80&nat=gr |
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200&sbx=10|10&sbw=90&sbt=2 |
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&c=-117.58657|33.99326&ds=ArcWeb:TA.Streets.US&sf=116200&na=40|60&naw=70&nah=80&nat=bk&sbx=10|10&sbx=10|10&sbw=90&sbt=2 |
The following samples demonstrate best map projection, specific map projections, and the default projection for SVG format.
For each projected map, you need to make two requests. The first request returns a projected map and turns projection on using the ocs parameter. The second request works in projection mode and requires two additional parameters to pan and zoom the map: cmr and dc. The cmr value is derived from the results of the first projection request.
Projections in REST URLs are done this way so all the projection calculations are made on the server side. This ensures a swift response and makes it easy to use.
See projection parameters for valid values.
The following sample uses two requests. The first request gets a map and turns projection mode on. The second request pans and zooms the map within projection mode.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=250000000&ds=ArcWeb:AND.Roads.World&c=-117.875871|33.93265&fmt=svg&ocs=0 |
Note that the map is returned in projection 3 (Transverse Mercator). This information is returned in the desc tag (for SVG format) in the source. To view it, right-click on the map, click View Source, and view the contents of the desc tag. You will need this information for the cmr string in the next request. See projection parameters for details.
Once the projected map is turned on, use dc and cmr along with other required map parameters to pan the map 50 pixels to the west and 100 pixels to the south. Note that cmr can be obtained from the HTTP header or, for SVG format, right-click the map from the projection request and click View Source. Then copy the contents of the desc tag and assign that value to the cmr string in the URL for the request to pan the map. Note that ocs in the following request is set to 0.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf= 1000000&ds=ArcWeb:AND.Roads.World&c=-117.87587|33.93265&fmt=svg&ocs=0&cmr=-117.87587|33.93265|0.0|0.0|1000000.0|0.0|3&dc=50|100 |
The following sample uses two requests. The first request gets a map and turns projection mode on. The second request pans and zooms the map within projection mode.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=100000&ds=ArcWeb:AND.Roads.World&c=-117.87587|33.93265&fmt=svg&ocs=6 |
Right-click the map in the previous request and click View Source, copy the contents of the desc tag, and assign that value to the cmr string in the URL for this request.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=100000&ds=ArcWeb:AND.Roads.World&c=-117.87587|33.93265&fmt=svg&ocs=6&cmr=-117.875871|33.93265|0.0|0.0|100000.0|0.0|6&dc=50|100 |
Note that the map is panned 50 pixels to the west and 100 pixels to the south but the projection remains the same. To confirm, right-click the map, click View Source, and view the contents of the desc tag.
The following sample uses two requests. The first request gets a map and turns projection mode on. The second request pans and zooms the map within projection mode.
EXAMPLE |
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=100000&ds=ArcWeb:AND.Roads.World&c=-117.87587|33.93265&fmt=svg |
The map is returned in the default projection of 4326.
EXAMPLE |
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getMap<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&sf=100000&ds=ArcWeb:AND.Roads.World&c=-117.87587|33.93265&fmt=svg&cmr=-117.87587|33.93265|0.0|0.0|100000.0|0.0|4326&dc=50|100 |
Note that the map is panned 50 pixels to the west and 100 pixels to the south.
Use a getTileInfo request to obtain raster tile data source information. Then get available tiles or a raster tile image.
This request gets information about a raster tile data source (ds). This request uses the ArcWeb:ESRI.Satellite_Tiles.World data source.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getTileInfo<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&ds=ArcWeb:ESRI.Satellite_Tiles.World |
This request gets the available tiles at the specified scale for the given location. In addition to the required parameters for a REST map, the following client display parameters are required for a getTiles request to a raster data source: width (w) and height (h). The XML response includes a set of tiles at a particular level as welll as row and column information.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getTiles<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&ds=ArcWeb:ESRI.Satellite_Tiles.World&c=-117.0|34.0&sf=5000000&w=800&h=600 |
This request gets a raster tile image at a specified level. In addition to the required parameters for a REST map, the following parameters are required for a getTile request: tile level (lev), row level (row), and column level (col). The optional error request (re) parameter displays HTTP error codes if a tile is not found instead of a "Map imagery not available" image.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getTile<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&ds=ArcWeb:ESRI.Satellite_Tiles.World&lev=0&row=0&col=0&re=true |
This invalid request demonstrates the raster tile error request (re) parameter.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getTile<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&ds=ArcWeb:ESRI.Satellite_Tiles.World&lev=10&row=0&col=0&re=true |
This request gets a copyright for a raster tile image at a specified level. In addition to the required parameters for a REST map, the following client display parameters are required for a getCopyright request to a raster data source: width (w) and height (h). The XML response includes publication date and publisher.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006_1/restmap?actn=getCopyright<&tkn=ArcWeb Token OR &usrid=ArcWeb usrid>&ds=ArcWeb:ESRI.Satellite_Tiles.World&c=-117.0|34.0&sf=5000000&w=800&h=600 |
Visit the Feedback page to give comments or suggestions about the ArcWeb Developer's Guide.