Adding Layer DataSources RRS feed

  • Question

  • I'm currently using the code below to add data sources to my virtual earth.  TheLayerName is a string and p is ConnectionParameters.  My problem is that I can add one layer and it appears correctly, but when I add a second, both of them disappear and then when I add a third all three layers appear.  I think I've ruled out that my code is causing this.  Does anyone know why this might be happening?

    map.GlobeControl.Host.DataSources.Add(new DataSourceLayerData(LayerControlHolder.TheLayerName, LayerControlHolder.TheLayerName, p.ToString(), DataSourceUsage.TextureMap));                
    Monday, July 20, 2009 2:28 PM


  • I can't immediately think of anything that would cause the exact behavior you describe, but a few things to check:

    Make sure you use different names (ids) for each DataSource.
    Try playing with the priority and opacity (mostly priority, opacity is always 1 by default) to see if there's something going on there. 

    Here's a few simple datasources you could test with.  You should be able to use any combination of them to get a sensible result.


    new DataSourceLayerData("a", "a",
    new ConnectionParameters("http://www.microsoft.com/Presspass/presskits/bing/images/bingLogo.jpg").ToString(),
    102, 0.5));


    new DataSourceLayerData("a", "b",
    new ConnectionParameters("http://www.coutant.org/photos/bing2.jpg").ToString(),
    101, 0.5));


    new DataSourceLayerData("a", "c",
    new ConnectionParameters("http://upload.wikimedia.org/wikipedia/en/7/70/Chandler_Bing.jpg").ToString(),
    100, 1.0));

    Wednesday, July 22, 2009 6:48 PM