Bing maps silverlight control pushpin scaling problems.
Posted
by Rares Musina
on Stack Overflow
See other posts from Stack Overflow
or by Rares Musina
Published on 2010-04-05T23:08:24Z
Indexed on
2010/04/05
23:13 UTC
Read the original article
Hit count: 601
Baiscally my problem is that i've adapted a piece of code found here
which does exactly what I want it to do, that is scale some pushpin images according to the map's zoom level. The only problem is that I've adapted this code to run with the bing maps silverlight control (not virtual earth like in the original example) and now the images scale correclty, but they are repositioned and only reach the desired position when my zoom level is maximum. Any idea why? Help will be greatly appreciated :)
Modified code below:
var layer = new MapLayer();
map.AddChild(layer);
//Sydney
layer.AddChild(new Pin
{
ImageSource = new BitmapImage(new Uri("pin.png", UriKind.Relative)),
MapInstance = map
}, new Location(-33.86643, 151.2062), PositionMethod.Center);
becomes something like
layer.AddChild(new Pin
{
ImageSource = new BitmapImage(new Uri("pin.png", UriKind.Relative)),
MapInstance = map
}, new Location(-33.92485, 18.43883), PositionOrigin.BottomCenter);
I am assuming it has something to do with a different way in which bing maps anchors its UIelements. Details on that are also very userful. Thank you!
© Stack Overflow or respective owner