Do you need to publish public maps and apps using ArcGIS Online routing and traffic content? For example, you may want to use the Traffic Service within a city traffice web site. Or maybe you want to allow public citizens to use one of the Directions and Routing Services to find the closest COVID-19 Vaccination Centers.
To use these ArcGIS Online services, users of the map typically provide an ArcGIS Online login. However, this login isn’t something that a public citizen is going to have. So how do you enable your organization’s maps to access these premium services? We want to avoid a scenario where our users end up going to Google Maps where there is less functionality too.
One option is to do this as a developer using an App Token and OAuth. The process for setting this up is described here.
Another option doesn’t require any development skills and can be done through configuration as a standard ArcGIS Online user. Follow this below workflow:
1) Within the “My Content” page of ArcGIS.com, add an item.
2) Obtain the service REST endpoint. You can get this from the help documentation.
For example, the route service endpoint can be obtained from the REST documentation and will use: http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World
Or if you wanted to use the traffic service, look in the REST documentation to find this endpoint: http://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer
3) Enter the Username and Password that will be stored with this item. This will need to be an ArcGIS Online named user login. This option stores the credentials of the secure service.
4) Add the item.
5) On the item’s page, under the Settings Options, scroll to the bottom and choose “Limit Usage”.
6) This will open the Limit Usage options. Here, you can set criteria for which apps have access to the layer and set a maximum number of requests allowed for a specific period of time.
7) Share the item. If you want to make the service publicly available, share it with everyone. Sharing it with just the groups in your organization will still require users to login to access it.
8) Next, enjoy using that item in your public-facing maps and apps. You can reference it with REST Connection that is given in the item details page.
My service URL looks like this: https://utility.arcgis.com/usrsvcs/servers/<my-unique-id>/rest/services/World/Route/NAServer/Route_World
Note: The section where I filled in with <my-unique-id>. This is an ID that is assigned to each user that utilizes the Service URL’s provided by the ArcGIS platform. The ID’s can never be the same so I have hidden mine to prevent you from exhausting my account.
9) Finally, be sure that you implement this process responsibly. When you store credentials with the item, and then share that item publicly, it gives everyone access to that service using your supplied login. If done with a service that consumes credits for example, others that use the service will be deducting credits from your account. For that reason, it’s very important to properly configure the “Limit Usage” (step 6 above).
This workflow can be used to publicly publish other content hosted by Esri. For a summary of the different content available, see Ready-to-Use Content Included with Your Online Subscription. The exception is Demographic and Lifestyle layers. These layers cannot be published publicly yet.