Bing Displays Silverlight Control Button Scaling Issues

Mostly my problem is that I adapted the code snippet found here.

http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/62e70670-f306-4bb7-8684-549979af91c1

which does exactly what I want to do this is to scale some proxy images according to the map zoom level. The only problem is that I adapted this code to work with silverlight control bin cards (not virtual ground, as in the original example), and now by correlating the image scale, but they move and 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);

-

layer.AddChild(new Pin
{
    ImageSource = new BitmapImage(new Uri("pin.png", UriKind.Relative)),
    MapInstance = map
}, new Location(-33.92485, 18.43883), PositionOrigin.BottomCenter);

, - , - UI-. . !

+3
3

, pushpin

+1

. direclty ( pushpin), CenterX CenterY . :

image.Source = new BitmapImage(new Uri("pin.png", UriKind.Relative));
image.Stretch = System.Windows.Media.Stretch.None;
image.Height = 152;
image.Width = 116;

layer.AddChild(image, new Location(-33.86643, 151.2062), PositionOrigin.BottomCenter);
image.RenderTransform = scaleTr;

scaleTr.CenterX = image.Width / 2; //image is alligned bottom center (see above)
scaleTr.CenterY = image.Height;
+1

Here is an example showing how Pushpins auto-reset with a Map ZoomLevel using a Pushpin object (instead of an Image object) and saves them in the right place. All with a little help from custom IValueConverter, ScaleTransform and a bit of data binding.

http://pietschsoft.com/post/2010/06/04/Resizing-and-Auto-Scaling-Pushpin-in-Bing-Maps-Silverlight.aspx

0
source

Source: https://habr.com/ru/post/1739919/


All Articles