none
How do I just show the bing map traffic layer without that button? RRS feed

  • Question

  • My site's users just want to see local traffic, and many won't notice the "show traffic" button on Bing's map.  Others won't want to bother.  What sort of syntax should I be using to just get the map to load up with the traffic layer visible to begin with?

    Oh, and one other concern:  with the bing map on my site, any use of the arrow keys no longer scrolls down the page, but moves the center of the map.  I'd like to default back to scrolling through the page with arrow keys, if possible.

    • Edited by Cat-6 Monday, June 18, 2012 8:27 PM
    Monday, June 18, 2012 7:08 PM

Answers

  • Once 'map' is created, below snippet should show the traffic by default.

    Microsoft.Maps.loadModule('Microsoft.Maps.Traffic', { callback: function() { var trafficLayer = new Microsoft.Maps.Traffic.TrafficLayer(map);
             // show the traffic Layer
             trafficLayer.show();}
             }); 


    MSFT
    Hemant Goyal

    Monday, June 18, 2012 10:27 PM

All replies

  • Once 'map' is created, below snippet should show the traffic by default.

    Microsoft.Maps.loadModule('Microsoft.Maps.Traffic', { callback: function() { var trafficLayer = new Microsoft.Maps.Traffic.TrafficLayer(map);
             // show the traffic Layer
             trafficLayer.show();}
             }); 


    MSFT
    Hemant Goyal

    Monday, June 18, 2012 10:27 PM
  • Thanks a ton.  That really helped.
    Tuesday, June 19, 2012 12:01 AM