0
votes

In my C++/XAML Windows 8.1 app, I want to use a pushpin to denote a location that the user has selected. The default pushpin is very limited and it doesn't even show all the text I add to the "Text" field of the pushpin.

I really want to show something similar to the default pushpin and under that a textblock with some text.

So I think I have to create a user control and use it as a custom pushpin. However, when I do this the "custom pushpin" doesn't appear on the map at the same location that the user selected. It feels like in order to get it at the same location, I need to get the margins of the user control right through hit and trial. What is the correct way to achieve what I am trying to do?

1
I haven't used that SDK, but I would imagine you would need to supply your own DataTemplate to use for a pushpin.Filip Skakun

1 Answers

0
votes

After playing around a little more, I was able to specify the correct position of the custom pushpin using the following API:

Bing::Maps::MapLayer::SetPositionAnchor(Windows::UI::Xaml::DependencyObject^, Windows::Foundation::Point)

See the API reference here.