Add text to specified location in WPF bing maps
-
Monday, September 03, 2012 6:21 PMIs 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
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);
- Marked As Answer by Richard_BrundrittMicrosoft Employee, Owner Tuesday, September 04, 2012 10:13 AM
- Unmarked As Answer by Evgeny Balykov Tuesday, September 04, 2012 7:45 PM
- Proposed As Answer by Richard_BrundrittMicrosoft Employee, Owner Tuesday, September 04, 2012 8:01 PM
- Marked As Answer by Evgeny Balykov Tuesday, September 04, 2012 8:11 PM
-
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
- Edited by Evgeny Balykov Tuesday, September 04, 2012 7:52 PM
-
Tuesday, September 04, 2012 8:01 PMOwner
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
- Proposed As Answer by Richard_BrundrittMicrosoft Employee, Owner Tuesday, September 04, 2012 8:02 PM
- Marked As Answer by Evgeny Balykov Tuesday, September 04, 2012 8:11 PM
-
Tuesday, September 04, 2012 8:13 PM
Thank you guys!
Evgeny Balykov

