none
Silverlight Map Control - <MAP> tag issue RRS feed

  • Question

  • I'm using VS2010 RC and Silverlight 4. I have downloaded latest Bing Map Control SDK.

    The problem is that when i put ANY item inside <map> .... </map> tag, for example MapLayer or any shape whatever and name it - its not visible from the c# code - as if it does not exists. It does not matter I re-compile the solution or not - the result is still the same......

    Help NEEDED!!!

    • Moved by Ricky_Brundritt Friday, March 9, 2012 3:29 PM (From:Bing Maps: Map Control and Web services Development)
    Tuesday, April 27, 2010 6:31 AM

Answers

All replies

  • Are you able to access the map from the code? If so, and assuming your map is named "map", you can try

    MapLayer layer = (MapLayer) map.FindName("mapLayerName");

     

    Tuesday, April 27, 2010 6:39 PM
  • Are you able to access the map from the code? If so, and assuming your map is named "map", you can try

    MapLayer layer = (MapLayer) map.FindName("mapLayerName");

     


    The reason why i want to make this work is to be able to edit the content (inside <map> ... </map> tags) with visual editor (integrated in vs2010 rc). And yes, from the code I do have an access to the root MAP control, but nothing inside is accessable.....

    Very confused....

    Wednesday, April 28, 2010 12:35 PM
  • Are there any design-time warnings or errors?
    Friday, April 30, 2010 12:13 AM
  • You can certainly put a MapLayer inside the map and if you put a x:Name="Mylayer" it is acessible from within the C# code.

    full working example here:

    http://www.microsoft.com/maps/isdk/silverlight/#MapControlInteractiveSdk.Tutorials.Layers.TutorialAddRemoveShowHide


    Windows Live Developer MVP - www.soulsolutions.com.au - follow http://twitter.com/bingmapsdev for latest news.
    Wednesday, March 2, 2011 6:01 AM
    Moderator