none
How to determine if there is traffic info to show for the current view (Windows 8 map control, HTML/JS) RRS feed

  • Question

  • Our HTML/JS app uses the AJAX TrafficManager class to show traffic flow and local traffic incidents for a location the user specifies. 

    Is there a way to determine programmatically whether our TrafficManager instance is actually showing anything? We'd like to be able to change our UI based upon whether or not there is actual traffic flow/incidents to display (e.g. use a heading like "Local area" instead of "Local traffic" when there is no traffic).


    Tuesday, July 23, 2013 7:28 PM

Answers

  • There is no out of the box functionality for doing this. You can find a list of where traffic data is available here: http://msdn.microsoft.com/en-us/library/jj136866.aspx You could write some logic around this information. Perhaps create the bounding boxes for the countries that have traffic data and store them. Then check to see if any of the bounding boxes intersect with the bounding box of the current map view. If any one bounding box intersects then traffic data is likely to be in view.

    http://rbrundritt.wordpress.com

    Wednesday, July 24, 2013 8:28 PM