The following sample URLs demonstrate how to access ArcWeb Services using REST. See the parameters tables for details on the different options you have for building your maps.
See the following sections for samples to get started using REST with ArcWeb Services:
Using the required map parameters
Using acetate polygon parameter
Using north arrow and scale bar parameters
Using specific map projections
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/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/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/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/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/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/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/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.58657156871|45.9932659), the generated map uses the data source ArcWeb:TA.Streets.EU.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006/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/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/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/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.
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/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/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/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/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/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/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/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/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/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 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.
|
EXAMPLE |
|
http://www.arcwebservices.com/services/v2006/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/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/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/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/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.
Visit the Feedback page to give comments or suggestions about the ArcWeb Developer's Guide.