locked
Add text to specified location in WPF bing maps RRS feed

  • Question

  • Is it possible to add text to specified location (lat/long) in WPF bing maps (possibly without pushpin)?

    Evgeny Balykov

    Monday, September 3, 2012 6:21 PM

Answers

  • 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 4, 2012 8:01 PM
  • 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 4, 2012 4:49 AM

All replies

  • 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 4, 2012 4:49 AM
  • 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 4, 2012 7:47 PM
  • 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 4, 2012 8:01 PM
  • Thank you guys!


    Evgeny Balykov

    Tuesday, September 4, 2012 8:13 PM