geodev-hackerlabs

Create Authenticated Traffic Layer

ArcGIS Online provides a number of ready-to-use maps, layers and services. You can use any of these services and layers to enhance your applications. Some of the services require user authentication to access them and others are credit-consuming.

In this lab we will look at how to pre-authenticate the traffic layer so it can be accessed without prompting the user for credentials. The traffic layer is non-credit consuming but does require authentication.

Steps

  1. Go to arcgis.com and login.

  2. Go to My Content.

  3. Click Add Item > From the Web to access the traffic service.

    1. Set the following properties:

       Type: ArcGIS Server web service
       URL: http://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer
       Username: <yourname>
       Password: <yourpassword>
      

      Check `Store credentials with service item. Do not prompt for authentication`.

      Title: My Traffic Layer

    2. Click Add Item.

    This creates a new layer that points to the original Traffic layer.

  4. Click My Contents > My Traffic Layer. Select the Settings tab and click Limit Usage. Set the checkbox to enable rate limiting to 1000 requests per second.

  5. Click My Contents > My Traffic Layer > My Contents to identify the url. It should look something like this:

  http://utility.arcgis.com/usrsvcs/servers/<your id>/rest/services/World/Traffic/MapServer
  1. Click Open > Add to New Map. Then zoom in to a city in North America e.g. Portland, Oregon.

  2. Save the map.

Your map should look something like this.

Bonus