Answered Add text to specified location in WPF bing maps

  • Monday, September 03, 2012 6:21 PM
     
     
    Is it possible to add text to specified location (lat/long) in WPF bing maps (possibly without pushpin)?

    Evgeny Balykov

All Replies

  • Tuesday, September 04, 2012 4:49 AM
     
     Answered

    create textblock object and set the properties...and then ad child to specific location to ur map

    eg.

    TextBlock textBlock = new TextBlock();

    textBlock.Text = Text;

    textBlock.FontSize = txtSize;

    ..

    ..

    ..

    MainMap.AddChild(textBlock, Location);

  • Tuesday, September 04, 2012 7:47 PM
     
     

    And what is "MainMap"?

    If it's instance of "Microsoft.Maps.MapControl.WPF.Map" then it does not have AddChild() method and MainMap.Children.Add() does not accept location argument either ...


    Evgeny Balykov


  • Tuesday, September 04, 2012 8:01 PM
    Owner
     
     Answered
    I believe in the code provided the MainMap variable is an instance of the MapLayer class. Add a MapLayer as a child of your map and then use the AddChild method on the layer to add the TextBlock.

    http://rbrundritt.wordpress.com

  • Tuesday, September 04, 2012 8:13 PM
     
     

    Thank you guys!


    Evgeny Balykov