Select to view content in your preferred language

How to show live traffic on the map

3049
5
08-18-2016 09:58 AM
HuyHo
by
Frequent Contributor

When the ArcGIS online MapViewer, I can add the World Traffic Service to my base map.  Is there a way I can incorporate this service layer into my .NET app?

0 Kudos
5 Replies
JeremyMullins4
Deactivated User

Huy,

There is absolutely a way to do it. Simply reference the map server URL in your code as an ArcGISDynamicMapServiceLayer. We are able to do it in our application.

As a side note, we have created a small secondary application that allows us to organize all the relevant runtime content and online content into a JSON for our main mapping module to read; perhaps that would help as well?

HuyHo
by
Frequent Contributor

Thanks Jeremy. It didn't occur to me that the rendering of the traffic information is done through a tiled map service.  I see from the description that this map service requires authentication token.  I will give it a try.

Thanks for sharing with us how you build your application.  We are doing something similar, but it's based on an xml configuration file.  We let the user decide what map layers to be included in their maps.

JeremyMullins4
Deactivated User

Huy,

That's exactly what we let our customers do, too. Great minds think alike, huh?

And I misspoke - it is an ArcGISDynamicMapServiceLayer, not a tiled layer. It's pretty much real-time data. I have edited the original response to reflect this. My apologies for any confusion.

0 Kudos
HuyHo
by
Frequent Contributor

Thanks for the clarification.  Great minds DO think alike!

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Once you've authenticated with the Portal which hosts the trafffic service my advice would be to use the HelperServices.TrafficService Property to determine the URL of the service.

Cheers

Mike