tags:

views:

1179

answers:

1

I'm using Infostrat's WPF wrapper for the Bing maps 3d control (blog here http://blogs.msdn.com/virtualearth3d/ ) and was wondering how to show traffic. I can see this is possible when I hit the 3d button in the browser and click on traffic. The solution is probably to use the AddLayer function which takes a string, but I can't figure out what the layer options are.

+2  A: 

Here's the code I used - I added this property to Infostrat's VE control:

public bool ShowTraffic
        {
            set
            {
                if(value)
                    GlobeControl.Host.DataSources.Add(new DataSourceLayerData("terrain", "traffic", "http://www.bing.com/maps/Manifests/TR.xml",
                        DataSourceUsage.TextureMap, 10, 1.0));

            }
        }

I figured that out from reading the documentation here: http://blogs.msdn.com/virtualearth3d/archive/2009/01/25/documentation.aspx

It's a great reference even if you're working in WPF. Keep in mind though the live Urls are now bings.

James Cadd